Issue Details (XML | Word | Printable)

Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Bhakti Mehta
Reporter: dhcavalcanti
Votes: 0
Watchers: 0

If you were logged in you would be able to see more operations.

Resource injection fails.

Created: 23/Jan/07 11:44 AM   Updated: 25/Feb/12 07:44 PM   Resolved: 01/Jun/07 01:00 PM
Component/s: web_services
Affects Version/s: 9.1pe
Fix Version/s: 9.1pe

Time Tracking:
Not Specified

File Attachments: 1. Zip Archive (142 kB) 23/Jan/07 11:45 AM - dhcavalcanti
2. Zip Archive (149 kB) 12/Feb/07 08:15 AM - dhcavalcanti
3. Text File server.log (15 kB) 12/Feb/07 08:17 AM - dhcavalcanti
4. Text File server.log (39 kB) 23/Jan/07 11:46 AM - dhcavalcanti


Operating System: All
Platform: Linux

Issue Links:

Issuezilla Id: 2,190
Participants: Bhakti Mehta, Cheng Fang, dhcavalcanti, gfbugbridge, Hong Zhang, mikeg and vijaysr

 Description  « Hide

I have an enterprise application that contains an EJB module. I setup an
ejb-jar.xml file to define resources that I want to inject into a couple beans.
But the resource injection fails (refer to log files).

I'm attaching the project and log file.

dhcavalcanti added a comment - 23/Jan/07 11:45 AM

Created an attachment (id=705)
NetBeans project.

dhcavalcanti added a comment - 23/Jan/07 11:46 AM

Created an attachment (id=706)
GlassFish log file

dhcavalcanti added a comment - 26/Jan/07 12:57 PM

The problem is definitely in the resource injection part on V2 M3 (build 28).
I re-deployed this (as an enterprise app and the ejb part by itself) on an
earlier version, V2 M2 (build 19), and it works fine. Thought this information
might be helpful.

Cheng Fang added a comment - 12/Feb/07 07:42 AM

I couldn't find any errors related to injection failures. It just shows some
FileNotFoundException. Can you just copy some essential lines from server.log
to the comment?

Are you trying to inject some env-entry to your ProducerBean and ConsumerBean,
and you are not seeing these values being injected? I suppose you verified it
by the output from logPrams(). But I don't see any of these output in your

I couldn't reproduce it in my tests.

dhcavalcanti added a comment - 12/Feb/07 08:15 AM

Ok, I attached another project that contains only one EJB/WS.
It does try to inject some resources from env-entry defined in ejb-jar.xml.

I also attached the server.log file. The file contains the logging information
for the following:
1. start the server.
2. deploy the EJB jar file.
3. stop the server.

During step two, you can see the logging that my app generates indicating the
resource injection failed. For example, message id 2007-02-12T11:04:13.470-0500.

I have a init() method annotated with @PostConstruct which checks if the values
have been injected. If they have not, I log this error, which is what you see in
the log file.

I run all these in a Linux box (Fedora 6).

dhcavalcanti added a comment - 12/Feb/07 08:15 AM

Created an attachment (id=727)
The new project I talked about

dhcavalcanti added a comment - 12/Feb/07 08:17 AM

Created an attachment (id=728)
The log files related to the schema-manager project.

Cheng Fang added a comment - 12/Feb/07 09:05 AM

In your schema-manager app, the <env-entry-value> is an empty string. As a
result, the injection target field is not initialized. It's an appserver bug.

If you change <env-entry-value> to a non-empty value, are they injected
correctly? It should work based on my testing so far.

If you still seeing injection failures, can you remove @WebService annotation
from your beans, and see if the injections work or not. My own tests do not use
@WebService in beans and that may explains why I don't see your failures.

dhcavalcanti added a comment - 12/Feb/07 10:18 AM

I left the @WebService annotation there in the first test and defined values in
ejb-jar.xml. The injection still fails.

On the second test, I removed the WebService and related annotations (WebMethod
and WebParam) and the injection works.

So it seems that it fails when the bean is also a web service.

Cheng Fang added a comment - 12/Feb/07 10:31 AM

reassign to deployment category for further evaluation.

Hong Zhang added a comment - 12/Feb/07 10:51 AM

Assign to Vijay as this is webservice related.

vijaysr added a comment - 27/Feb/07 11:12 AM


Bhakti Mehta added a comment - 01/Mar/07 10:32 AM

I tried deploying the schema-manager.jar and run into this error. I tried
building and deploying from NB too.
Hence I am not able to reproduce your problem. Please can you attach the war to
reproduce the problem.

