Issue Details (XML | Word | Printable)

Key: GLASSFISH-11257
Type: Bug Bug
Status: Open Open
Priority: Major Major
Assignee: Tim Quinn
Reporter: Tim Quinn
Votes: 0
Watchers: 0
Operations

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

Managed Beans not supported during Java Web Start launches of app clients

Created: 06/Dec/09 08:58 AM   Updated: 10/May/13 11:06 AM
Component/s: standalone_client
Affects Version/s: 3.1, 3.1.1, 3.1.2, 4.0
Fix Version/s: future release

Time Tracking:
Not Specified

File Attachments: 1. Text File possibleSolution.txt (7 kB) 01/Dec/11 09:07 PM - Tim Quinn
2. Zip Archive TestManagedBeanClient.zip (23 kB) 30/Nov/11 10:24 PM - Tim Quinn

Environment:

Operating System: All
Platform: All


Issuezilla Id: 11,257
Status Whiteboard:

v3_exclude

Tags: 3_1-exclude 3_1_1-exclude 3_1_x-exclude 3_1_2-exclude
Participants: Gail Risdal, kumara, martinandersson.com and Tim Quinn


 Description  « Hide

Managed bean support is not available in app clients launched using Java Web
Start. This limitation arises because the annotation processing logic is based
on File objects. During Java Web Start launches the JAR files are not
accessible as File objects.



kumara added a comment - 06/Dec/09 06:11 PM

Not a show stopper for v3 release.


Gail Risdal added a comment - 08/Dec/09 06:59 PM

Added to v3 Release Notes.


Tim Quinn added a comment - 16/Dec/09 07:02 AM

Partial fix checked in.

These changes allow annotation scanning target JARs to be specified either by
File (as before) or by URI. The Java Web Start environment makes the URIs - but
not the corresponding File objects - easily available. Further changes are
underway to complete the work on this issue.

Author: tjquinn
Date: 2009-12-16 14:57:23+0000
New Revision: 35127

Modified:

trunk/v3/deployment/dol/src/main/java/com/sun/enterprise/deployment/annotation/impl/AppClientScanner.java

trunk/v3/deployment/dol/src/main/java/com/sun/enterprise/deployment/annotation/impl/ModuleScanner.java

trunk/v3/deployment/dol/src/main/java/com/sun/enterprise/deployment/annotation/introspection/ClassFile.java


Tim Quinn added a comment - 04/Oct/10 09:38 AM

setting target milestone to MS 7. Still need to see if we can really fix this
for 3.1.


Tim Quinn added a comment - 14/Nov/10 07:12 PM
      • Issue 11063 has been marked as a duplicate of this issue. ***

Tim Quinn added a comment - 17/Nov/10 05:21 PM

Marking this as excluded for 3.1.

I might get to this if time permits. Otherwise we'll reconsider it for a
possible future release.


Tim Quinn added a comment - 30/Nov/11 10:19 PM

