NoClassDefFoundError Singletonholder

时间:2015-09-05 14:08:56

标签: java singleton noclassdeffounderror vaadin7

大家好!我最近部署了一个Web项目,我在尝试获取单例类的实例时得到NoClassDefFoundError。

  

com.vaadin.server.ServerRpcManager $ RpcInvocationException:无法调用方法单击   com.vaadin.shared.ui.button.ButtonServerRpc at   com.vaadin.server.ServerRpcManager.applyInvocation(ServerRpcManager.java:170)     在   com.vaadin.server.ServerRpcManager.applyInvocation(ServerRpcManager.java:118)     在   com.vaadin.server.communication.ServerRpcHandler.handleInvocations(ServerRpcHandler.java:287)     在   com.vaadin.server.communication.ServerRpcHandler.handleRpc(ServerRpcHandler.java:180)     在   com.vaadin.server.communication.PushHandler $ 3.run(PushHandler.java:174)     在   com.vaadin.server.communication.PushHandler.callWithUi(PushHandler.java:253)     在   com.vaadin.server.communication.PushHandler.access $ 200(PushHandler.java:56)     在   com.vaadin.server.communication.PushHandler $ 1.onRequest(PushHandler.java:76)     在   org.atmosphere.cpr.AsynchronousProcessor.action(AsynchronousProcessor.java:174)     在   org.atmosphere.cpr.AsynchronousProcessor.suspended(AsynchronousProcessor.java:95)     在   org.atmosphere.container.GlassFishServ30WebSocketSupport.service(GlassFishServ30WebSocketSupport.java:60)     在   org.atmosphere.cpr.AtmosphereFramework.doCometSupport(AtmosphereFramework.java:1802)     在   org.atmosphere.websocket.DefaultWebSocketProcessor.dispatch(DefaultWebSocketProcessor.java:432)     在   org.atmosphere.websocket.DefaultWebSocketProcessor $ 2.run(DefaultWebSocketProcessor.java:285)     在   org.atmosphere.util.VoidExecutorService.execute(VoidExecutorService.java:101)     在   org.atmosphere.websocket.DefaultWebSocketProcessor.dispatch(DefaultWebSocketProcessor.java:280)     在   org.atmosphere.websocket.DefaultWebSocketProcessor.invokeWebSocketProtocol(DefaultWebSocketProcessor.java:303)     在   org.atmosphere.container.GlassFishServ30WebSocketSupport $ Grizzly2WebSocketApplication.onMessage(GlassFishServ30WebSocketSupport.java:157)     在   org.glassfish.grizzly.websockets.SimpleWebSocket.onMessage(SimpleWebSocket.java:163)     在   org.glassfish.grizzly.websockets.frametypes.TextFrameType.respond(TextFrameType.java:68)     在   org.glassfish.grizzly.websockets.DataFrame.respond(DataFrame.java:119)     在   org.glassfish.grizzly.websockets.BaseWebSocketFilter.handleRead(BaseWebSocketFilter.java:219)     在   org.glassfish.grizzly.filterchain.ExecutorResolver $ 9.execute(ExecutorResolver.java:119)     在   org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:284)     在   org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:201)     在   org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:133)     在   org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:112)     在   org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)     在   org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:561)     在   org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:112)     在   org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:117)     在   org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access $ 100(WorkerThreadIOStrategy.java:56)     在   org.glassfish.grizzly.strategies.WorkerThreadIOStrategy $ WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:137)     在   org.glassfish.grizzly.threadpool.AbstractThreadPool $ Worker.doWork(AbstractThreadPool.java:565)     在   org.glassfish.grizzly.threadpool.AbstractThreadPool $ Worker.run(AbstractThreadPool.java:545)     在java.lang.Thread.run(Thread.java:745)引起:   java.lang.reflect.InvocationTargetException at   sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)at   sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)     在   sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)     在java.lang.reflect.Method.invoke(Method.java:497)at   com.vaadin.server.ServerRpcManager.applyInvocation(ServerRpcManager.java:168)     ... 35更多引起:   com.vaadin.event.ListenerMethod $ MethodException:方法的调用   按钮单击   no.solarsoft.venus2.admissionweb2.presentation.components.wizard.contentparts.PaymentPanel $ 2   失败。在   com.vaadin.event.ListenerMethod.receiveEvent(ListenerMethod.java:528)     在com.vaadin.event.EventRouter.fireEvent(EventRouter.java:198)at   com.vaadin.event.EventRouter.fireEvent(EventRouter.java:161)at   com.vaadin.server.AbstractClientConnector.fireEvent(AbstractClientConnector.java:979)     在com.vaadin.ui.Button.fireClick(Button.java:393)at   com.vaadin.ui.Button $ 1.click(Button.java:57)... 40更多引起:   java.lang.ExceptionInInitializerError at   no.solarsoft.venus2.payex.wsclient.PxOrderManager.getInstance(PxOrderManager.java:54)     在   no.solarsoft.venus2.admissionweb2.payment.payex.AbstractPayExHelper.initializeOrder(AbstractPayExHelper.java:60)     在   no.solarsoft.venus2.admissionweb2.payment.payex.PayExCreditCardHelper.initializeOrder(PayExCreditCardHelper.java:60)     在   no.solarsoft.venus2.admissionweb2.presentation.view.ApplicationWizardView $ PaymentPanelModelPropertyChangeListener.propertyChange(ApplicationWizardView.java:1599)     在   java.beans.PropertyChangeSupport.fire(PropertyChangeSupport.java:335)     在   java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:327)     在   no.solarsoft.venus2.admissionweb2.presentation.components.wizard.content.model.PaymentPanelModel.createCreditCardPaymentEvent(PaymentPanelModel.java:210)     在   no.solarsoft.venus2.admissionweb2.presentation.components.wizard.contentparts.PaymentPanel $ 2.buttonClick(PaymentPanel.java:272)     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)at   sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)     在   sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)     在java.lang.reflect.Method.invoke(Method.java:497)at   com.vaadin.event.ListenerMethod.receiveEvent(ListenerMethod.java:508)     ... 45更多引起:java.lang.IllegalStateException:MASM0001:   找不到默认配置文件[jaxws-tubes-default.xml]     在   com.sun.xml.ws.assembler.MetroConfigLoader.init(MetroConfigLoader.java:142)     在   com.sun.xml.ws.assembler.MetroConfigLoader。(MetroConfigLoader.java:119)     在   com.sun.xml.ws.assembler.TubelineAssemblyController.getTubeCreators(TubelineAssemblyController.java:93)     在   com.sun.xml.ws.assembler.MetroTubelineAssembler.createClient(MetroTubelineAssembler.java:118)     在com.sun.xml.ws.client.Stub.createPipeline(Stub.java:343)at   com.sun.xml.ws.client.Stub。(Stub.java:310)at   com.sun.xml.ws.client.Stub。(Stub.java:243)at   com.sun.xml.ws.client.Stub。(Stub.java:258)at   com.sun.xml.ws.client.sei.SEIStub。(SEIStub.java:98)at   com.sun.xml.ws.client.WSServiceDelegate.getStubHandler(WSServiceDelegate.java:829)     在   com.sun.xml.ws.client.WSServiceDelegate.createEndpointIFBaseProxy(WSServiceDelegate.java:818)     在   com.sun.xml.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:451)     在   com.sun.xml.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:419)     在   com.sun.xml.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:401)     在javax.xml.ws.Service.getPort(Service.java:134)at   com.payex.external.pxorder.PxOrder.getPxOrderSoap(PxOrder.java:83)at at   no.solarsoft.venus2.payex.wsclient.PxOrderManager.init(PxOrderManager.java:60)     在   no.solarsoft.venus2.payex.wsclient.PxOrderManager。(PxOrderManager.java:46)     在   no.solarsoft.venus2.payex.wsclient.PxOrderManager。(PxOrderManager.java:45)     在   no.solarsoft.venus2.payex.wsclient.PxOrderManager $ PxOrderManagerSingletonHolder。(PxOrderManager.java:50)     ... 58更多]]

