# JBoss Server unter Eclipse 3.1



## ChrisB512 (27. Okt 2005)

Hallo,

ich möchte einen JBoss-Server 4.0.3 in Eclipse 3.1 anlegen und starten!
Wenn ich aber unter Run->Debug bei JBoss 4.0.x "New" klicke, kommt folgende Fehlermeldung:

Message:
Problems occurred when invoking code from plug-in: "org.eclipse.jface".

Exception Stack Trace:
java.lang.NoSuchMethodError: org.eclipse.jdt.internal.debug.ui.launcher.LauncherMessages.getString(Ljava/lang/StringLjava/lang/String;
	at org.jboss.ide.eclipse.launcher.ui.configuration.ServerLaunchArgumentsTab.createControl(ServerLaunchArgumentsTab.java:86)
	at org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationTabGroupViewer.showTabsFor(LaunchConfigurationTabGroupViewer.java:720)
	at org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationTabGroupViewer.showInstanceTabsFor(LaunchConfigurationTabGroupViewer.java:639)
	at org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationTabGroupViewer.displayInstanceTabs(LaunchConfigurationTabGroupViewer.java:519)
	at org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationTabGroupViewer$5.run(LaunchConfigurationTabGroupViewer.java:471)
	at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:69)
	at org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationTabGroupViewer.inputChanged(LaunchConfigurationTabGroupViewer.java:488)
	at org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationTabGroupViewer.setInput(LaunchConfigurationTabGroupViewer.java:452)
	at org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationsDialog.handleLaunchConfigurationSelectionChanged(LaunchConfigurationsDialog.java:789)
	at org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationsDialog$3.selectionChanged(LaunchConfigurationsDialog.java:601)
	at org.eclipse.jface.viewers.StructuredViewer$3.run(StructuredViewer.java:763)
	at org.eclipse.core.internal.runtime.InternalPlatform.run(InternalPlatform.java:1044)
	at org.eclipse.core.runtime.Platform.run(Platform.java:783)
	at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:44)
	at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:148)
	at org.eclipse.jface.viewers.StructuredViewer.firePostSelectionChanged(StructuredViewer.java:761)
	at org.eclipse.jface.viewers.StructuredViewer.setSelection(StructuredViewer.java:1453)
	at org.eclipse.jface.viewers.Viewer.setSelection(Viewer.java:379)
	at org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationView.handleConfigurationAdded(LaunchConfigurationView.java:270)
	at org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationView.launchConfigurationAdded(LaunchConfigurationView.java:251)
	at org.eclipse.debug.internal.core.LaunchManager$ConfigurationNotifier.run(LaunchManager.java:1581)
	at org.eclipse.core.internal.runtime.InternalPlatform.run(InternalPlatform.java:1044)
	at org.eclipse.core.runtime.Platform.run(Platform.java:783)
	at org.eclipse.debug.internal.core.LaunchManager$ConfigurationNotifier.notify(LaunchManager.java:1605)
	at org.eclipse.debug.internal.core.LaunchManager.launchConfigurationAdded(LaunchManager.java:806)
	at org.eclipse.debug.internal.core.LaunchConfigurationWorkingCopy.writeNewFile(LaunchConfigurationWorkingCopy.java:278)
	at org.eclipse.debug.internal.core.LaunchConfigurationWorkingCopy.doSave0(LaunchConfigurationWorkingCopy.java:233)
	at org.eclipse.debug.internal.core.LaunchConfigurationWorkingCopy.doSave(LaunchConfigurationWorkingCopy.java:174)
	at org.eclipse.debug.internal.ui.launchConfigurations.CreateLaunchConfigurationAction.performAction(CreateLaunchConfigurationAction.java:75)
	at org.eclipse.debug.internal.ui.launchConfigurations.AbstractLaunchConfigurationAction$1.run(AbstractLaunchConfigurationAction.java:103)
	at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:69)
	at org.eclipse.debug.internal.ui.launchConfigurations.AbstractLaunchConfigurationAction.run(AbstractLaunchConfigurationAction.java:106)
	at org.eclipse.ui.actions.BaseSelectionListenerAction.runWithEvent(BaseSelectionListenerAction.java:167)
	at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:538)
	at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:488)
	at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:400)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:843)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3080)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2713)
	at org.eclipse.jface.window.Window.runEventLoop(Window.java:809)
	at org.eclipse.jface.window.Window.open(Window.java:787)
	at org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationsDialog.open(LaunchConfigurationsDialog.java:439)
	at org.eclipse.debug.ui.DebugUITools$1.run(DebugUITools.java:356)
	at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:69)
	at org.eclipse.debug.ui.DebugUITools.openLaunchConfigurationDialogOnGroup(DebugUITools.java:360)
	at org.eclipse.debug.ui.DebugUITools.openLaunchConfigurationDialogOnGroup(DebugUITools.java:302)
	at org.eclipse.debug.ui.actions.OpenLaunchDialogAction.run(OpenLaunchDialogAction.java:80)
	at org.eclipse.debug.ui.actions.OpenLaunchDialogAction.run(OpenLaunchDialogAction.java:99)
	at org.eclipse.ui.internal.PluginAction.runWithEvent(PluginAction.java:246)
	at org.eclipse.ui.internal.WWinPluginAction.runWithEvent(WWinPluginAction.java:223)
	at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:538)
	at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:488)
	at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:400)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:843)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3080)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2713)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1699)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1663)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:367)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:143)
	at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:103)
	at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:226)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:376)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:163)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at org.eclipse.core.launcher.Main.invokeFramework(Main.java:334)
	at org.eclipse.core.launcher.Main.basicRun(Main.java:278)
	at org.eclipse.core.launcher.Main.run(Main.java:973)
	at org.eclipse.core.launcher.Main.main(Main.java:948)