a-85ad-6c4d5da1581f;|javax.naming.NameNotFoundException: collector not found
java.lang.RuntimeException: javax.naming.NameNotFoundException: collector not fo
at com.sun.enterprise.server.PersistenceUnitInfoImpl._getJtaDataSource(P
at com.sun.enterprise.server.PersistenceUnitInfoImpl.<init>(PersistenceU
at com.sun.enterprise.server.PersistenceUnitLoaderImpl.load(PersistenceU
at com.sun.enterprise.server.PersistenceUnitLoaderImpl.load(PersistenceU
at com.sun.enterprise.server.AbstractLoader.loadPersistenceUnits(Abstrac
at com.sun.enterprise.server.EJBModuleLoader.doLoad(
at com.sun.enterprise.server.AbstractLoader.load(
at com.sun.enterprise.server.StandAloneEJBModulesManager.moduleDeployed(
at com.sun.enterprise.server.StandAloneEJBModulesManager.moduleDeployed(
at com.sun.enterprise.server.StandAloneEJBModulesManager.moduleDeployed(
at com.sun.enterprise.admin.event.AdminEventMulticaster.invokeModuleDepl
at com.sun.enterprise.admin.event.AdminEventMulticaster.handleModuleDepl
at com.sun.enterprise.admin.event.AdminEventMulticaster.processEvent(Adm
at com.sun.enterprise.admin.event.AdminEventMulticaster.multicastEvent(A
at com.sun.enterprise.admin.server.core.DeploymentNotificationHelper.mul
at com.sun.enterprise.deployment.phasing.DeploymentServiceUtils.multicas
at com.sun.enterprise.deployment.phasing.ServerDeploymentTarget.sendStar
at com.sun.enterprise.deployment.phasing.ApplicationStartPhase.runPhase(
at com.sun.enterprise.deployment.phasing.DeploymentPhase.executePhase(De
at com.sun.enterprise.deployment.phasing.PEDeploymentService.executePhas
at com.sun.enterprise.deployment.phasing.PEDeploymentService.deploy(PEDe
at com.sun.enterprise.deployment.phasing.PEDeploymentService.deploy(PEDe
at com.sun.enterprise.admin.mbeans.ApplicationsConfigMBean.deploy(Applic
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
at java.lang.reflect.Method.invoke(
at com.sun.enterprise.admin.MBeanHelper.invokeOperationInBean(MBeanHelpe
at com.sun.enterprise.admin.MBeanHelper.invokeOperationInBean(MBeanHelpe
at com.sun.enterprise.admin.config.BaseConfigMBean.invoke(BaseConfigMBea
at com.sun.jmx.mbeanserver.DynamicMetaDataImpl.invoke(DynamicMetaDataImp
at com.sun.jmx.mbeanserver.MetaDataImpl.invoke(
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultM
at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(
at sun.reflect.GeneratedMethodAccessor13.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
at java.lang.reflect.Method.invoke(
at com.sun.enterprise.admin.util.proxy.ProxyClass.invoke(
at $Proxy1.invoke(Unknown Source)
at com.sun.enterprise.admin.server.core.jmx.SunoneInterceptor.invoke(Sun
at com.sun.enterprise.deployment.autodeploy.AutoDeployer.invokeDeploymen
at com.sun.enterprise.deployment.autodeploy.AutoDeployer.deployJavaEEArc
at com.sun.enterprise.deployment.autodeploy.AutoDeployer.deploy(AutoDepl
at com.sun.enterprise.deployment.autodeploy.AutoDeployer.deployAll(AutoD
at com.sun.enterprise.deployment.autodeploy.AutoDeployControllerImpl$Aut
at java.util.TimerThread.mainLoop(
Caused by: javax.naming.NameNotFoundException: collector not found
at com.sun.enterprise.naming.TransientContext.doLookup(TransientContext.
at com.sun.enterprise.naming.TransientContext.lookup(TransientContext.ja
at com.sun.enterprise.naming.TransientContext.lookup(TransientContext.ja
at com.sun.enterprise.naming.SerialContextProviderImpl.lookup(SerialCont
at com.sun.enterprise.naming.LocalSerialContextProviderImpl.lookup(Local
at com.sun.enterprise.naming.SerialContext.lookup(
at javax.naming.InitialContext.lookup(
at com.sun.enterprise.connectors.ConnectorResourceAdminServiceImpl.looku
at com.sun.enterprise.connectors.ConnectorRuntime.lookupPMResource(Conne
at com.sun.enterprise.server.PersistenceUnitInfoImpl._getJtaDataSource(P
... 46 more


a1581f;|CORE5020: Error while loading ejb module|#]

.tools.admin|_ThreadID=14;_ThreadName=Timer-6;Error while loading EJB module [sc
hema-manager]. Please refer to the server log for more details. ;_RequestID=6c5f
da11-1b73-45da-85ad-6c4d5da1581f;|ADM1075:Error on listening event:[Error while
loading EJB module [schema-manager]. Please refer to the server log for more det
ails. ]|#]

-85ad-6c4d5da1581f;|Warning while deploying : com.sun.enterprise.deployment.back
end.IASDeploymentException: Error while loading EJB module [schema-manager]. Ple
ase refer to the server log for more details.

ols.deployment|_ThreadID=14;_ThreadName=Timer-6;|[AutoDeploy] Autodeployed : C:\
publish\glassfish\domains\domain1\autodeploy\schema-manager.jar with at least on
e warning. Please check the server.log file and make sure the autodeployment com
pleted as expected.|#]

dhcavalcanti added a comment - 01/Mar/07 11:35 AM

I the schema-manager project directory /schema-manager/src/conf/ there is a
schema-create.sql file to create the database/table used by the project. I used
MySQL. The persistence.xml points the the jbdc jndi resource I created in the
AS. You probably need to create the connection pool and the jdbc resource. I
think that's why it's throwing that exception.

gfbugbridge added a comment - 05/Apr/07 04:15 PM


mikeg added a comment - 01/Jun/07 01:00 PM

@PostConstruct method was being invoked before injections, so the injections
would not be visible using @PostConstruct. Fixed in b50