JBoss 4.2 无法从 Eclipse Luna 启动(控制)

JBoss 4.2 can't be started (controlled) from Eclipse Luna

我有这个(要求的)设置: Windows 7 64 位,JBoss 4.2,Eclipse Luna。 JBossAS 工具(3.0.3.Beta1-v20150220-1545-B124,由 RedHat 提供)通过安装新扩展添加。

我可以毫无问题地开始 JBoss 外部 - 在它的 BAT 文件目录中。 但我无法通过 Eclipse 启动它 - 它停留在一些 "in between state" [Starting, Synchronized] 中,所以我无法启动它,停止它,重新启动它,发布,清理甚至与 JRebel 连接,但那就是另一个故事。它最后说它已启动但实际上没有。

令我困惑的是,从外部看它启动正常并且工作正常。同样在其他工作站上,它可以从 Eclipse started/controlled 没有任何问题。

我的问题是我该怎么办?

我完全被这个错误弄糊涂了 "Failed to register driver for: COM.ibm.db2.jdbc.app.DB2Driver; - nested throwable:" 因为它在外部启动时工作正常,所以我猜配置没问题

None 的类似问题帮助了我: Cannot start JBoss from Eclipse

我也检查过这个,但我没有与其中一个回复中显示的相同设置: Starting JBoss from Eclipse

也检查了这个: Tomcat can be started using startup.bat but not from eclipse

还有这个: JBoss fails to start from Eclipse

在我的例子中,eclipse 的控制台输出是:

16:25:24,597 INFO  [Server] Starting JBoss (MX MicroKernel)...
16:25:24,597 INFO  [Server] Release ID: JBoss [Trinity] 4.2.2.GA (build: SVNTag=JBoss_4_2_2_GA date=200710221139)
16:25:24,598 INFO  [Server] Home Dir: C:\bin\jboss
16:25:24,598 INFO  [Server] Home URL: file:/C:/bin/jboss/
16:25:24,598 INFO  [Server] Patch URL: null
16:25:24,598 INFO  [Server] Server Name: psg
16:25:24,598 INFO  [Server] Server Home Dir: C:\bin\jboss\server\psg
16:25:24,598 INFO  [Server] Server Home URL: file:/C:/bin/jboss/server/psg/
16:25:24,599 INFO  [Server] Server Log Dir: C:\bin\jboss\server\psg\log
16:25:24,599 INFO  [Server] Server Temp Dir: C:\bin\jboss\server\psg\tmp
16:25:24,599 INFO  [Server] Root Deployment Filename: jboss-service.xml
16:25:24,777 INFO  [ServerInfo] Java version: 1.6.0_29,Sun Microsystems Inc.
16:25:24,777 INFO  [ServerInfo] Java VM: Java HotSpot(TM) Server VM 20.4-b02,Sun Microsystems Inc.
16:25:24,777 INFO  [ServerInfo] OS-System: Windows 7 6.1,x86
16:25:25,033 INFO  [Server] Core system initialized
16:25:26,387 INFO  [WebService] Using RMI server codebase: http://localhost:8086/
16:25:26,389 INFO  [Log4jService$URLWatchTimerTask] Configuring from URL: resource:jboss-log4j.xml
log4j:WARN Continuable parsing error 302 and column 11
log4j:WARN The content of element type "root" must match "(param*,(priority|level)?,appender-ref*)".
16:25:26,595 INFO  [TransactionManagerService] JBossTS Transaction Service (JTA version) - JBoss Inc.
16:25:26,595 INFO  [TransactionManagerService] Setting up property manager MBean and JMX layer
16:25:26,679 INFO  [TransactionManagerService] Starting recovery manager
16:25:26,749 INFO  [TransactionManagerService] Recovery manager started
16:25:26,749 INFO  [TransactionManagerService] Binding TransactionManager JNDI Reference
16:25:27,942 INFO  [EJB3Deployer] Starting java:comp multiplexer
16:25:28,198 INFO  [STDOUT] no object for null
16:25:28,199 INFO  [STDOUT] no object for null
16:25:28,207 INFO  [STDOUT] no object for null
16:25:28,215 INFO  [STDOUT] no object for {urn:jboss:bean-deployer}supplyType
16:25:28,218 INFO  [STDOUT] no object for {urn:jboss:bean-deployer}dependsType
16:25:29,056 INFO  [NativeServerConfig] JBoss Web Services - Native
16:25:29,056 INFO  [NativeServerConfig] jbossws-native-2.0.1.SP2 (build=200710210837)
16:25:29,364 INFO  [SnmpAgentService] SNMP agent going active
16:25:29,429 INFO  [TreeCache] No transaction manager lookup class has been defined. Transactions cannot be used