[2015-09-05T09:30:09.061+0200] [glassfish 4.1] [SEVERE] [] [] [tid:
_ThreadID=35 _ThreadName=Thread-9] [timeMillis: 1441438209061] [levelValue: 1000] [[  
     

no.solarsoft.venus2.admissionweb2.CustomNavigator $ InitializationException:   找不到名为" stdError"的视图的ViewInitializer。在   no.solarsoft.venus2.admissionweb2.CustomNavigator.initView(CustomNavigator.java:91)     在   no.solarsoft.venus2.admissionweb2.CustomNavigator.navigateTo(CustomNavigator.java:123)     在   no.solarsoft.venus2.admissionweb2.AdmissionWebUI $。错误(AdmissionWebUI.java:211)     在   com.vaadin.server.LegacyCommunicationManager.handleConnectorRelatedException(LegacyCommunicationManager.java:397)     在   com.vaadin.server.communication.ServerRpcHandler.handleInvocations(ServerRpcHandler.java:290)     在   com.vaadin.server.communication.ServerRpcHandler.handleRpc(ServerRpcHandler.java:180)     在   com.vaadin.server.communication.PushHandler $ 3.run(PushHandler.java:174)     在   com.vaadin.server.communication.PushHandler.callWithUi(PushHandler.java:253)     在   com.vaadin.server.communication.PushHandler.access $ 200(PushHandler.java:56)     在   com.vaadin.server.communication.PushHandler $ 1.onRequest(PushHandler.java:76)     在   org.atmosphere.cpr.AsynchronousProcessor.action(AsynchronousProcessor.java:174)     在   org.atmosphere.cpr.AsynchronousProcessor.suspended(AsynchronousProcessor.java:95)     在   org.atmosphere.container.GlassFishServ30WebSocketSupport.service(GlassFishServ30WebSocketSupport.java:60)     在   org.atmosphere.cpr.AtmosphereFramework.doCometSupport(AtmosphereFramework.java:1802)     在   org.atmosphere.websocket.DefaultWebSocketProcessor.dispatch(DefaultWebSocketProcessor.java:432)     在   org.atmosphere.websocket.DefaultWebSocketProcessor $ 2.run(DefaultWebSocketProcessor.java:285)     在   org.atmosphere.util.VoidExecutorService.execute(VoidExecutorService.java:101)     在   org.atmosphere.websocket.DefaultWebSocketProcessor.dispatch(DefaultWebSocketProcessor.java:280)     在   org.atmosphere.websocket.DefaultWebSocketProcessor.invokeWebSocketProtocol(DefaultWebSocketProcessor.java:303)     在   org.atmosphere.container.GlassFishServ30WebSocketSupport $ Grizzly2WebSocketApplication.onMessage(GlassFishServ30WebSocketSupport.java:157)     在   org.glassfish.grizzly.websockets.SimpleWebSocket.onMessage(SimpleWebSocket.java:163)     在   org.glassfish.grizzly.websockets.frametypes.TextFrameType.respond(TextFrameType.java:68)     在   org.glassfish.grizzly.websockets.DataFrame.respond(DataFrame.java:119)     在   org.glassfish.grizzly.websockets.BaseWebSocketFilter.handleRead(BaseWebSocketFilter.java:219)     在   org.glassfish.grizzly.filterchain.ExecutorResolver $ 9.execute(ExecutorResolver.java:119)     在   org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:284)     在   org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:201)     在   org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:133)     在   org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:112)     在   org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)     在   org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:561)     在   org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:112)     在   org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:117)     在   org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access $ 100(WorkerThreadIOStrategy.java:56)     在   org.glassfish.grizzly.strategies.WorkerThreadIOStrategy $ WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:137)     在   org.glassfish.grizzly.threadpool.AbstractThreadPool $ Worker.doWork(AbstractThreadPool.java:565)     在   org.glassfish.grizzly.threadpool.AbstractThreadPool $ Worker.run(AbstractThreadPool.java:545)     在java.lang.Thread.run(Thread.java:745)]]

