Reputation: 2980
We had glassfish 2.1 application server where ejb applications were running.Now in a new server we have installed glassfish 3.1 where when I try to deploy one of the EJB applications the following exception comes.....
Cannot resolve reference Local ejb-ref name=com.alw.mdb.ExtFileUploadedMessageHandlerBean/fileUploaderBean,Local 3.x interface =com.alw.sbi.extuploader.utils.ExtFileManagerLocal,ejb-link=null,lookup=,mappedName=,jndi-name=,refType=Session because there are 2 ejbs in the application with interface com.alw.sbi.extuploader.utils.ExtFileManagerLocal.
Some of the possible causes:
1. The EJB bean class was packaged in an ear lib library (or through any other library mechanism which makes the library visible to all component modules), this makes all the component modules include this bean class indirectly.
2. The EJB bean class was packaged in a component module which references the EJB, either directly or indirectly through Manifest, WEB-INF/lib.
The EJB bean class should only be packaged in the declaring ejb module and not the referencing modules. The referencing modules should only include EJB interfaces.
java.lang.IllegalArgumentException: Cannot resolve reference Local ejb-ref name=com.alw.mdb.ExtFileUploadedMessageHandlerBean/fileUploaderBean,Local 3.x interface =com.alw.sbi.extuploader.utils.ExtFileManagerLocal,ejb-link=null,lookup=,mappedName=,jndi-name=,refType=Session because there are 2 ejbs in the application with interface com.alw.sbi.extuploader.utils.ExtFileManagerLocal.
Some of the possible causes:
1. The EJB bean class was packaged in an ear lib library (or through any other library mechanism which makes the library visible to all component modules), this makes all the component modules include this bean class indirectly.
2. The EJB bean class was packaged in a component module which references the EJB, either directly or indirectly through Manifest, WEB-INF/lib.
The EJB bean class should only be packaged in the declaring ejb module and not the referencing modules. The referencing modules should only include EJB interfaces.
at com.sun.enterprise.deployment.util.EjbBundleValidator.accept(EjbBundleValidator.java:568)
at com.sun.enterprise.deployment.EjbDescriptor.visit(EjbDescriptor.java:2589)
at com.sun.enterprise.deployment.EjbBundleDescriptor.visit(EjbBundleDescriptor.java:734)
at com.sun.enterprise.deployment.Application.visit(Application.java:1768)
at com.sun.enterprise.deployment.archivist.ApplicationArchivist.validate(ApplicationArchivist.java:799)
at com.sun.enterprise.deployment.archivist.ApplicationArchivist.openWith(ApplicationArchivist.java:277)
at com.sun.enterprise.deployment.archivist.ApplicationFactory.openWith(ApplicationFactory.java:240)
at org.glassfish.javaee.core.deployment.DolProvider.load(DolProvider.java:170)
at org.glassfish.javaee.core.deployment.DolProvider.load(DolProvider.java:93)
at com.sun.enterprise.v3.server.ApplicationLifecycle.loadDeployer(ApplicationLifecycle.java:826)
Could anyone please tell me where the problem lies ?
And one more thing when we install one application server, should we put the required jar
files in the server's lib
folder manually or these comes by itself. Because in our another test server there are so many jars in glassfish/lib
folder but not in the newly installed one.
Upvotes: 1
Views: 2413
Reputation: 9892
This may help: http://docs.oracle.com/cd/E18930_01/html/821-2417/beaek.html.
There is also a way to do a compatible deploy from the command line:
asadmin deploy --property compatibility=v2 foo.ear
which you can read about in https://java.net/jira/browse/GLASSFISH-10496
Upvotes: 2