16:25:30,670 WARN  [JBossManagedConnectionPool] Throwable while attempting to get a new connection: null
org.jboss.resource.JBossResourceException: Could not create connection; - nested throwable: (org.jboss.resource.JBossResourceException: Failed to register driver for: COM.ibm.db2.jdbc.app.DB2Driver; - nested throwable: (java.lang.ClassNotFoundException: No ClassLoaders found for: COM.ibm.db2.jdbc.app.DB2Driver))
    at org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory.createManagedConnection(LocalManagedConnectionFactory.java:179)
    at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.createConnectionEventListener(InternalManagedConnectionPool.java:577)
    at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.getConnection(InternalManagedConnectionPool.java:262)
    at org.jboss.resource.connectionmanager.JBossManagedConnectionPool$BasePool.getConnection(JBossManagedConnectionPool.java:500)
    at org.jboss.resource.connectionmanager.BaseConnectionManager2.getManagedConnection(BaseConnectionManager2.java:341)
    at org.jboss.resource.connectionmanager.TxConnectionManager.getManagedConnection(TxConnectionManager.java:315)
    at org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:396)
    at org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.allocateConnection(BaseConnectionManager2.java:842)
....... ommited ....
    at org.jboss.system.server.ServerImpl.start(ServerImpl.java:362)
    at org.jboss.Main.boot(Main.java:200)
    at org.jboss.Main.run(Main.java:508)
    at java.lang.Thread.run(Thread.java:662)
Caused by: org.jboss.resource.JBossResourceException: Failed to register driver for: COM.ibm.db2.jdbc.app.DB2Driver; - nested throwable: (java.lang.ClassNotFoundException: No ClassLoaders found for: COM.ibm.db2.jdbc.app.DB2Driver)
    at org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory.getDriver(LocalManagedConnectionFactory.java:287)
    at org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory.createManagedConnection(LocalManagedConnectionFactory.java:170)
    ... 124 more
Caused by: java.lang.ClassNotFoundException: No ClassLoaders found for: COM.ibm.db2.jdbc.app.DB2Driver
    at org.jboss.mx.loading.LoadMgr3.beginLoadTask(LoadMgr3.java:212)
    at org.jboss.mx.loading.RepositoryClassLoader.loadClassImpl(RepositoryClassLoader.java:521)
    at org.jboss.mx.loading.RepositoryClassLoader.loadClass(RepositoryClassLoader.java:415)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:247)
    at org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory.getDriver(LocalManagedConnectionFactory.java:272)
    ... 125 more
16:25:30,672 WARN  [ServiceController] Problem starting service jboss.cache:service=TomcatClusteringCache
org.jboss.util.NestedSQLException: Could not create connection; - nested throwable: (org.jboss.resource.JBossResourceException: Failed to register driver for: COM.ibm.db2.jdbc.app.DB2Driver; - nested throwable: (java.lang.ClassNotFoundException: No ClassLoaders found for: COM.ibm.db2.jdbc.app.DB2Driver)); - nested throwable: (org.jboss.resource.JBossResourceException: Could not create connection; - nested throwable: (org.jboss.resource.JBossResourceException: Failed to register driver for: COM.ibm.db2.jdbc.app.DB2Driver; - nested throwable: (java.lang.ClassNotFoundException: No ClassLoaders found for: COM.ibm.db2.jdbc.app.DB2Driver)))
    at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:94)
    at org.jboss.cache.loader.JDBCCacheLoader$ManagedConnectionFactory.getConnection(JDBCCacheLoader.java:1601)
    at org.jboss.cache.loader.JDBCCacheLoader.start(JDBCCacheLoader.java:753)
    at org.jboss.cache.loader.AsyncCacheLoader.start(AsyncCacheLoader.java:305)
    at org.jboss.cache.loader.CacheLoaderManager.startCacheLoader(CacheLoaderManager.java:353)
    at org.jboss.cache.TreeCache.startService(TreeCache.java:1535)