Session Data:
eclipse.buildId=M20050929-0840


Kann mir bitte jemand weiterhelfen? Ach ja, die JBoss-IDE habe ich über das Eclipse-Update installiert!

Grüße
Christian


----------



## Gast (21. Apr 2006)

Hi,
ich habe nun 6 Monate nach dir das gleiche Problem und finde nirgends Hilfe. Ich kann den Jboss Server händisch per .bat File starten, kann ihn aber unter eclipse nicht auswählen, bzw wird er dort gar nicht angezeigt. Und stattdessen schließt sich das Configurationsfenster. ????
Kannst du mir weiter helfen? 

Vielen Dank!!!!


----------



## Gast (4. Mai 2006)

Installer
   java -jar jboss-VERSION-installer.jar
   C:\Programme\jboss
   ejb3 für InstallationGroupPanel
   "default" als Name für Konfig
   NICHT "Enable deployment isolation/call by value"
   security domain: jmx-console
   Admin username: "admin" ohne Passwort

Umgebungsvariable
   SET JBOSS_HOME=C:\Programme\jboss
   SET JAVA_OPTS=-server

Einträge in server/default/conf/log4j.xml
   <appender name="HSKA" class="org.apache.log4j.RollingFileAppender">
      <param name="File" value="${jboss.server.home.dir}/log/hska.log"/>
      <param name="Append" value="true"/>
      <param name="MaxFileSize" value="512KB"/>
      <param name="MaxBackupIndex" value="2"/>
      <layout class="org.apache.log4j.PatternLayout">
         <param name="ConversionPattern" value="%d{ISO8601} %-5p %c - %m%n"/>
      </layout>
   </appender>

   <appender name="HSKA_ASYNC" class="org.apache.log4j.AsyncAppender">
      <appender-ref ref="HSKA"/>
   </appender>

   ...

   <category name="org.jboss">
      <priority value="INFO"/>
   </category>

   <category name="org.hibernate">
     <priority value="WARN"/>
   </category>

   <category name="org.hibernate.SQL">
      <priority value="DEBUG"/>
      <appender-ref ref="HSKA_ASYNC"/>
   </category>

   <category name="net.sf.ehcache">
      <priority value="ERROR"/>
   </category>

   ...
   <category name="de.hska">
      <priority value="DEBUG"/>
      <appender-ref ref="HSKA_ASYNC"/>
   </category>


