users@glassfish.java.net

Re: deployment trouble: jar in ear's /lib folder invisible to the ejbmodule

From: Sahoo <sanjeeb.sahoo_at_oracle.com>
Date: Fri, 27 May 2011 13:52:27 +0530

That does not provide much clue. Given the exception, I do feel some
where there is an MyClassThatCannotBeFound[]


and it is being attempted to be loaded using ClassLoader.loadClass() as
opposed to Class.forName(). ClassLoader.loadClass() can't be used to
load array types. So, I think you can try adding a conditional
breakpoint in ClassLoader.loadClass with your matching class name or use
something like BTrace to trace the class loading attempt. Or, if you
have a reproducible test case, file a bug against deployment.

Sahoo

On Friday 27 May 2011 01:35 PM, Matthieu Bertin wrote:
> EAR
> +--------business.jar <---- containing MyEjbThatFailsToDeploy
> +--------/lib/
> | +---- domain.jar <---- contains MyClassThatCannotBeFound
> +--------META-INF/
> +----- application.xml
>
> MyEjbThatFailsToDeploy uses MyClassThatCannotBeFound as a private
> field. maybe the use of a @resource is a problem.
> here's a snippet :
>
> import com.mycompany.domain. MyClassThatCannotBeFound;
>
>
> @Stateless
> @WebService(endpointInterface = "com. mycompany.business.I
> MyEjbThatFailsToDeploy", targetNamespace =
> "http://myapp.mycompany.com/ns/ MyEjbThatFailsToDeploy")
> public class MyEjbThatFailsToDeploy implements
> IMyEjbThatFailsToDeployLocal, IMyEjbThatFailsToDeploy {
>
> private MyClassThatCannotBeFound dao;
>
> @PersistenceContext
> private EntityManager em;
>
> public MyEjbThatFailsToDeploy() {
> this. dao = new MyClassThatCannotBeFound(em);
> }
>
> (...)
> On Thu, May 26, 2011 at 5:47 PM, Sahoo <sanjeeb.sahoo_at_oracle.com
> <mailto:sanjeeb.sahoo_at_oracle.com>> wrote:
>
> No, it's not. I overlooked that log message completely - sorry
> about that. Some kind of class loading wrt arraytypes as I see
> from the message below:
>
>
> Lcom/mycompany/myapp/domain/dao/MyClassThatCannotBeFound ; ] not
> found. Error while loading [ class
> com.mycompany.myapp.auth.MyEjbThatFailsToDeploy ]|#]
>
> How does com.mycompany.myapp.auth.MyEjbThatFailsToDeploy use
> com.mycompany.myapp.domain.dao.MyClassThatCannotBeFound ? Where
> are these classes packaged in the ear?
>
> Thanks,
> Sahoo
>
>
> On Thursday 26 May 2011 07:53 PM, Matthieu Bertin wrote:
>> is this line a false alarm ?
>>
>> [#|2011-05-26T10:56:19.181+0200|SEVERE|glassfish3.1|global|_ThreadID=23;_ThreadName=Thread-1;|Class
>> [ Lcom/mycompany/myapp/domain/dao/MyClassThatCannotBeFound ; ]
>> not found. Error while loading [ class
>> com.mycompany.myapp.auth.MyEjbThatFailsToDeploy ]|#]
>>
>> I've tried some more. I got another EJB which deploys flawlessly.
>> It is in the same ejb jar. What is striking me is that it uses
>> exactly the same MyClassThatCannotBeFound, in the same way. But
>> it deploys, whereas the other does not.
>>
>> I've removed the mention of MyEjbThatFailsToDeploy in my
>> glassfish-ejb-jar.xml, which nows is the following:
>> <?xml version="1.0" encoding="UTF-8"?>
>> <!DOCTYPE glassfish-ejb-jar PUBLIC "-//GlassFish.org//DTD
>> GlassFish Application Server 3.1 EJB 3.1//EN"
>> "http://glassfish.org/dtds/glassfish-ejb-jar_3_1-1.dtd">
>> <glassfish-ejb-jar>
>>
>> <security-role-mapping>
>> <role-name>shop</role-name>
>> <group-name>shop</group-name>
>> </security-role-mapping>
>>
>> <security-role-mapping>
>> <role-name>central</role-name>
>> <group-name>central</group-name>
>> </security-role-mapping>
>>
>> <enterprise-beans>
>> <ejb>
>> <ejb-name>CustomerAuthenticationEjb</ejb-name>
>> <webservice-endpoint>
>> <port-component-name>CustomerAuthenticationEjb</port-component-name>
>> <login-config>
>> <auth-method>CLIENT-CERT</auth-method>
>> <realm>certificate</realm>
>> </login-config>
>> <transport-guarantee>CONFIDENTIAL</transport-guarantee>
>> </webservice-endpoint>
>> </ejb> <!--<ejb> <ejb-name>CustomerAccessManagementEjb</ejb-name>
>> <webservice-endpoint>
>> <port-component-name>CustomerAccessManagementEjb</port-component-name>
>> <login-config>
>> <auth-method>CLIENT-CERT</auth-method> <realm>certificate</realm>
>> </login-config>
>> <transport-guarantee>CONFIDENTIAL</transport-guarantee>
>> </webservice-endpoint>
>> </ejb> -->
>> </enterprise-beans>
>>
>> </glassfish-ejb-jar>
>>
>>
>>
>> and my glassfish-application.xml exists but it is empty.
>>
>> And i still get the same error message:
>> [#|2011-05-26T10:56:19.181+0200|SEVERE|glassfish3.1|global|_ThreadID=23;_ThreadName=Thread-1;|Class
>> [ Lcom/mycompany/myapp/domain/dao/MyClassThatCannotBeFound ; ]
>> not found. Error while loading [ class
>> com.mycompany.myapp.auth.MyEjbThatFailsToDeploy ]|#]
>>
>> On Thu, May 26, 2011 at 12:05 PM, Sahoo <sanjeeb.sahoo_at_oracle.com
>> <mailto:sanjeeb.sahoo_at_oracle.com>> wrote:
>>
>> I don't see any classloading errors. It seems there is a
>> wrong EJB name used somewhere. Most likely it is in one of
>> the sun-*.xml file.
>>
>> Sahoo
>>
>> On Thursday 26 May 2011 03:11 PM, Matthieu Bertin wrote:
>>> EAR
>>> +--------business.jar <---- containing EJB which fails to
>>> find a class from the domain.jar
>>> +--------/lib/
>>> | +---- domain.jar <---- contains the "missing" class
>>> +--------META-INF/
>>> +----- application.xml
>>>
>>> all the dependencies of the missing class can be resolved:
>>> most of it comes from javax.persistence and org.jasypt; the
>>> jasypt.jar is in the glassfish/lib folder.
>>>
>>> here is the server.log i get when deploying:
>>>
>>> [#|2011-05-26T10:56:19.181+0200|SEVERE|glassfish3.1|global|_ThreadID=23;_ThreadName=Thread-1;|Class
>>> [ Lcom/mycompany/myapp/domain/dao/MyClassThatCannotBeFound ;
>>> ] not found. Error while loading [ class
>>> com.mycompany.myapp.auth.MyEjbThatFailsToDeploy ]|#]
>>>
>>> [#|2011-05-26T10:56:19.188+0200|SEVERE|glassfish3.1|javax.enterprise.system.core.com.sun.enterprise.v3.server|_ThreadID=87;_ThreadName=Thread-1;|Exception
>>> lors du déploiement de l’application [myapp]|#]
>>>
>>> [#|2011-05-26T10:56:19.189+0200|SEVERE|glassfish3.1|javax.enterprise.system.core.com.sun.enterprise.v3.server|_ThreadID=87;_ThreadName=Thread-1;|Erreur
>>> de référencement : Cet ensemble ne comporte aucun bean nommé
>>> [MyEjbThatFailsToDeploy]
>>> java.lang.IllegalArgumentException: Erreur de référencement
>>> : Cet ensemble ne comporte aucun bean nommé
>>> [MyEjbThatFailsToDeploy]
>>> at
>>> com.sun.enterprise.deployment.EjbBundleDescriptor.getEjbByName(EjbBundleDescriptor.java:287)
>>> at
>>> com.sun.enterprise.deployment.EjbBundleDescriptor.getEjbByName(EjbBundleDescriptor.java:271)
>>> at
>>> com.sun.enterprise.deployment.node.runtime.EjbNode.setElementValue(EjbNode.java:125)
>>> at
>>> com.sun.enterprise.deployment.node.SaxParserHandler.endElement(SaxParserHandler.java:476)
>>> at
>>> com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(AbstractSAXParser.java:604)
>>> at
>>> com.sun.org.apache.xerces.internal.impl.dtd.XMLNSDTDValidator.endNamespaceScope(XMLNSDTDValidator.java:266)
>>> at
>>> com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.handleEndElement(XMLDTDValidator.java:2053)
>>> at
>>> com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.endElement(XMLDTDValidator.java:927)
>>> at
>>> com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanEndElement(XMLDocumentFragmentScannerImpl.java:1759)
>>> at
>>> com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2915)
>>> at
>>> com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:625)
>>> at
>>> com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:116)
>>> at
>>> com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:488)
>>> at
>>> com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:819)
>>> at
>>> com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:748)
>>> at
>>> com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:123)
>>> at
>>> com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1208)
>>> at
>>> com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:525)
>>> at javax.xml.parsers.SAXParser.parse(SAXParser.java:392)
>>> at
>>> com.sun.enterprise.deployment.io.DeploymentDescriptorFile.read(DeploymentDescriptorFile.java:309)
>>> at
>>> com.sun.enterprise.deployment.archivist.Archivist.readRuntimeDeploymentDescriptor(Archivist.java:718)
>>> at
>>> com.sun.enterprise.deployment.archivist.Archivist.readRuntimeDeploymentDescriptor(Archivist.java:668)
>>> at
>>> com.sun.enterprise.deployment.archivist.ApplicationArchivist.readRuntimeDeploymentDescriptor(ApplicationArchivist.java:728)
>>> at
>>> com.sun.enterprise.deployment.archivist.ApplicationArchivist.openWith(ApplicationArchivist.java:265)
>>> 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)
>>> at
>>> com.sun.enterprise.v3.server.ApplicationLifecycle.setupContainerInfos(ApplicationLifecycle.java:768)
>>> at
>>> com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:368)
>>> at
>>> com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:240)
>>> at
>>> org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:370)
>>> at
>>> com.sun.enterprise.v3.admin.CommandRunnerImpl$1.execute(CommandRunnerImpl.java:355)
>>> at
>>> com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:370)
>>> at
>>> com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1067)
>>> at
>>> com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1200(CommandRunnerImpl.java:96)
>>> at
>>> com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1247)
>>> at
>>> com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1235)
>>> at
>>> com.sun.enterprise.v3.admin.AdminAdapter.doCommand(AdminAdapter.java:465)
>>> at
>>> com.sun.enterprise.v3.admin.AdminAdapter.service(AdminAdapter.java:222)
>>> at
>>> com.sun.grizzly.tcp.http11.GrizzlyAdapter.service(GrizzlyAdapter.java:168)
>>> at
>>> com.sun.enterprise.v3.server.HK2Dispatcher.dispath(HK2Dispatcher.java:117)
>>> at
>>> com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:234)
>>> at
>>> com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:822)
>>> at
>>> com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:719)
>>> at
>>> com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1013)
>>> at
>>> com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:225)
>>> at
>>> com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
>>> at
>>> com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
>>> at
>>> com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
>>> at
>>> com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
>>> at
>>> com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
>>> at
>>> com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
>>> at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
>>> at
>>> com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
>>> at
>>> com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
>>> at java.lang.Thread.run(Thread.java:679)
>>> |#]
>>>
>>> [#|2011-05-26T10:56:19.191+0200|SEVERE|glassfish3.1|javax.enterprise.system.tools.admin.org.glassfish.deployment.admin|_ThreadID=87;_ThreadName=Thread-1;|Exception
>>> lors du déploiement de l’application [myapp] : Erreur de
>>> référencement : Cet ensemble ne comporte aucun bean nommé
>>> [MyEjbThatFailsToDeploy]|#]
>>>
>>>
>>> On Thu, May 26, 2011 at 11:29 AM, Sahoo
>>> <sanjeeb.sahoo_at_oracle.com <mailto:sanjeeb.sahoo_at_oracle.com>>
>>> wrote:
>>>
>>> Send exception stack trace and any relevant info like
>>> where is the class packaged? Is it in two places? Are
>>> all its dependencies satisfied?
>>>
>>> Sahoo
>>>
>>> On Thursday 26 May 2011 02:56 PM, Matthieu Bertin wrote:
>>>> Hello Sahoo,
>>>>
>>>> I've added the jarmodule trying to force glassfish to
>>>> read it. but it didn't work.
>>>> I'm getting the very same error with the following
>>>> application.xml:
>>>>
>>>> <?xml version="1.0" encoding="UTF-8"?>
>>>> <application xmlns="http://java.sun.com/xml/ns/javaee"
>>>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>>> xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
>>>> http://java.sun.com/xml/ns/javaee/application_6.xsd"
>>>> version="6">
>>>> <application-name>myapp</application-name>
>>>> <display-name>myapp</display-name>
>>>> <module>
>>>> <ejb>business-2.0.3-SNAPSHOT.jar</ejb>
>>>> </module>
>>>> <library-directory>lib</library-directory>
>>>> </application>
>>>>
>>>> and of course i've doubled-checked that the domain.jar
>>>> is in the ear lib folder, and contains the "missing" class.
>>>
>>>
>>
>>
>
>