Issue Details (XML | Word | Printable)

Key: GLASSFISH-2190
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Bhakti Mehta
Reporter: dhcavalcanti
Votes: 0
Watchers: 0
Operations

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

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 collector-queue.zip (142 kB) 23/Jan/07 11:45 AM - dhcavalcanti
2. Zip Archive schema-manager.zip (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

Environment:

Operating System: All
Platform: Linux

Issue Links:
Related
 

Issuezilla Id: 2,190
Tags:
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
server.log.

I couldn't reproduce it in my tests.


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

Hum...
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

reassign


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

Hi,
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.

[#|2007-03-01T10:29:17.453-0800|WARNING|sun-appserver9.1|javax.enterprise.system
.core.classloading|_ThreadID=14;_ThreadName=Timer-6;_RequestID=6c5fda11-1b73-45d
a-85ad-6c4d5da1581f;|javax.naming.NameNotFoundException: collector not found
java.lang.RuntimeException: javax.naming.NameNotFoundException: collector not fo
und
at com.sun.enterprise.server.PersistenceUnitInfoImpl._getJtaDataSource(P
ersistenceUnitInfoImpl.java:267)
at com.sun.enterprise.server.PersistenceUnitInfoImpl.<init>(PersistenceU
nitInfoImpl.java:99)
at com.sun.enterprise.server.PersistenceUnitLoaderImpl.load(PersistenceU
nitLoaderImpl.java:108)
at com.sun.enterprise.server.PersistenceUnitLoaderImpl.load(PersistenceU
nitLoaderImpl.java:71)
at com.sun.enterprise.server.AbstractLoader.loadPersistenceUnits(Abstrac
tLoader.java:881)
at com.sun.enterprise.server.EJBModuleLoader.doLoad(EJBModuleLoader.java
:152)
at com.sun.enterprise.server.AbstractLoader.load(AbstractLoader.java:226
)
at com.sun.enterprise.server.StandAloneEJBModulesManager.moduleDeployed(
StandAloneEJBModulesManager.java:219)
at com.sun.enterprise.server.StandAloneEJBModulesManager.moduleDeployed(
StandAloneEJBModulesManager.java:174)
at com.sun.enterprise.server.StandAloneEJBModulesManager.moduleDeployed(
StandAloneEJBModulesManager.java:406)
at com.sun.enterprise.admin.event.AdminEventMulticaster.invokeModuleDepl
oyEventListener(AdminEventMulticaster.java:951)
at com.sun.enterprise.admin.event.AdminEventMulticaster.handleModuleDepl
oyEvent(AdminEventMulticaster.java:938)
at com.sun.enterprise.admin.event.AdminEventMulticaster.processEvent(Adm
inEventMulticaster.java:448)
at com.sun.enterprise.admin.event.AdminEventMulticaster.multicastEvent(A
dminEventMulticaster.java:160)
at com.sun.enterprise.admin.server.core.DeploymentNotificationHelper.mul
ticastEvent(DeploymentNotificationHelper.java:295)
at com.sun.enterprise.deployment.phasing.DeploymentServiceUtils.multicas
tEvent(DeploymentServiceUtils.java:210)
at com.sun.enterprise.deployment.phasing.ServerDeploymentTarget.sendStar
tEvent(ServerDeploymentTarget.java:285)
at com.sun.enterprise.deployment.phasing.ApplicationStartPhase.runPhase(
ApplicationStartPhase.java:119)
at com.sun.enterprise.deployment.phasing.DeploymentPhase.executePhase(De
ploymentPhase.java:95)
at com.sun.enterprise.deployment.phasing.PEDeploymentService.executePhas
es(PEDeploymentService.java:892)
at com.sun.enterprise.deployment.phasing.PEDeploymentService.deploy(PEDe
ploymentService.java:263)
at com.sun.enterprise.deployment.phasing.PEDeploymentService.deploy(PEDe
ploymentService.java:281)
at com.sun.enterprise.admin.mbeans.ApplicationsConfigMBean.deploy(Applic
ationsConfigMBean.java:542)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at com.sun.enterprise.admin.MBeanHelper.invokeOperationInBean(MBeanHelpe
r.java:353)
at com.sun.enterprise.admin.MBeanHelper.invokeOperationInBean(MBeanHelpe
r.java:336)
at com.sun.enterprise.admin.config.BaseConfigMBean.invoke(BaseConfigMBea
n.java:448)
at com.sun.jmx.mbeanserver.DynamicMetaDataImpl.invoke(DynamicMetaDataImp
l.java:213)
at com.sun.jmx.mbeanserver.MetaDataImpl.invoke(MetaDataImpl.java:220)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultM
BeanServerInterceptor.java:815)
at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:784
)
at sun.reflect.GeneratedMethodAccessor13.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at com.sun.enterprise.admin.util.proxy.ProxyClass.invoke(ProxyClass.java
:77)
at $Proxy1.invoke(Unknown Source)
at com.sun.enterprise.admin.server.core.jmx.SunoneInterceptor.invoke(Sun
oneInterceptor.java:297)
at com.sun.enterprise.deployment.autodeploy.AutoDeployer.invokeDeploymen
tService(AutoDeployer.java:508)
at com.sun.enterprise.deployment.autodeploy.AutoDeployer.deployJavaEEArc
hive(AutoDeployer.java:489)
at com.sun.enterprise.deployment.autodeploy.AutoDeployer.deploy(AutoDepl
oyer.java:436)
at com.sun.enterprise.deployment.autodeploy.AutoDeployer.deployAll(AutoD
eployer.java:253)
at com.sun.enterprise.deployment.autodeploy.AutoDeployControllerImpl$Aut
oDeployTask.run(AutoDeployControllerImpl.java:361)
at java.util.TimerThread.mainLoop(Timer.java:512)
at java.util.TimerThread.run(Timer.java:462)
Caused by: javax.naming.NameNotFoundException: collector not found
at com.sun.enterprise.naming.TransientContext.doLookup(TransientContext.
java:203)
at com.sun.enterprise.naming.TransientContext.lookup(TransientContext.ja
va:175)
at com.sun.enterprise.naming.TransientContext.lookup(TransientContext.ja
va:179)
at com.sun.enterprise.naming.SerialContextProviderImpl.lookup(SerialCont
extProviderImpl.java:61)
at com.sun.enterprise.naming.LocalSerialContextProviderImpl.lookup(Local
SerialContextProviderImpl.java:98)
at com.sun.enterprise.naming.SerialContext.lookup(SerialContext.java:315
)
at javax.naming.InitialContext.lookup(InitialContext.java:351)
at com.sun.enterprise.connectors.ConnectorResourceAdminServiceImpl.looku
p(ConnectorResourceAdminServiceImpl.java:179)
at com.sun.enterprise.connectors.ConnectorRuntime.lookupPMResource(Conne
ctorRuntime.java:1071)
at com.sun.enterprise.server.PersistenceUnitInfoImpl._getJtaDataSource(P
ersistenceUnitInfoImpl.java:264)
... 46 more

#]

[#|2007-03-01T10:29:17.453-0800|WARNING|sun-appserver9.1|javax.enterprise.system
.core|_ThreadID=14;_ThreadName=Timer-6;_RequestID=6c5fda11-1b73-45da-85ad-6c4d5d
a1581f;|CORE5020: Error while loading ejb module|#]

[#|2007-03-01T10:29:17.468-0800|WARNING|sun-appserver9.1|javax.enterprise.system
.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. ]|#]

[#|2007-03-01T10:29:17.468-0800|WARNING|sun-appserver9.1|javax.enterprise.system
.tools.deployment|_ThreadID=14;_ThreadName=Timer-6;_RequestID=6c5fda11-1b73-45da
-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.
.|#]

[#|2007-03-01T10:29:17.468-0800|INFO|sun-appserver9.1|javax.enterprise.system.to
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

<BT6543272>


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