这是我的PxOrderManager的代码:

package no.solarsoft.venus2.payex.wsclient;

import java.net.MalformedURLException;
import java.net.URL;

import javax.xml.namespace.QName;

import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;

import no.solarsoft.venus2.admissionweb2.AdmissionWebUI;
import no.solarsoft.venus2.admissionweb2.AdmissionWebUI.RuntimeMode;

import com.payex.external.pxorder.PxOrder;
import com.payex.external.pxorder.PxOrderSoap;

public class PxOrderManager {

    private static final QName SERVICE_NAME = new QName("http://external.payex.com/PxOrder/", "PxOrder");
    private static final String TEST_WSDL_LOCATION_STRING = "https://test-external.payex.com/pxorder/pxorder.asmx?WSDL";
    private static final String WSDL_LOCATION_STRING = "https://external.payex.com/pxorder/pxorder.asmx?WSDL";
    private static final URL WSDL_LOCATION;

    private static final Logger log = LogManager.getLogger(PxOrderManager.class);

    // This initializes WSDL location. !!! USE TEST_WSDL_LOCATION_STRING for
    // testing against test web services.
    static {
        URL url = null;
        String urlString = null;
        try {
            urlString = AdmissionWebUI.RUNTIME_MODE.equals(RuntimeMode.PRODUCTION) ? WSDL_LOCATION_STRING
                    : TEST_WSDL_LOCATION_STRING;
            url = new URL(urlString);
        } catch (MalformedURLException e) {
            java.util.logging.Logger.getLogger(PxOrder.class.getName()).log(java.util.logging.Level.INFO,
                    "Can not initialize the default wsdl from {0}", urlString);
        }
        WSDL_LOCATION = url;
    }

    private PxOrder service;
    private PxOrderSoap port;

    private PxOrderManager() {
        init(WSDL_LOCATION);
    }

    private static class PxOrderManagerSingletonHolder {
        public static final PxOrderManager INSTANCE = new PxOrderManager();
    }

    public static PxOrderManager getInstance() {
        return PxOrderManagerSingletonHolder.INSTANCE;
    }

    private void init(URL wsdlUrl) {
        log.info("Initializing web service with wsdl location at: " + wsdlUrl.toString());
        service = new PxOrder(wsdlUrl, SERVICE_NAME);
        port = service.getPxOrderSoap();
    }

    public PxOrderSoap getPort() {
        return this.port;
    }
}

我尝试检查war文件的内容,看起来很正常。班级PxOrderManagerSingletonHolderPxOrderManager存在

enter image description here

我的所有jar文件都在web-inf/lib文件夹中。我正在使用vaadin 7和jdk 1.6.0_45(如果它有帮助)

我希望有人可以帮助我。谢谢!

1 个答案:

答案 0 :(得分:1)

我认为你的问题出在不同的地方(不是NoClassDefFoundError)。在您的堆栈跟踪中是这样的信息:

  

引起:java.lang.IllegalStateException:MASM0001:找不到默认配置文件[jaxws-tubes-default.xml]

解决方案描述为here at SO

编辑:

此外,考虑Java版本升级会很棒。 Vaadin Book说:

  

Vaadin与Java 1.6及更高版本兼容。使用WebSockets进行正确的服务器推送支持需要Java EE 7。