EJB中没有有效的构造函数错误

时间:2014-11-19 09:45:08

标签: java eclipse jsf jpa primefaces

最近我正在更换我的机器,不得不创建新的工作区环境。我正在使用Eclipse Kepler。我的代码在我以前的机器上运行良好,但我不知道出了什么问题,并尝试在我以前的机器上一次又一次地重新创建工作区。但是当运行Web应用程序(Primefaces,JSF,JPA 2.1 EclipseLink 2.5,tomee 7,java 6,mojarra 2.1.6)时,我在EJB中得到“无效的构造函数错误”,这在其他机器上运行良好。我的错误是:

com.sun.faces.renderkit.ClientSideStateHelper doGetState
    SEVERE: com.magnus.sessionejb.util.FiscalYrEJB$$LocalBeanProxy; com.magnus.sessionejb.util.FiscalYrEJB$$LocalBeanProxy; no valid constructor
    java.io.InvalidClassException: com.magnus.sessionejb.util.FiscalYrEJB$$LocalBeanProxy; com.magnus.sessionejb.util.FiscalYrEJB$$LocalBeanProxy; no valid constructor
        at java.io.ObjectStreamClass.checkDeserialize(Unknown Source)
        at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
        at java.io.ObjectInputStream.readObject0(Unknown Source)
        at java.io.ObjectInputStream.defaultReadFields(Unknown Source)
        at java.io.ObjectInputStream.readSerialData(Unknown Source)
        at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
        at java.io.ObjectInputStream.readObject0(Unknown Source)
        at java.io.ObjectInputStream.defaultReadFields(Unknown Source)
        at java.io.ObjectInputStream.readSerialData(Unknown Source)
        at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
        at java.io.ObjectInputStream.readObject0(Unknown Source)
        at java.io.ObjectInputStream.readObject(Unknown Source)
        at java.util.HashMap.readObject(Unknown Source)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at java.io.ObjectStreamClass.invokeReadObject(Unknown Source)
        at java.io.ObjectInputStream.readSerialData(Unknown Source)
        at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
        at java.io.ObjectInputStream.readObject0(Unknown Source)
        at java.io.ObjectInputStream.defaultReadFields(Unknown Source)
        at java.io.ObjectInputStream.readSerialData(Unknown Source)
        at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
        at java.io.ObjectInputStream.readObject0(Unknown Source)
        at java.io.ObjectInputStream.readArray(Unknown Source)
        at java.io.ObjectInputStream.readObject0(Unknown Source)
        at java.io.ObjectInputStream.readObject(Unknown Source)
        at java.util.HashMap.readObject(Unknown Source)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at java.io.ObjectStreamClass.invokeReadObject(Unknown Source)
        at java.io.ObjectInputStream.readSerialData(Unknown Source)
        at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
        at java.io.ObjectInputStream.readObject0(Unknown Source)
        at java.io.ObjectInputStream.readObject(Unknown Source)
        at com.sun.faces.renderkit.ClientSideStateHelper.doGetState(ClientSideStateHelper.java:255)
        at com.sun.faces.renderkit.ClientSideStateHelper.getState(ClientSideStateHelper.java:198)
        at com.sun.faces.renderkit.ResponseStateManagerImpl.getState(ResponseStateManagerImpl.java:100)
        at com.sun.faces.application.view.StateManagementStrategyImpl.restoreView(StateManagementStrategyImpl.java:227)
        at com.sun.faces.application.StateManagerImpl.restoreView(StateManagerImpl.java:188)
        at com.sun.faces.application.view.ViewHandlingStrategy.restoreView(ViewHandlingStrategy.java:123)
        at com.sun.faces.application.view.FaceletViewHandlingStrategy.restoreView(FaceletViewHandlingStrategy.java:453)
        at com.sun.faces.application.view.MultiViewHandler.restoreView(MultiViewHandler.java:148)
        at javax.faces.application.ViewHandlerWrapper.restoreView(ViewHandlerWrapper.java:303)
        at com.sun.faces.lifecycle.RestoreViewPhase.execute(RestoreViewPhase.java:192)
        at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
        at com.sun.faces.lifecycle.RestoreViewPhase.doPhase(RestoreViewPhase.java:116)
        at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
        at javax.faces.webapp.FacesServlet.service(FacesServlet.java:593)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
        at org.primefaces.webapp.filter.FileUploadFilter.doFilter(FileUploadFilter.java:79)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
        at com.magnus.filter.LoginCheckFilter.doFilter(LoginCheckFilter.java:130)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
        at org.apache.tomee.catalina.OpenEJBValve.invoke(OpenEJBValve.java:44)
        at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
        at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
        at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1070)
        at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:611)
        at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:316)
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
        at java.lang.Thread.run(Unknown Source)

我的EJB是:

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import javax.ejb.LocalBean;
import javax.ejb.Stateless;
import com.magnus.model.util.FiscalYrModel;
import com.magnus.sessionejb.core.GenericDAO;

@Stateless
@LocalBean

public class FiscalYrEJB extends GenericDAO<FiscalYrModel> implements Serializable {

    /**
     * 
     */
    private static final long serialVersionUID = 1L;

    public FiscalYrEJB() {
        super(FiscalYrModel.class);
        // TODO Auto-generated constructor stub
    }

    public List<FiscalYrModel> listAllFiscalYr(){
        List<FiscalYrModel> fsList = new ArrayList<FiscalYrModel>();
        fsList = findAllWithGivenCondition(FiscalYrModel.FIND_ALL_FISCAL_YR, null);
        return fsList;
    }


    public FiscalYrModel getActiveFsYr(){

        return findOneResult(FiscalYrModel.FIND_ACTIVE_FISCAL_YR, null);
    }
}

我不知道是什么原因导致这个错误在我以前的机器上运行良好。我已经在我以前的机器上添加了所有必需的库以及相同版本的eclipse。 此特定错误仅发生在我新配置的计算机中。

0 个答案:

没有答案