Here is a stack trace from a Java Web Start launch of a very simple sample app client (I'll attach the code).

java.lang.RuntimeException: Error launching or running the application
at org.glassfish.appclient.client.JWSAppClientContainerMain.main(JWSAppClientContainerMain.java:144)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.sun.javaws.Launcher.executeApplication(Launcher.java:1914)
at com.sun.javaws.Launcher.executeMainClass(Launcher.java:1847)
at com.sun.javaws.Launcher.doLaunchApp(Launcher.java:1609)
at com.sun.javaws.Launcher.run(Launcher.java:138)
at java.lang.Thread.run(Thread.java:680)
Caused by: java.lang.RuntimeException: com.sun.enterprise.container.common.spi.util.InjectionException: Exception attempting to inject Env-Prop: testmanagedbean.Main/theBean@Field-Injectable Resource. Class name = testmanagedbean.Main Field name=theBean@java.lang.String@java:app/TestManagedBean/___internal_managed_bean_testmanagedbean.TheBean@@ into class testmanagedbean.Main: Lookup failed for 'java:comp/env/testmanagedbean.Main/theBean' in SerialContext[myEnv={java.naming.factory.initial=com.sun.enterprise.naming.SerialInitContextFactory, java.naming.factory.state=com.sun.corba.ee.impl.presentation.rmi.JNDIStateFactoryImpl, java.naming.factory.url.pkgs=com.sun.enterprise.naming}
at org.glassfish.appclient.client.JWSAppClientContainerMain$ClientRunner.run(JWSAppClientContainerMain.java:179)
at org.glassfish.appclient.client.JWSAppClientContainerMain.main(JWSAppClientContainerMain.java:138)
... 9 more
Caused by: com.sun.enterprise.container.common.spi.util.InjectionException: Exception attempting to inject Env-Prop: testmanagedbean.Main/theBean@Field-Injectable Resource. Class name = testmanagedbean.Main Field name=theBean@java.lang.String@java:app/TestManagedBean/___internal_managed_bean_testmanagedbean.TheBean@@ into class testmanagedbean.Main: Lookup failed for 'java:comp/env/testmanagedbean.Main/theBean' in SerialContext[myEnv={java.naming.factory.initial=com.sun.enterprise.naming.SerialInitContextFactory, java.naming.factory.state=com.sun.corba.ee.impl.presentation.rmi.JNDIStateFactoryImpl, java.naming.factory.url.pkgs=com.sun.enterprise.naming}
at com.sun.enterprise.container.common.impl.util.InjectionManagerImpl._inject(InjectionManagerImpl.java:703)
at com.sun.enterprise.container.common.impl.util.InjectionManagerImpl.inject(InjectionManagerImpl.java:470)
at com.sun.enterprise.container.common.impl.util.InjectionManagerImpl.injectClass(InjectionManagerImpl.java:213)
at com.sun.enterprise.container.common.impl.util.InjectionManagerImpl.injectClass(InjectionManagerImpl.java:205)
at org.glassfish.appclient.client.acc.AppClientContainer$ClientMainClassSetting.getClientMainClass(AppClientContainer.java:625)
at org.glassfish.appclient.client.acc.AppClientContainer.getMainMethod(AppClientContainer.java:517)
at org.glassfish.appclient.client.acc.AppClientContainer.completePreparation(AppClientContainer.java:411)
at org.glassfish.appclient.client.acc.AppClientContainer.prepare(AppClientContainer.java:319)
at org.glassfish.appclient.client.AppClientFacade.prepareACC(AppClientFacade.java:278)
at org.glassfish.appclient.client.JWSAppClientContainerMain$ClientRunner.run(JWSAppClientContainerMain.java:168)
... 10 more
Caused by: javax.naming.NamingException: Lookup failed for 'java:comp/env/testmanagedbean.Main/theBean' in SerialContext[myEnv={java.naming.factory.initial=com.sun.enterprise.naming.SerialInitContextFactory, java.naming.factory.state=com.sun.corba.ee.impl.presentation.rmi.JNDIStateFactoryImpl, java.naming.factory.url.pkgs=com.sun.enterprise.naming} [Root exception is javax.naming.NamingException: Lookup failed for 'java:app/TestManagedBean/___internal_managed_bean_testmanagedbean.TheBean' in SerialContext[myEnv={java.naming.factory.initial=com.sun.enterprise.naming.SerialInitContextFactory, java.naming.factory.state=com.sun.corba.ee.impl.presentation.rmi.JNDIStateFactoryImpl, java.naming.factory.url.pkgs=com.sun.enterprise.naming, com.sun.enterprise.naming.logicalName=java:comp/env/testmanagedbean.Main/theBean} [Root exception is javax.naming.NamingException: Lookup failed for '_internal_java_app_for_app_clientTestManagedBeanjava:app/TestManagedBean/__internal_managed_bean_testmanagedbean.TheBean' in SerialContext[myEnv={java.naming.factory.initial=com.sun.enterprise.naming.SerialInitContextFactory, java.naming.factory.state=com.sun.corba.ee.impl.presentation.rmi.JNDIStateFactoryImpl, java.naming.factory.url.pkgs=com.sun.enterprise.naming, com.sun.enterprise.naming.logicalName=java:comp/env/testmanagedbean.Main/theBean} [Root exception is javax.naming.NameNotFoundException: __internal_java_app_for_app_client__TestManagedBean__java:app]]]
at com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.java:518)
at com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.java:455)
at javax.naming.InitialContext.lookup(InitialContext.java:392)
at com.sun.enterprise.container.common.impl.util.InjectionManagerImpl._inject(InjectionManagerImpl.java:599)
... 19 more
Caused by: javax.naming.NamingException: Lookup failed for 'java:app/TestManagedBean/___internal_managed_bean_testmanagedbean.TheBean' in SerialContext[myEnv={java.naming.factory.initial=com.sun.enterprise.naming.SerialInitContextFactory, java.naming.factory.state=com.sun.corba.ee.impl.presentation.rmi.JNDIStateFactoryImpl, java.naming.factory.url.pkgs=com.sun.enterprise.naming, com.sun.enterprise.naming.logicalName=java:comp/env/testmanagedbean.Main/theBean} [Root exception is javax.naming.NamingException: Lookup failed for '_internal_java_app_for_app_clientTestManagedBeanjava:app/TestManagedBean/__internal_managed_bean_testmanagedbean.TheBean' in SerialContext[myEnv={java.naming.factory.initial=com.sun.enterprise.naming.SerialInitContextFactory, java.naming.factory.state=com.sun.corba.ee.impl.presentation.rmi.JNDIStateFactoryImpl, java.naming.factory.url.pkgs=com.sun.enterprise.naming, com.sun.enterprise.naming.logicalName=java:comp/env/testmanagedbean.Main/theBean} [Root exception is javax.naming.NameNotFoundException: __internal_java_app_for_app_client__TestManagedBean__java:app]]
at com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.java:518)
at com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.java:455)
at javax.naming.InitialContext.lookup(InitialContext.java:392)
at com.sun.enterprise.naming.util.JndiNamingObjectFactory.create(JndiNamingObjectFactory.java:90)
at com.sun.enterprise.container.common.impl.ComponentEnvManagerImpl$1.create(ComponentEnvManagerImpl.java:650)
at com.sun.enterprise.naming.impl.GlassfishNamingManagerImpl.lookup(GlassfishNamingManagerImpl.java:776)
at com.sun.enterprise.naming.impl.GlassfishNamingManagerImpl.lookup(GlassfishNamingManagerImpl.java:744)
at com.sun.enterprise.naming.impl.JavaURLContext.lookup(JavaURLContext.java:169)
at com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.java:498)
... 22 more
Caused by: javax.naming.NamingException: Lookup failed for '_internal_java_app_for_app_clientTestManagedBeanjava:app/TestManagedBean/__internal_managed_bean_testmanagedbean.TheBean' in SerialContext[myEnv={java.naming.factory.initial=com.sun.enterprise.naming.SerialInitContextFactory, java.naming.factory.state=com.sun.corba.ee.impl.presentation.rmi.JNDIStateFactoryImpl, java.naming.factory.url.pkgs=com.sun.enterprise.naming, com.sun.enterprise.naming.logicalName=java:comp/env/testmanagedbean.Main/theBean} [Root exception is javax.naming.NameNotFoundException: __internal_java_app_for_app_client__TestManagedBean__java:app]
at com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.java:518)
at com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.java:455)
at javax.naming.InitialContext.lookup(InitialContext.java:392)
at com.sun.enterprise.naming.impl.JavaURLContext.lookup(JavaURLContext.java:226)
at com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.java:498)
... 30 more
Caused by: javax.naming.NameNotFoundException: _internal_java_app_for_app_clientTestManagedBean_java:app
at com.sun.enterprise.naming.impl.TransientContext.resolveContext(TransientContext.java:310)
at com.sun.enterprise.naming.impl.TransientContext.lookup(TransientContext.java:218)
at com.sun.enterprise.naming.impl.SerialContextProviderImpl.lookup(SerialContextProviderImpl.java:77)
at com.sun.enterprise.naming.impl.RemoteSerialContextProviderImpl.lookup(RemoteSerialContextProviderImpl.java:109)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.sun.corba.ee.impl.presentation.rmi.ReflectiveTie.dispatchToMethod(ReflectiveTie.java:144)
at com.sun.corba.ee.impl.presentation.rmi.ReflectiveTie._invoke(ReflectiveTie.java:174)
at com.sun.corba.ee.impl.protocol.CorbaServerRequestDispatcherImpl.dispatchToServant(CorbaServerRequestDispatcherImpl.java:528)
at com.sun.corba.ee.impl.protocol.CorbaServerRequestDispatcherImpl.dispatch(CorbaServerRequestDispatcherImpl.java:199)
at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequestRequest(CorbaMessageMediatorImpl.java:1624)
at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequest(CorbaMessageMediatorImpl.java:1486)
at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleInput(CorbaMessageMediatorImpl.java:990)
at com.sun.corba.ee.impl.protocol.giopmsgheaders.RequestMessage_1_2.callback(RequestMessage_1_2.java:214)
at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequest(CorbaMessageMediatorImpl.java:742)
at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.dispatch(CorbaMessageMediatorImpl.java:539)
at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.doWork(CorbaMessageMediatorImpl.java:2324)
at com.sun.corba.ee.impl.orbutil.threadpool.ThreadPoolImpl$WorkerThread.performWork(ThreadPoolImpl.java:497)
at com.sun.corba.ee.impl.orbutil.threadpool.ThreadPoolImpl$WorkerThread.run(ThreadPoolImpl.java:540)


Tim Quinn added a comment - 30/Nov/11 10:24 PM

Attaching sample NB project containing a very simple app client with a ManagedBean. It works when launched using appclient -jar (path-to-appclient-JAR), and it works when deployed and the client stubs are retrieved. It does not work when launched using Java Web Start.


Tim Quinn added a comment - 01/Dec/11 09:07 PM

Added text document describing a possible solution approach.


Tim Quinn added a comment - 01/Dec/11 09:09 PM

Updating "affects versions" and excluding from 3.1.2 and any other other 3.1.x releases that might come along.


Tim Quinn added a comment - 01/Dec/11 09:10 PM

Adjusting title to fix a typo that has bothered me a long time.


martinandersson.com added a comment - 10/May/13 11:06 AM

I think this bug is something I could have stumbled upon when I try to use @Inject in my application client launched through Java web start. The impression I get is that the annotation is not scanned at all. I've expressed myself a little bit more over at stack overflow: http://stackoverflow.com/q/16480767/1268003