server/default/lib
- hsqldb.jar und hsqldb-plugin.jar löschen
- postgresql-VERSION.jar hierher kopieren
- ehcache-VERSION.jar hierher kopieren

server/default/deploy/jbossweb-tomcat55.sar/server.xml
- Port 8080 kann ggf. geändert werden

server/default/deploy/jbossweb-tomcat55.sar/conf/web.xml editieren
- compilerSourceVM auf 1.5 setzen, d.h. Kommentare bei <init-param> entfernen

server/default/conf
- standardjaws.xml
     bei "Java:/DefaultDS" statt "Hypersonic SQL" eintragen von "PostgreSQL"

server/default/deploy
- hsqldb-ds.xml löschen
- docs/examples/jca/postgres-ds.xml hierher kopieren
- postgres-ds.xml editieren
     <jndi-name>DefaultDS
     <connection-url>jdbcostgresql:jbossdb
     <transaction-isolation>TRANSACTION_READ_COMMITTED</transaction-isolation>
     <user-name>jboss
     <password>jbosspassword

     <check-valid-connection-sql>   Kommentare entfernen

     <min-pool-size>0</min-pool-size>
     <max-pool-size>1</max-pool-size>

     <type-mapping>PostgreSQL 8.0

     Zusätzlicher Eintrag
        <local-tx-datasource>
           <jndi-name>JBossAdminDS</jndi-name>
           <connection-url>jdbcostgresql:jbossdb</connection-url>
           <driver-class>org.postgresql.Driver</driver-class>
           <transaction-isolation>TRANSACTION_READ_COMMITTED</transaction-isolation>
           <user-name>jboss</user-name>
           <password>jbosspassword</password>
           <check-valid-connection-sql>select 1</check-valid-connection-sql>
           <min-pool-size>1</min-pool-size>
           <max-pool-size>5</max-pool-size>
           <metadata>
              <type-mapping>PostgreSQL 8.0</type-mapping>
           </metadata>
        </local-tx-datasource>

     Zusätzlicher Eintrag für das Vorlesungsbeispiel
        <local-tx-datasource>
           <jndi-name>hskadb</jndi-name>
           <connection-url>jdbcostgresql:hskadb</connection-url>
           <driver-class>org.postgresql.Driver</driver-class>
           <transaction-isolation>TRANSACTION_READ_COMMITTED</transaction-isolation>
           <user-name>hska</user-name>
           <password>hskapassword</password>
           <check-valid-connection-sql>select 1</check-valid-connection-sql>
           <min-pool-size>1</min-pool-size>
           <max-pool-size>5</max-pool-size>
           <metadata>
              <type-mapping>PostgreSQL 8.0</type-mapping>
           </metadata>
        </local-tx-datasource>


