我正在尝试将基本的Web服务模板部署到tomee,我尝试了Windows 7 64位和Windows 8 64位以及Java版本1.8.0_25(64bit),1.8.0_91(64bit)(此Java版本用于构建代码和运行tomee )。 Web服务是取自Internet的基本示例-源代码在下面以及堆栈跟踪中。从互联网上下载的Tomee 1.7.0和1.7.1海峡,无需更改代码或更改jar。可能导致此问题的原因-我需要替换默认的tomee jar吗?
码:
package org.superbiz.calculator.ws;
import javax.ejb.Stateless;
import javax.jws.WebService;
@Stateless
@WebService ( portName = "CalculatorPort" ,
serviceName = "CalculatorService" ,
targetNamespace = "http://superbiz.org/wsdl" ,
endpointInterface = "org.superbiz.calculator.ws.CalculatorWs" )
public class Calculator implements CalculatorWs
{
public int sum( int add1 , int add2 )
{
return add1 + add2;
}
public int multiply( int mul1 , int mul2 )
{
return mul1 * mul2;
}
public String hello()
{
return "hello";
}
}
/* ################################## */
package org.superbiz.calculator.ws;
import javax.jws.WebService;
@WebService ( targetNamespace = "http://superbiz.org/wsdl" )
public interface CalculatorWs
{
public int sum( int add1 , int add2 );
public int multiply( int mul1 , int mul2 );
public String hello();
}
堆栈跟踪:
INFO - ------------------------- localhost -> /host-manager
INFO - Configuring enterprise application: C:\apache-tomee-plus-7.0.0\webapps\host-manager
INFO - Enterprise application "C:\apache-tomee-plus-7.0.0\webapps\host-manager" loaded.
INFO - Assembling app: C:\apache-tomee-plus-7.0.0\webapps\host-manager
INFO - using context file C:\apache-tomee-plus-7.0.0\webapps\host-manager\META-INF\context.xml
INFO - Deployed Application(path=C:\apache-tomee-plus-7.0.0\webapps\host-manager)
INFO - At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TL
Ds were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
INFO - Deployment of web application directory C:\apache-tomee-plus-7.0.0\webapps\host-manager has finished in 391 ms
INFO - Deploying web application directory C:\apache-tomee-plus-7.0.0\webapps\manager
INFO - ------------------------- localhost -> /manager
INFO - Configuring enterprise application: C:\apache-tomee-plus-7.0.0\webapps\manager
INFO - Enterprise application "C:\apache-tomee-plus-7.0.0\webapps\manager" loaded.
INFO - Assembling app: C:\apache-tomee-plus-7.0.0\webapps\manager
INFO - using context file C:\apache-tomee-plus-7.0.0\webapps\manager\META-INF\context.xml
INFO - Deployed Application(path=C:\apache-tomee-plus-7.0.0\webapps\manager)
INFO - At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TL
Ds were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
INFO - Deployment of web application directory C:\apache-tomee-plus-7.0.0\webapps\manager has finished in 69 ms
INFO - Deploying web application directory C:\apache-tomee-plus-7.0.0\webapps\ROOT
INFO - ------------------------- localhost -> /
INFO - Configuring enterprise application: C:\apache-tomee-plus-7.0.0\webapps\ROOT
INFO - Enterprise application "C:\apache-tomee-plus-7.0.0\webapps\ROOT" loaded.
INFO - Assembling app: C:\apache-tomee-plus-7.0.0\webapps\ROOT
INFO - Deployed Application(path=C:\apache-tomee-plus-7.0.0\webapps\ROOT)
INFO - At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TL
Ds were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
INFO - Deployment of web application directory C:\apache-tomee-plus-7.0.0\webapps\ROOT has finished in 60 ms
INFO - Deploying web application directory C:\apache-tomee-plus-7.0.0\webapps\simple-webservice
INFO - ------------------------- localhost -> /simple-webservice
SEVERE - ContainerBase.addChild: start:
org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/simple-webservice]]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:158)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:726)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:702)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:734)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1107)
at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1841)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: org.apache.tomee.catalina.TomEERuntimeException: org.apache.openejb.OpenEJBException: Unable to create annotation scanner for web module simple-webse
rvice: 43626
at org.apache.tomee.catalina.TomcatWebAppBuilder.loadApplication(TomcatWebAppBuilder.java:2256)
at org.apache.tomee.catalina.TomcatWebAppBuilder.startInternal(TomcatWebAppBuilder.java:1151)
at org.apache.tomee.catalina.TomcatWebAppBuilder.configureStart(TomcatWebAppBuilder.java:1112)
at org.apache.tomee.catalina.GlobalListenerSupport.lifecycleEvent(GlobalListenerSupport.java:133)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:94)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5093)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:152)
... 10 more
Caused by: org.apache.openejb.OpenEJBException: Unable to create annotation scanner for web module simple-webservice: 43626
at org.apache.openejb.config.DeploymentLoader.addWebModule(DeploymentLoader.java:883)
at org.apache.openejb.config.DeploymentLoader.load(DeploymentLoader.java:231)
at org.apache.tomee.catalina.TomcatWebAppBuilder.loadApplication(TomcatWebAppBuilder.java:2254)
... 16 more
Caused by: java.lang.ArrayIndexOutOfBoundsException: 43626
at org.apache.xbean.asm5.ClassReader.readClass(Unknown Source)
at org.apache.xbean.asm5.ClassReader.accept(Unknown Source)
at org.apache.xbean.asm5.ClassReader.accept(Unknown Source)
at org.apache.xbean.finder.AnnotationFinder.readClassDef(AnnotationFinder.java:1170)
at org.apache.xbean.finder.AnnotationFinder.<init>(AnnotationFinder.java:147)
at org.apache.xbean.finder.AnnotationFinder.<init>(AnnotationFinder.java:160)
at org.apache.openejb.config.FinderFactory$OpenEJBAnnotationFinder.<init>(FinderFactory.java:546)
at org.apache.openejb.config.FinderFactory.newFinder(FinderFactory.java:267)
at org.apache.openejb.config.FinderFactory.create(FinderFactory.java:80)
at org.apache.openejb.config.FinderFactory.createFinder(FinderFactory.java:69)
at org.apache.openejb.config.DeploymentLoader.addWebModule(DeploymentLoader.java:875)
... 18 more
SEVERE - Error deploying web application directory C:\apache-tomee-plus-7.0.0\webapps\simple-webservice
java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].Stan
dardHost[localhost].StandardContext[/simple-webservice]]
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:730)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:702)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:734)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1107)
at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1841)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
INFO - Deployment of web application directory C:\apache-tomee-plus-7.0.0\webapps\simple-webservice has finished in 61 ms
INFO - Starting ProtocolHandler [http-nio-8080]
INFO - Starting ProtocolHandler [ajp-nio-8009]
INFO - Server startup in 621 ms
最佳答案
我认为其中一个类文件可能已损坏并尝试加载它引发此错误,但是这些库根本无法提供帮助,因为它们不记录其尝试加载的类并查找相同的源代码(所以我可能会添加日志记录)非常困难,因为maven和online中的源代码似乎具有与实际构建二进制文件不同的程序包名称(奇怪)。唯一的解决方案似乎是反复尝试,只需删除几个(或一次删除一个类)即可
关于java - tomee Web服务未部署-ASM错误-无法为Web模块simple-webservice创建注释扫描器:43626,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/38173644/