....... ommited ....
    at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
    at $Proxy5.deploy(Unknown Source)
    at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:482)
    at org.jboss.system.server.ServerImpl.start(ServerImpl.java:362)
    at org.jboss.Main.boot(Main.java:200)
    at org.jboss.Main.run(Main.java:508)
    at java.lang.Thread.run(Thread.java:662)
Caused by: org.jboss.resource.JBossResourceException: Could not create connection; - nested throwable: (org.jboss.resource.JBossResourceException: Failed to register driver for: COM.ibm.db2.jdbc.app.DB2Driver; - nested throwable: (java.lang.ClassNotFoundException: No ClassLoaders found for: COM.ibm.db2.jdbc.app.DB2Driver))
    at org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory.createManagedConnection(LocalManagedConnectionFactory.java:179)
    at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.createConnectionEventListener(InternalManagedConnectionPool.java:577)
    at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.getConnection(InternalManagedConnectionPool.java:262)
    at org.jboss.resource.connectionmanager.JBossManagedConnectionPool$BasePool.getConnection(JBossManagedConnectionPool.java:500)
    at org.jboss.resource.connectionmanager.BaseConnectionManager2.getManagedConnection(BaseConnectionManager2.java:341)
    at org.jboss.resource.connectionmanager.TxConnectionManager.getManagedConnection(TxConnectionManager.java:315)
    at org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:396)
    at org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.allocateConnection(BaseConnectionManager2.java:842)
    at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:88)
    ... 116 more
Caused by: org.jboss.resource.JBossResourceException: Failed to register driver for: COM.ibm.db2.jdbc.app.DB2Driver; - nested throwable: (java.lang.ClassNotFoundException: No ClassLoaders found for: COM.ibm.db2.jdbc.app.DB2Driver)
    at org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory.getDriver(LocalManagedConnectionFactory.java:287)
    at org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory.createManagedConnection(LocalManagedConnectionFactory.java:170)
    ... 124 more
Caused by: java.lang.ClassNotFoundException: No ClassLoaders found for: COM.ibm.db2.jdbc.app.DB2Driver
    at org.jboss.mx.loading.LoadMgr3.beginLoadTask(LoadMgr3.java:212)
    at org.jboss.mx.loading.RepositoryClassLoader.loadClassImpl(RepositoryClassLoader.java:521)
    at org.jboss.mx.loading.RepositoryClassLoader.loadClass(RepositoryClassLoader.java:415)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:247)
    at org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory.getDriver(LocalManagedConnectionFactory.java:272)
    ... 125 more
