我正在尝试从我的ejb bean类访问OSGI包。我在Jboss AS 7.1中配置了目标bundle和ejb模块,当我启动服务器时出现以下异常:
11:40:00,050 INFO [org.jboss.as] (MSC service thread 1-10) JBAS015951: Admin console listening on http://127.0.0.1:9990
11:40:00,051 INFO [org.jboss.as] (MSC service thread 1-10) JBAS015874: JBoss AS 7.1.1.Final "Brontes" started in 1787ms - Started 192 of 271 services (76 services are passive or on-demand)
11:40:00,051 ERROR [org.jboss.as.osgi] (MSC service thread 1-12) JBAS011900: Cannot start bundle: com.javaworld.sample.HelloService:1.0.0.201401231139: org.osgi.framework.BundleException: Unsupported execution environment [JavaSE-1.7] we have [OSGi/Minimum-1.1, J2SE-1.1, OSGi/Minimum-1.2, J2SE-1.2, J2SE-1.3, J2SE-1.4, J2SE-1.5, JavaSE-1.6]
at org.jboss.osgi.framework.internal.HostBundleState.assertStartConditions(HostBundleState.java:247) [jbosgi-framework-core-1.1.8.Final.jar:1.1.8.Final]
at org.jboss.osgi.framework.internal.HostBundleState.startInternal(HostBundleState.java:181) [jbosgi-framework-core-1.1.8.Final.jar:1.1.8.Final]
at org.jboss.osgi.framework.internal.AbstractBundleState.start(AbstractBundleState.java:494) [jbosgi-framework-core-1.1.8.Final.jar:1.1.8.Final]
at org.jboss.as.osgi.deployment.BundleStartTracker$1.processService(BundleStartTracker.java:144) [jboss-as-osgi-service-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.as.osgi.deployment.BundleStartTracker$1.transition(BundleStartTracker.java:119) [jboss-as-osgi-service-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.msc.service.ServiceControllerImpl.invokeListener(ServiceControllerImpl.java:1416) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
at org.jboss.msc.service.ServiceControllerImpl.access$2700(ServiceControllerImpl.java:49) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
at org.jboss.msc.service.ServiceControllerImpl$ListenerTask.run(ServiceControllerImpl.java:1954) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [rt.jar:1.7.0_40]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [rt.jar:1.7.0_40]
at java.lang.Thread.run(Unknown Source) [rt.jar:1.7.0_40]
11:40:00,089 INFO [org.jboss.as.server] (DeploymentScanner-threads - 2) JBAS018559: Deployed "HelloWorldSessionBean.jar"
11:40:00,089 INFO [org.jboss.as.server] (DeploymentScanner-threads - 2) JBAS018559: Deployed "com.javaworld.sample.HelloService.jar"
任何帮助将不胜感激!
答案 0 :(得分:0)
Unsupported execution environment [JavaSE-1.7] we have [OSGi/Minimum-1.1, J2SE-1.1, OSGi/Minimum-1.2, J2SE-1.2, J2SE-1.3, J2SE-1.4, J2SE-1.5, JavaSE-1.6]
我相信当你在jboss中实际拥有1.6最大值时,你已经用1.7 java构建了你的类。
你的jboss运行在1.6 java上,而构建是在1.7吗?