1

我正在尝试将基本的 web 服务模板部署到 tomee,我已经尝试使用 java 版本 1.8.0_25(64bit)、1.8.0_91(64bit) 的 windows 7 64 位和 windows 8 64 位(这个 java 版本用于构建代码和运行 tomee )。网络服务是取自互联网的基本示例 - 源代码在下面以及堆栈跟踪。从 Internet 下载的 Tomee 1.7.0 和 1.7.1 海峡没有代码更改或 jar 更改。什么可能导致这个问题 - 我需要更换默认的 tomee jar(s) 吗?

代码:

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
4

1 回答 1

0

我认为其中一个类文件可能已损坏并尝试加载它并抛出此错误,但是这些库根本没有帮助,因为它们没有记录它试图加载的类并找到相同的源代码 tomee 正在使用(所以我可以添加日志记录)很困难,因为 maven 和在线中的源代码似乎具有不同的包名称,它们与实际的构建二进制文件(奇怪)。唯一的解决方案似乎是通过删除一些(或一次一个类)来反复试验

于 2016-07-04T20:03:51.707 回答