[GLASSFISH-11257] Managed Beans not supported during Java Web Start launches of app clients Created: 06/Dec/09  Updated: 10/May/13

Status: Open
Project: glassfish
Component/s: standalone_client
Affects Version/s: 3.1, 3.1.1, 3.1.2, 4.0
Fix Version/s: future release

Type: Bug Priority: Major
Reporter: Tim Quinn Assignee: Tim Quinn
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: All
Platform: All


Attachments: Text File possibleSolution.txt     Zip Archive TestManagedBeanClient.zip    
Issuezilla Id: 11,257
Status Whiteboard:

v3_exclude

Tags: 3_1-exclude, 3_1_1-exclude, 3_1_2-exclude, 3_1_x-exclude

 Description   

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.



 Comments   
Comment by kumara [ 06/Dec/09 ]

Not a show stopper for v3 release.

Comment by Gail Risdal [ 08/Dec/09 ]

Added to v3 Release Notes.

Comment by Tim Quinn [ 16/Dec/09 ]

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

Comment by Tim Quinn [ 04/Oct/10 ]

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

Comment by Tim Quinn [ 14/Nov/10 ]
      • Issue 11063 has been marked as a duplicate of this issue. ***
Comment by Tim Quinn [ 17/Nov/10 ]

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.

Comment by Tim Quinn [ 30/Nov/11 ]

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)

Comment by Tim Quinn [ 30/Nov/11 ]

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.

Comment by Tim Quinn [ 01/Dec/11 ]

Added text document describing a possible solution approach.

Comment by Tim Quinn [ 01/Dec/11 ]

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

Comment by Tim Quinn [ 01/Dec/11 ]

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

Comment by martinandersson.com [ 10/May/13 ]

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

Generated at Wed Aug 31 04:24:03 UTC 2016 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.