不是在JBoss AS7.1上部署的无状态会话bean中引用提供的java库

时间:2016-06-16 02:44:18

标签: java eclipse jboss jboss7.x ejb-3.0

我在eclipse(Mars 2)的JBoss AS7.1服务器上创建并部署了无状态会话bean“HelloWorldBean”。

当我通过日食盯着JBoss AS7.1时,它会在很多方面给出java.lang.UnsupportedClassVersionError

08:01:31,296 INFO  [org.jboss.as.remoting] (MSC service thread 1-5) JBAS017100: Listening on localhost/127.0.0.1:9999
08:01:31,308 INFO  [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 1) JBAS015003: Found HelloWorldSessionBean.jar in deployment directory. To trigger deployment create a file called HelloWorldSessionBean.jar.dodeploy
08:01:31,484 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-3) JBAS015876: Starting deployment of "HelloWorldSessionBean.jar"
08:01:31,620 WARN  [org.jboss.modules] (MSC service thread 1-4) Failed to define class com.ibytecode.businesslogic.HelloWorldBean in Module "deployment.HelloWorldSessionBean.jar:main" from Service Module Loader: java.lang.UnsupportedClassVersionError: com/ibytecode/businesslogic/HelloWorldBean : Unsupported major.minor version 52.0
    at java.lang.ClassLoader.defineClass1(Native Method) [rt.jar:1.7.0_79]
    at java.lang.ClassLoader.defineClass(ClassLoader.java:800) [rt.jar:1.7.0_79]
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142) [rt.jar:1.7.0_79]
    at org.jboss.modules.ModuleClassLoader.doDefineOrLoadClass(ModuleClassLoader.java:327)
    at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:391)
    at org.jboss.modules.ModuleClassLoader.loadClassLocal(ModuleClassLoader.java:243)
    at org.jboss.modules.ModuleClassLoader$1.loadClassLocal(ModuleClassLoader.java:73)
    at org.jboss.modules.Module.loadModuleClass(Module.java:517)

当我检查堆栈跟踪时,我注意到1.7中提到了一些java库(如rt.jar)。 是的,首先它被设定为1.7。然后我改为1.8。 但是为什么它不是从那里引用的?

enter image description here

1 个答案:

答案 0 :(得分:0)

在服务器创建步骤(New> Server)中更改JBoss7.1运行时详细信息后,我自己解决了这个问题。 以前是这样的 enter image description here

现在我创建了一个新的Runtime。 enter image description here

当我再次部署它并启动该服务器时,此错误消失了。现在它显示为

Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=256m; support was removed in 8.0
08:26:21,180 INFO  [org.jboss.modules] JBoss Modules version 1.1.1.GA
08:26:21,622 INFO  [org.jboss.msc] JBoss MSC version 1.0.2.GA
08:26:21,701 INFO  [org.jboss.as] JBAS015899: JBoss AS 7.1.1.Final "Brontes" starting
08:26:22,978 INFO  [org.xnio] XNIO Version 3.0.3.GA
08:26:22,980 INFO  [org.jboss.as.server] JBAS015888: Creating http management service using socket-binding (management-http)
08:26:23,004 INFO  [org.xnio.nio] XNIO NIO Implementation Version 3.0.3.GA
08:26:23,025 INFO  [org.jboss.remoting] JBoss Remoting version 3.2.3.GA
08:26:23,073 INFO  [org.jboss.as.logging] JBAS011502: Removing bootstrap log handlers
08:26:23,084 INFO  [org.jboss.as.configadmin] (ServerService Thread Pool -- 26) JBAS016200: Activating ConfigAdmin Subsystem
08:26:23,147 INFO  [org.jboss.as.clustering.infinispan] (ServerService Thread Pool -- 31) JBAS010280: Activating Infinispan subsystem.
08:26:23,210 INFO  [org.jboss.as.connector] (MSC service thread 1-7) JBAS010408: Starting JCA Subsystem (JBoss IronJacamar 1.0.9.Final)
08:26:23,216 INFO  [org.jboss.as.osgi] (ServerService Thread Pool -- 39) JBAS011940: Activating OSGi Subsystem
08:26:23,233 INFO  [org.jboss.as.naming] (ServerService Thread Pool -- 38) JBAS011800: Activating Naming Subsystem
08:26:23,325 INFO  [org.jboss.as.connector.subsystems.datasources] (ServerService Thread Pool -- 27) JBAS010403: Deploying JDBC-compliant driver class org.h2.Driver (version 1.3)
08:26:23,328 INFO  [org.jboss.as.security] (ServerService Thread Pool -- 44) JBAS013101: Activating Security Subsystem
08:26:23,382 INFO  [org.jboss.as.security] (MSC service thread 1-4) JBAS013100: Current PicketBox version=4.0.7.Final
08:26:23,393 INFO  [org.jboss.as.webservices] (ServerService Thread Pool -- 48) JBAS015537: Activating WebServices Extension
08:26:23,437 INFO  [org.jboss.as.naming] (MSC service thread 1-3) JBAS011802: Starting Naming Service
08:26:23,468 INFO  [org.jboss.as.mail.extension] (MSC service thread 1-8) JBAS015400: Bound mail session [java:jboss/mail/Default]
08:26:23,809 INFO  [org.jboss.ws.common.management.AbstractServerConfig] (MSC service thread 1-7) JBoss Web Services - Stack CXF Server 4.0.2.GA
08:26:23,971 INFO  [org.apache.coyote.http11.Http11Protocol] (MSC service thread 1-8) Starting Coyote HTTP/1.1 on http-localhost-127.0.0.1-8080
08:26:25,024 INFO  [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-4) JBAS010400: Bound data source [java:jboss/datasources/ExampleDS]