16:25:31,039 INFO  [ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=DataSourceBinding,name=DefaultDS' to JNDI name 'java:DefaultDS'
16:25:31,130 INFO  [A] Bound to JNDI name: queue/A
16:25:31,131 INFO  [B] Bound to JNDI name: queue/B
16:25:31,132 INFO  [C] Bound to JNDI name: queue/C
16:25:31,132 INFO  [D] Bound to JNDI name: queue/D
16:25:31,133 INFO  [ex] Bound to JNDI name: queue/ex
16:25:31,143 INFO  [testTopic] Bound to JNDI name: topic/testTopic
16:25:31,143 INFO  [securedTopic] Bound to JNDI name: topic/securedTopic
16:25:31,144 INFO  [testDurableTopic] Bound to JNDI name: topic/testDurableTopic
16:25:31,146 INFO  [testQueue] Bound to JNDI name: queue/testQueue
16:25:31,155 INFO  [UILServerILService] JBossMQ UIL service available at : localhost/127.0.0.1:8093
16:25:31,172 INFO  [DLQ] Bound to JNDI name: queue/DLQ
16:25:31,208 INFO  [ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=ConnectionFactoryBinding,name=JmsXA' to JNDI name 'java:JmsXA'
16:25:31,213 ERROR [URLDeploymentScanner] Incomplete Deployment listing:

--- Packages waiting for a deployer ---
org.jboss.deployment.DeploymentInfo@8aafac5d { url=file:/C:/bin/jboss/server/psg/deploy/jboss-web.deployer/ROOT.war/ }
  deployer: null
  status: Starting
  state: INIT_WAITING_DEPLOYER
  watch: file:/C:/bin/jboss/server/psg/deploy/jboss-web.deployer/ROOT.war/
  altDD: null
  lastDeployed: 1426605929863
  lastModified: 1426584051328
  mbeans:

org.jboss.deployment.DeploymentInfo@5cf4ae87 { url=file:/C:/bin/jboss/server/psg/deploy/httpha-invoker.sar/invoker.war/ }
  deployer: null
  status: Starting
  state: INIT_WAITING_DEPLOYER
  watch: file:/C:/bin/jboss/server/psg/deploy/httpha-invoker.sar/invoker.war/
  altDD: null
  lastDeployed: 1426605929863
  lastModified: 1426584051202
  mbeans:

org.jboss.deployment.DeploymentInfo@e8e6151b { url=file:/C:/bin/jboss/server/psg/deploy/jbossws.sar/jbossws-context.war/ }
  deployer: null
  status: Starting
  state: INIT_WAITING_DEPLOYER
  watch: file:/C:/bin/jboss/server/psg/deploy/jbossws.sar/jbossws-context.war/
  altDD: null
  lastDeployed: 1426605929863
  lastModified: 1426584051349
  mbeans:

org.jboss.deployment.DeploymentInfo@8aea0a50 { url=file:/C:/bin/jboss/server/psg/deploy/jms/jbossmq-httpil.sar/jbossmq-httpil.war/ }
  deployer: null
  status: Starting
  state: INIT_WAITING_DEPLOYER
  watch: file:/C:/bin/jboss/server/psg/deploy/jms/jbossmq-httpil.sar/jbossmq-httpil.war/
  altDD: null
  lastDeployed: 1426605929863
  lastModified: 1426584051387
  mbeans:

org.jboss.deployment.DeploymentInfo@435b5b3f { url=file:/C:/bin/jboss/server/psg/deploy/juddi-service.sar/juddi.war/ }
  deployer: null
  status: Starting
  state: INIT_WAITING_DEPLOYER
  watch: file:/C:/bin/jboss/server/psg/deploy/juddi-service.sar/juddi.war/
  altDD: null
  lastDeployed: 1426605929863
  lastModified: 1426584051448
  mbeans:

org.jboss.deployment.DeploymentInfo@68b7867b { url=file:/C:/bin/jboss/server/psg/deploy/management/console-mgr.sar/web-console.war/ }
  deployer: null
  status: Starting
  state: INIT_WAITING_DEPLOYER
  watch: file:/C:/bin/jboss/server/psg/deploy/management/console-mgr.sar/web-console.war/
  altDD: null
  lastDeployed: 1426605929863
  lastModified: 1426584051642
  mbeans:

org.jboss.deployment.DeploymentInfo@f99a4b2b { url=file:/C:/bin/jboss/server/psg/deploy/jmx-console.war/ }
  deployer: null
  status: null
  state: INIT_WAITING_DEPLOYER
  watch: file:/C:/bin/jboss/server/psg/deploy/jmx-console.war/
  altDD: null
  lastDeployed: 1426605931210
  lastModified: 1426584051413
  mbeans:

org.jboss.deployment.DeploymentInfo@fa9f8de6 { url=file:/C:/bin/jboss/server/psg/deploy/mc_dev1_4170.war/ }
  deployer: null
  status: null
  state: INIT_WAITING_DEPLOYER
  watch: file:/C:/bin/jboss/server/psg/deploy/mc_dev1_4170.war/
  altDD: null
  lastDeployed: 1426605931211
  lastModified: 1426588326490
  mbeans:

--- Incompletely deployed packages ---
org.jboss.deployment.DeploymentInfo@f99a4b2b { url=file:/C:/bin/jboss/server/psg/deploy/jmx-console.war/ }
  deployer: null
  status: null
  state: INIT_WAITING_DEPLOYER
  watch: file:/C:/bin/jboss/server/psg/deploy/jmx-console.war/
  altDD: null
  lastDeployed: 1426605931210
  lastModified: 1426584051413
  mbeans:

org.jboss.deployment.DeploymentInfo@fa9f8de6 { url=file:/C:/bin/jboss/server/psg/deploy/mc_dev1_4170.war/ }
  deployer: null
  status: null
  state: INIT_WAITING_DEPLOYER
  watch: file:/C:/bin/jboss/server/psg/deploy/mc_dev1_4170.war/
  altDD: null
  lastDeployed: 1426605931211
  lastModified: 1426588326490
  mbeans:

--- MBeans waiting for other MBeans ---
ObjectName: jboss.cache:service=TomcatClusteringCache
  State: FAILED
  Reason: org.jboss.util.NestedSQLException: Could not create connection; - nested throwable: (org.jboss.resource.JBossResourceException: Failed to register driver for: COM.ibm.db2.jdbc.app.DB2Driver; - nested throwable: (java.lang.ClassNotFoundException: No ClassLoaders found for: COM.ibm.db2.jdbc.app.DB2Driver)); - nested throwable: (org.jboss.resource.JBossResourceException: Could not create connection; - nested throwable: (org.jboss.resource.JBossResourceException: Failed to register driver for: COM.ibm.db2.jdbc.app.DB2Driver; - nested throwable: (java.lang.ClassNotFoundException: No ClassLoaders found for: COM.ibm.db2.jdbc.app.DB2Driver)))
  I Depend On:
    jboss:service=Naming
    jboss:service=TransactionManager
    jboss.aop:service=AspectDeployer
    jboss.jca:service=DataSourceBinding,name=DB2DS
  Depends On Me:
    jboss.web:service=WebServer

--- MBEANS THAT ARE THE ROOT CAUSE OF THE PROBLEM ---
ObjectName: jboss.cache:service=TomcatClusteringCache
  State: FAILED
  Reason: org.jboss.util.NestedSQLException: Could not create connection; - nested throwable: (org.jboss.resource.JBossResourceException: Failed to register driver for: COM.ibm.db2.jdbc.app.DB2Driver; - nested throwable: (java.lang.ClassNotFoundException: No ClassLoaders found for: COM.ibm.db2.jdbc.app.DB2Driver)); - nested throwable: (org.jboss.resource.JBossResourceException: Could not create connection; - nested throwable: (org.jboss.resource.JBossResourceException: Failed to register driver for: COM.ibm.db2.jdbc.app.DB2Driver; - nested throwable: (java.lang.ClassNotFoundException: No ClassLoaders found for: COM.ibm.db2.jdbc.app.DB2Driver)))
  I Depend On:
    jboss:service=Naming
    jboss:service=TransactionManager
    jboss.aop:service=AspectDeployer
    jboss.jca:service=DataSourceBinding,name=DB2DS
  Depends On Me:
    jboss.web:service=WebServer


16:25:31,237 INFO  [Server] JBoss (MX MicroKernel) [4.2.2.GA (build: SVNTag=JBoss_4_2_2_GA date=200710221139)] Started in 6s:637ms

这就是我最终解决这个问题的方法。 Eclipse Luna,JBoss,4.20GA,Windows 7 Pro 64。

  1. 我下载并安装了 ibm_data_server_client_win64_V97。这创建了目录 C:\Program Files\IBM\SQLLIB\java,其中包含几个文件,其中这些文件是工作所必需的:db2java.zip(不确定这个),db2jcc.jar(这是必须的),db2jcc_license_cu.jar(有人说这不是必需的,有人说这是必须)。我可以(可能)从 IBM 的部分 "DB2 JDBC Driver Versions and Downloads" 直接下载这些库,但出于其他原因我需要这个客户端,而且库似乎都是一样的。
  2. 然后在 Eclipse 中,我将这些 jar 和 zip 添加到我的项目中:项目 -> 属性 -> Java 构建路径 -> 库选项卡 -> 添加外部 jar:然后我导航到 "C:\Program Files\IBM\SQLLIB\java\"并选择了所有这些。
  3. 之后,我清理并重建了项目,从 Eclipse 启动 JBoss 就这样。它甚至(在某种程度上)提供了热部署的可能性。