server/default/deploy/jms
- hsqldb-jdbc2-service.xml und hsqldb-jdbc-state-service.xml löschen
- docs/examples/jms/postgres-jdbc2-service.xml hierher kopieren
- postgres-jdbc2-service.xml editieren
     name=PostgresDS ändern in name=JBossAdminDS

    Ergänzen um:
    <mbean code="org.jboss.mq.sm.jdbc.JDBCStateManager" name="jboss.mq:service=StateManager">
      <depends optional-attribute-name="ConnectionManager">jboss.jca:service=DataSourceBinding,name=JBossAdminDS</depends>
      <attribute name="SqlProperties">
        CREATE_TABLES_ON_STARTUP = TRUE
        CREATE_USER_TABLE = CREATE TABLE JMS_USERS (USERID VARCHAR(32) NOT NULL, PASSWD VARCHAR(32) NOT NULL, \
                                                   CLIENTID VARCHAR(128), PRIMARY KEY(USERID))
        CREATE_ROLE_TABLE = CREATE TABLE JMS_ROLES (ROLEID VARCHAR(32) NOT NULL, USERID VARCHAR(32) NOT NULL, \
                                                 PRIMARY KEY(USERID, ROLEID))
        CREATE_SUBSCRIPTION_TABLE = CREATE TABLE JMS_SUBSCRIPTIONS (CLIENTID VARCHAR(128) NOT NULL, \
                                                   SUBNAME VARCHAR(128) NOT NULL, TOPIC VARCHAR(255) NOT NULL, \
                                                 SELECTOR VARCHAR(4000), PRIMARY KEY(CLIENTID, SUBNAME))
        GET_SUBSCRIPTION = SELECT TOPIC, SELECTOR FROM JMS_SUBSCRIPTIONS WHERE CLIENTID=? AND SUBNAME=?
        LOCK_SUBSCRIPTION = SELECT TOPIC, SELECTOR FROM JMS_SUBSCRIPTIONS WHERE CLIENTID=? AND SUBNAME=?
        GET_SUBSCRIPTIONS_FOR_TOPIC = SELECT CLIENTID, SUBNAME, SELECTOR FROM JMS_SUBSCRIPTIONS WHERE TOPIC=?
        INSERT_SUBSCRIPTION = INSERT INTO JMS_SUBSCRIPTIONS (CLIENTID, SUBNAME, TOPIC, SELECTOR) VALUES(?,?,?,?)
        UPDATE_SUBSCRIPTION = UPDATE JMS_SUBSCRIPTIONS SET TOPIC=?, SELECTOR=? WHERE CLIENTID=? AND SUBNAME=?
        REMOVE_SUBSCRIPTION = DELETE FROM JMS_SUBSCRIPTIONS WHERE CLIENTID=? AND SUBNAME=?
        GET_USER_BY_CLIENTID = SELECT USERID, PASSWD, CLIENTID FROM JMS_USERS WHERE CLIENTID=?
        GET_USER = SELECT PASSWD, CLIENTID FROM JMS_USERS WHERE USERID=?
        POPULATE.TABLES.01 = INSERT INTO JMS_USERS (USERID, PASSWD) VALUES ('guest', 'guest')
        POPULATE.TABLES.02 = INSERT INTO JMS_USERS (USERID, PASSWD) VALUES ('j2ee', 'j2ee')
        POPULATE.TABLES.04 = INSERT INTO JMS_USERS (USERID, PASSWD) VALUES ('nobody', 'nobody')
        POPULATE.TABLES.06 = INSERT INTO JMS_ROLES (ROLEID, USERID) VALUES ('guest','guest')
        POPULATE.TABLES.14 = INSERT INTO JMS_ROLES (ROLEID, USERID) VALUES ('noacc','nobody')
      </attribute>
    </mbean>

server/default/deploy/ejb-timer-service.xml
  name=DefaultDS ändern in name=JBossAdminDS

PostgreSQL-Datenbank jbossdb mit User jboss/jbosspassword anlegen
  createdb -U postgres jbossdb
  createuser -S -D -R -P -U postgres jboss
      Unter der Kennung "postgres" einen neuen User "jboss" anlegen
      -S: Keine Superuser-Privilegien
      -D: Keine Privilegien, um eine neue DB anzulegen
      -R: Keine Privilegien, um eine neue Rolle zu erzeugen
  psql -c "CREATE SCHEMA AUTHORIZATION jboss" -d jbossdb -U postgres
  psql -c "GRANT CREATE ON SCHEMA jboss TO jboss" -d jbossdb -U postgres -als beispiel mit datenbank postgres-

Variable JBOSS_HOME in Eclipse setzen
   Window -> Preferences -> Java -> Buildpath -> Classpath Variables -> New


Server starten und stoppen: Skripte im bin-Verzeichnis
   run.bat
   shutdown.bat -S


----------

