Skip to main content

Unable to access EJB from application client

30 replies [Last post]
vimalkansal
Offline
Joined: 2004-03-23

Hi,

I am using Java Web start to run/deliver my application client. When my client makes request to session bean, I am getting the following stack trace :

Exception in thread "AWT-EventQueue-0" java.lang.InternalError: Error loading com.sun.corba.ee.impl.io.IIOPOutputStream
at com.sun.corba.ee.impl.io.ValueHandlerImpl$StreamFactory.run(ValueHandlerImpl.java:838)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.corba.ee.impl.io.ValueHandlerImpl.createOutputStream(ValueHandlerImpl.java:794)
at com.sun.corba.ee.impl.io.ValueHandlerImpl.writeValueWithVersion(ValueHandlerImpl.java:198)
at com.sun.corba.ee.impl.io.ValueHandlerImpl.writeValue(ValueHandlerImpl.java:146)
at com.sun.corba.ee.impl.encoding.CDROutputStream_1_0.writeRMIIIOPValueType(CDROutputStream_1_0.java:793)
at com.sun.corba.ee.impl.encoding.CDROutputStream_1_0.write_value(CDROutputStream_1_0.java:876)
at com.sun.corba.ee.impl.encoding.CDROutputStream_1_0.write_value(CDROutputStream_1_0.java:890)
at com.sun.corba.ee.impl.encoding.CDROutputStream_1_0.write_value(CDROutputStream_1_0.java:649)
at com.sun.corba.ee.impl.encoding.CDROutputStream.write_value(CDROutputStream.java:245)
at com.sun.corba.ee.impl.presentation.rmi.DynamicMethodMarshallerImpl$14.write(DynamicMethodMarshallerImpl.java:347)
at com.sun.corba.ee.impl.presentation.rmi.DynamicMethodMarshallerImpl.writeArguments(DynamicMethodMarshallerImpl.java:420)
at com.sun.corba.ee.impl.presentation.rmi.StubInvocationHandlerImpl.privateInvoke(StubInvocationHandlerImpl.java:161)
at com.sun.corba.ee.impl.presentation.rmi.StubInvocationHandlerImpl.invoke(StubInvocationHandlerImpl.java:123)
at com.sun.corba.ee.impl.presentation.rmi.bcel.BCELStubBase.invoke(BCELStubBase.java:196)
at com.pac.net.services.__AgentManagerRemote_Remote_DynamicStub.attemptLogin(__AgentManagerRemote_Remote_DynamicStub.java)
at com.pac.net.services._AgentManagerRemote_Wrapper.attemptLogin(com.pac.net.services._AgentManagerRemote_Wrapper.java)
at jws1.NewJFrame.onLogin(NewJFrame.java:104)
at jws1.NewJFrame.access$000(NewJFrame.java:20)
at jws1.NewJFrame$1.mouseClicked(NewJFrame.java:55)
at java.awt.AWTEventMulticaster.mouseClicked(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
Caused by: java.lang.ExceptionInInitializerError
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at java.lang.Class.newInstance0(Unknown Source)
at java.lang.Class.newInstance(Unknown Source)
at com.sun.corba.ee.impl.io.ValueHandlerImpl$StreamFactory.run(ValueHandlerImpl.java:836)
... 40 more
Caused by: java.security.AccessControlException: access denied (java.lang.RuntimePermission accessClassInPackage.sun.corba)
at java.security.AccessControlContext.checkPermission(Unknown Source)
at java.security.AccessController.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkPackageAccess(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
at com.sun.corba.ee.impl.io.IIOPOutputStream$1.run(IIOPOutputStream.java:70)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.corba.ee.impl.io.IIOPOutputStream.(IIOPOutputStream.java:66)
... 47 more

Can somebody help me.

TIA

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
chiss
Offline
Joined: 2004-04-14

> If I could reproduce the problem under build 41d then
> my next step would be to try the same tests on the
> latest build anyway. I have still not had the chance
> to get an example that fails on my end, so I'm hoping
> since you have a working (which is to say "failing")
> example on your system I could impose on you to try
> your example with build 50.

Are you saying you tried my zipped project (attached to the issue you opened) on b41d and could not reproduce the problem, or that you didn't have the time? I think you mean the later, just want to be sure. 2 collegues of mine have the same problem I reported (which is why I dismissed the option "the problem is sitting in the chair" ;-) )

tjquinn
Offline
Joined: 2005-03-30

Hi, Francis.

It's choice 2 - I haven't been able to take the time yet. The difficulty is, I think, that the app depends on some resources (a connection pool?) that I do not have defined. I have not taken the time to go through the app to set up what's missing, so the app does not deploy so I have not been able to try launching the client.

If by any chance you could send me (or post with the issue) the asadmin commands you used to create the definitions that would certainly help me. It would also make sure I'm testing exactly the same set-up that you are seeing.

Also, I don't think I asked this yet... Do you see the same failures if you deploy the app and retrieve the generated app client JAR file

asadmin deploy --retrieve

and then launch the app client using

appclient -client

Knowing if the problem is only related to Java Web Start launches or all launches helps to narrow down the possible causes.

Thanks.

- Tim

Message was edited by: tjquinn to ask about using appclient

chiss
Offline
Joined: 2004-04-14

Hi Tim,

Good point about the connection pool, sorry about that. It's just a simple Derby connection to persist the "Role" pojo. But thinking about it, The "InitialContext creation" problem shouldn't depend on the presence of the EJB, so maybe you can just delete that @Entity from the project, or even take out the whole EJB project altogether from the EAR, and try again. I'll do it too on my end monday morning.

About the app-client startup option, I did try that, but not how you described it; I'm lazy, so I just clicked "Download client stubs" from the admin web page, downloaded the jar and then typed appclient -cllient . I assume this does the same as you asked? Anyway, yes, I tried that, and there's no permission problems at all.

Francis

ljnelson
Offline
Joined: 2003-08-04

Francis, something about this sounds similar to something I experienced, and traced back to pilot error.

In general, the CORBA machinery [i]really[/i] obscures errors. See, for example, my trials at http://forums.java.net/jive/thread.jspa?messageID=203947&#203947. You'll note the same permission issues (these are side effects). In my case, a runtime exception (a MissingResourceException) was preventing a class from being initialized, which resulted in CORBA spew much like the stuff you're showing here.

Best,
Laird

chiss
Offline
Joined: 2004-04-14

Hi Laird, thanks for chiming in.

My first reaction too was that it must have been an error on our side, but the problem was that everything worked as expected when downloading the client stubs and launching the app using the appclient script...

So anyway, here are my latest discoveries:

-> This morning, downloaded the b50 build and deployed my test project on it. It complained about a missing JDBC connection pool (oops, forgot to define it in the project...was working on my b41d since the ressources had been defined 'by hand'). So I created 2 .sun-resource files and it deployed ok (Tim, I attached these 2 files to the issue 3144 in case you want to have a look, you then just have to create a db in Derby, called 'jlc'). Conclusion of the test : everything works as expected with b50 ! Excellent!

-> Just as a sanity check, I redeployed my test app (it's an EAR, by the way) on my b41d (since I added the 2 files to the project, I felt it was the right thing to do), and......eh? IT WORKED TOO !

-> Now I was confused... The only thing that changed on that PC is that it was rebooted over the weekend...and the b50 installation of course. But it really was b41d running! So I asked my 2 collegues to redeploy their apps showing the problem to my b41d, and I could launch their app no problem (read, I'm starting their app from my machine running the b41d GlassFish, so everything is running from the same PC). I was even more confused, so I asked them to try it from their PC (i.e. they both accessed my GlassFish b41d from the admin web page and clicked "Launch" to start the app-client; they both have JDK1.6). Same security error as before.

-> So I then shutdown my b41d and started b50 and asked them to deploy their apps to my machine. Again, I have no problem launching it from my machine, but fortunately, IT ALSO WORKS from their own PC. No Security error whatsoever!

So we're going to continue working with b50, but I'm really curious about what the problem was..

Tim, your call; you must be really busy with other issues, so maybe it's not worth working on that anymore, since the problem "dissapeared" somewhere between b41d and b50. Then again, understanding the "why" might help in related issues in the future..as I said, your call.

Vimal, can you also try your code on the latest Glassfish build? I'd like to know if it's just our setup here that is causing this work/doesn't work behavior ...

Francis

tjquinn
Offline
Joined: 2005-03-30

Hi, again, Francis.

Thanks for the thorough follow-up.

I'm glad to hear that b50 seems to have cleared up this problem. Like you, I would like to understand the underlying cause but there are a few other things on my to-do list, as I'm sure there are on yours as well after all the very fruitful detective work you have done on this. My suspicion is that the ORB integration may have taken care of whatever the root cause was.

Considering that this is working now under build 50, I'm planning to close Issue 3144, and I'm going to paste your notes from here into the notes for the issue to help explain. I'm going to keep this on my separate to-do list, though, because I would like to come back and understand what the problem was and what the solution turned out to be.

Thanks again for using the feature and for the really helpful investigative work on your end.

Vimal, I strongly echo Francis's suggestion that you try your app with build 50 to make sure that more recent build takes care of the problem for you as well.

- Tim

vladperl
Offline
Joined: 2004-08-11

Hi Tim,

> Considering that this is working now under build 50,
> I'm planning to close Issue 3144, and I'm going to
> paste your notes from here into the notes for the
> issue to help explain. I'm going to keep this on my
> separate to-do list, though, because I would like to
> come back and understand what the problem was and
> what the solution turned out to be.

This is a good idea because there is still something wrong with the build 50.
I have couple of different issues but seems somehow it could be connected to issues described in this thread. Especially the most important clue related to the situation when bean suddenly started work after redeployment the glassfish b41.
My bean worked only when I tried hard to do actions like restarting glassfish (build 49) redeploying application or restarting application. After switching to build 50 it started work fine. So I believe something was very wrong in the build 49.
I didn't have issue with security but I got message "server unknown" and I believe it pointed to data server. By the way my coworker had issue with security on the same project that worked fine on my computer. Only difference between our systems was that he has some folder with name that include russian letters.

Regarding build 50 I have at least two issues.
1)When I added new method to my stateless bean and made redeployment of the application I got error:
"Could not find method void persist(java.lang.Object) in class com.medenterprise.app.patientrecord.session._PatientRecordRemote_Remote]"
2)I can't get access to my bean directly from netbeans module.
I used instruction how to do it from this link:
http://wiki.netbeans.org/wiki/view/DevFaqCallEjbFromNbm

My environment:
glassfish b51
jdk 1.6.0_01
netbeans 5.5.1

To reproduce the first issue just redeploy the application with additional method of the ejb that declare the method in the remote interface.
I can send my simple project only problem is that it using mysql server.
If you wish I could also create for test purposes the simplest project with derby db to demonstrate the issue. By the way it's good idea to have always available from your side simple project that using JPA, stateless bean and application client. This way developers could try to reproduce the problems on your test oriented project.

Thank you,
Vladimir

vladperl
Offline
Joined: 2004-08-11

>To reproduce the first issue just redeploy the application with additional method of the ejb that declare the method in the remote interface.

Using redeployment functionality from glassfish console fixed the first issue.
Seems netbeans 5.5.1 doesn't clean something when redeploy application client that using EJB.
But I still can't get access to my ejb bean directly from netbeans module.
If somebody has working example with this functionality please send me it on address: vladperl at hotmail com

chiss
Offline
Joined: 2004-04-14

Jun 7, 2007 10:45:14 AM com.sun.enterprise.appclient.MainWithModuleSupport prepareSecurity
INFO: Security Manager is ON.
Jun 7, 2007 10:45:17 AM com.sun.enterprise.appclient.MainWithModuleSupport setTargetServerProperties
INFO: ACC001:Using ClientContainer file: [C:\DOCUME~1\PERREA~1.F4\LOCALS~1\Temp\sunacc18326.xml].
Jun 7, 2007 10:45:17 AM com.sun.enterprise.appclient.MainWithModuleSupport setTargetServerProperties
WARNING: ACC023:The best practice in case of appclients is to set the endpoints as elements in sun-acc.xml. Please avoid using the com.sun.appserv.iiop.endpoints property for appclients.
Jun 7, 2007 10:45:17 AM com.sun.enterprise.appclient.MainWithModuleSupport setupIIOP
INFO: ACC014: ORB host name: [localhost]
Jun 7, 2007 10:45:17 AM com.sun.enterprise.appclient.MainWithModuleSupport setupIIOP
INFO: ACC013: ORB port number: [3700]
Jun 7, 2007 10:45:21 AM com.sun.enterprise.appclient.MainWithModuleSupport loadMainClientClass
INFO: ACC009: Load Application Class: [com.cae.ssg.NewJFrame]
Jun 7, 2007 10:45:21 AM com.sun.enterprise.appclient.MainWithModuleSupport
INFO: Application main() returned; GUI elements may be continuing to run

[b](here we go, clicking on my test button)[/b]
Exception in thread "AWT-EventQueue-0" java.lang.ExceptionInInitializerError
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at com.sun.naming.internal.VersionHelper12.loadClass(Unknown Source)
at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)
at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
at javax.naming.InitialContext.init(Unknown Source)
at javax.naming.InitialContext.(Unknown Source)
at com.cae.ssg.NewJFrame.test3ButtonActionPerformed(NewJFrame.java:75)
at com.cae.ssg.NewJFrame.access$200(NewJFrame.java:18)
at com.cae.ssg.NewJFrame$3.actionPerformed(NewJFrame.java:62)
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
Caused by: java.security.AccessControlException: access denied (java.util.PropertyPermission org.omg.CORBA.ORBClass read)
at java.security.AccessControlContext.checkPermission(Unknown Source)
at java.security.AccessController.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkPropertyAccess(Unknown Source)
at java.lang.System.getProperty(Unknown Source)
at com.sun.enterprise.util.ORBManager$1.run(ORBManager.java:369)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.enterprise.util.ORBManager.setORBSystemProperties(ORBManager.java:366)
at com.sun.enterprise.naming.SerialInitContextFactory.(SerialInitContextFactory.java:56)
... 35 more

[b]Oh, and I forgot to say this in my previous post:[/b]
When I try to create an [b]InitialContext a second time[/b], I get a different exception, a ClassNotFoundException...sorry I don't have that stack trace right now, but it's easily reproducible with the project I'm going to attach to the issue in a few seconds...

Let's hope we can nail this one, you guys are doing something really great with Glassfish. Forums are usually where people just ask questions or complain, here's a compliment for a change. ;-)

Francis

tjquinn
Offline
Joined: 2005-03-30

Vimal, it would be helpful if you could let us know which build of GlassFish you are using and what JDK you have.

Francis,

You mentioned you are using build 41d (which is the latest milestone on the beta 2 branch). Is there any chance you could try this with the latest build, build 50? The problem is being reported from the ORB code and I know there has been a recent integration of the ORB code (recent since build 41d).

If I could reproduce the problem under build 41d then my next step would be to try the same tests on the latest build anyway. I have still not had the chance to get an example that fails on my end, so I'm hoping since you have a working (which is to say "failing") example on your system I could impose on you to try your example with build 50.

Thanks.

- Tim

chiss
Offline
Joined: 2004-04-14

All right, will try that monday morning. Still haven't had the chance to try my setup on a machine running b41d under JDK 1.5.. As luck would have it, they took that machine away just before I finished my series of test..Oh well, I'll try to find another one if I still get the problem on b50.

Francis

chiss
Offline
Joined: 2004-04-14

Jun 7, 2007 9:52:37 AM com.sun.enterprise.appclient.MainWithModuleSupport prepareSecurity
INFO: Security Manager is ON.
Jun 7, 2007 9:52:40 AM com.sun.enterprise.appclient.MainWithModuleSupport setTargetServerProperties
INFO: ACC001:Using ClientContainer file: [C:\DOCUME~1\CHAPLE~1\LOCALS~1\Temp\sunacc36558.xml].
Jun 7, 2007 9:52:41 AM com.sun.enterprise.appclient.MainWithModuleSupport setTargetServerProperties
WARNING: ACC023:The best practice in case of appclients is to set the endpoints as elements in sun-acc.xml. Please avoid using the com.sun.appserv.iiop.endpoints property for appclients.
Jun 7, 2007 9:52:41 AM com.sun.enterprise.appclient.MainWithModuleSupport setupIIOP
INFO: ACC014: ORB host name: [pc6380]
Jun 7, 2007 9:52:41 AM com.sun.enterprise.appclient.MainWithModuleSupport setupIIOP
INFO: ACC013: ORB port number: [3700]
Jun 7, 2007 9:52:55 AM com.sun.enterprise.appclient.MainWithModuleSupport loadMainClientClass
INFO: ACC009: Load Application Class: [com.cae.ssg.NewJFrame]
Jun 7, 2007 9:52:56 AM com.sun.enterprise.appclient.MainWithModuleSupport
INFO: Application main() returned; GUI elements may be continuing to run

[b](This is me trying to see if the injection worked)[/b]
EJB is com.cae.ssg._BlinerServiceRemote_Wrapper@ad8e6a44

[b](and here we go, the exception we're talking about, but notice that it's slightly different)[/b]
Exception in thread "AWT-EventQueue-0" java.lang.ClassCastException: com.sun.corba.ee.impl.io.IIOPOutputStream
at com.sun.corba.ee.impl.io.ValueHandlerImpl.createOutputStream(ValueHandlerImpl.java:794)
at com.sun.corba.ee.impl.io.ValueHandlerImpl.writeValueWithVersion(ValueHandlerImpl.java:198)
at com.sun.corba.ee.impl.io.ValueHandlerImpl.writeValue(ValueHandlerImpl.java:146)
at com.sun.corba.ee.impl.encoding.CDROutputStream_1_0.writeRMIIIOPValueType(CDROutputStream_1_0.java:793)
at com.sun.corba.ee.impl.encoding.CDROutputStream_1_0.write_value(CDROutputStream_1_0.java:876)
at com.sun.corba.ee.impl.encoding.CDROutputStream_1_0.write_value(CDROutputStream_1_0.java:890)
at com.sun.corba.ee.impl.encoding.CDROutputStream_1_0.write_value(CDROutputStream_1_0.java:649)
at com.sun.corba.ee.impl.encoding.CDROutputStream.write_value(CDROutputStream.java:245)
at com.sun.corba.ee.impl.presentation.rmi.DynamicMethodMarshallerImpl$14.write(DynamicMethodMarshallerImpl.java:347)
at com.sun.corba.ee.impl.presentation.rmi.DynamicMethodMarshallerImpl.writeArguments(DynamicMethodMarshallerImpl.java:420)
at com.sun.corba.ee.impl.presentation.rmi.StubInvocationHandlerImpl.privateInvoke(StubInvocationHandlerImpl.java:161)
at com.sun.corba.ee.impl.presentation.rmi.StubInvocationHandlerImpl.invoke(StubInvocationHandlerImpl.java:123)
at com.sun.corba.ee.impl.presentation.rmi.bcel.BCELStubBase.invoke(BCELStubBase.java:196)
at com.cae.ssg.__BlinerServiceRemote_Remote_DynamicStub.merge(__BlinerServiceRemote_Remote_DynamicStub.java)
at com.cae.ssg._BlinerServiceRemote_Wrapper.merge(com.cae.ssg._BlinerServiceRemote_Wrapper.java)
at com.cae.ssg.NewJFrame.test1ButtonActionPerformed(NewJFrame.java:67)
at com.cae.ssg.NewJFrame.access$000(NewJFrame.java:15)
at com.cae.ssg.NewJFrame$1.actionPerformed(NewJFrame.java:40)
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)

chiss
Offline
Joined: 2004-04-14

Hello Tim,

I haven't finished with my investigations, but here's what I have so far:

Glassfish b41d running with JDK 1.6, projects compiled with 1.5 JDK and executed with WebStart 1.6
-> The webstart-ed app-client can't access a remote method that has a complex argument (in my case, that method takes a pojo to be persisted and returns void).
->...but no problem accessing a method that has no argument and returns void (confirmed that my code gets executed on the server side, a simple System.out.println in Glassfish's log)
->...and can't even create an InitialContext to perform a lookup!

From a machine having JRE 1.5.0_06:
->Same problem with the complex method, although the stack trace is slightly different
->No problem with the no-arg method either
->...and no problem creating an Initial Context (although I haven't tried to use that context)!!!

A collegue has just tried to play with the server.policy in the domain config directory, no visible effects.

My next step is to find a machine with the JDK 1.5.0 and have it run Glassfish b41d. I will try to attach my logs and my zipped projects (they are really dummies but show the problems) to the issue you mentionned and/or this forum message, although as I'm writing this I don't see any "attach file" button...although I have seen another post with a text file attached.

Francis

chiss
Offline
Joined: 2004-04-14

Jun 7, 2007 9:38:11 AM com.sun.enterprise.appclient.MainWithModuleSupport prepareSecurity
INFO: Security Manager is ON.
Jun 7, 2007 9:38:11 AM com.sun.enterprise.appclient.MainWithModuleSupport setTargetServerProperties
INFO: ACC001:Using ClientContainer file: [C:\DOCUME~1\PERREA~1.F4\LOCALS~1\Temp\sunacc15952.xml].
Jun 7, 2007 9:38:11 AM com.sun.enterprise.appclient.MainWithModuleSupport setTargetServerProperties
WARNING: ACC023:The best practice in case of appclients is to set the endpoints as elements in sun-acc.xml. Please avoid using the com.sun.appserv.iiop.endpoints property for appclients.
Jun 7, 2007 9:38:11 AM com.sun.enterprise.appclient.MainWithModuleSupport setupIIOP
INFO: ACC014: ORB host name: [localhost]
Jun 7, 2007 9:38:11 AM com.sun.enterprise.appclient.MainWithModuleSupport setupIIOP
INFO: ACC013: ORB port number: [3700]
Jun 7, 2007 9:38:17 AM com.sun.enterprise.appclient.MainWithModuleSupport loadMainClientClass
INFO: ACC009: Load Application Class: [com.cae.ssg.NewJFrame]
Jun 7, 2007 9:38:17 AM com.sun.enterprise.appclient.MainWithModuleSupport
INFO: Application main() returned; GUI elements may be continuing to run

[b](This is me trying to see if the injection worked)[/b]
EJB is com.cae.ssg._BlinerServiceRemote_Wrapper@ad8e6a44

[b](and here we go, the exception we're talking about)[/b]
Exception in thread "AWT-EventQueue-0" java.lang.InternalError: Error loading com.sun.corba.ee.impl.io.IIOPOutputStream
at com.sun.corba.ee.impl.io.ValueHandlerImpl$StreamFactory.run(ValueHandlerImpl.java:838)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.corba.ee.impl.io.ValueHandlerImpl.createOutputStream(ValueHandlerImpl.java:794)
at com.sun.corba.ee.impl.io.ValueHandlerImpl.writeValueWithVersion(ValueHandlerImpl.java:198)
at com.sun.corba.ee.impl.io.ValueHandlerImpl.writeValue(ValueHandlerImpl.java:146)
at com.sun.corba.ee.impl.encoding.CDROutputStream_1_0.writeRMIIIOPValueType(CDROutputStream_1_0.java:793)
at com.sun.corba.ee.impl.encoding.CDROutputStream_1_0.write_value(CDROutputStream_1_0.java:876)
at com.sun.corba.ee.impl.encoding.CDROutputStream_1_0.write_value(CDROutputStream_1_0.java:890)
at com.sun.corba.ee.impl.encoding.CDROutputStream_1_0.write_value(CDROutputStream_1_0.java:649)
at com.sun.corba.ee.impl.encoding.CDROutputStream.write_value(CDROutputStream.java:245)
at com.sun.corba.ee.impl.presentation.rmi.DynamicMethodMarshallerImpl$14.write(DynamicMethodMarshallerImpl.java:347)
at com.sun.corba.ee.impl.presentation.rmi.DynamicMethodMarshallerImpl.writeArguments(DynamicMethodMarshallerImpl.java:420)
at com.sun.corba.ee.impl.presentation.rmi.StubInvocationHandlerImpl.privateInvoke(StubInvocationHandlerImpl.java:161)
at com.sun.corba.ee.impl.presentation.rmi.StubInvocationHandlerImpl.invoke(StubInvocationHandlerImpl.java:123)
at com.sun.corba.ee.impl.presentation.rmi.bcel.BCELStubBase.invoke(BCELStubBase.java:196)
at com.cae.ssg.__BlinerServiceRemote_Remote_DynamicStub.merge(__BlinerServiceRemote_Remote_DynamicStub.java)
at com.cae.ssg._BlinerServiceRemote_Wrapper.merge(com.cae.ssg._BlinerServiceRemote_Wrapper.java)
at com.cae.ssg.NewJFrame.test1ButtonActionPerformed(NewJFrame.java:67)
at com.cae.ssg.NewJFrame.access$000(NewJFrame.java:15)
at com.cae.ssg.NewJFrame$1.actionPerformed(NewJFrame.java:40)
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
Caused by: java.lang.ExceptionInInitializerError
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at java.lang.Class.newInstance0(Unknown Source)
at java.lang.Class.newInstance(Unknown Source)
at com.sun.corba.ee.impl.io.ValueHandlerImpl$StreamFactory.run(ValueHandlerImpl.java:836)
... 44 more
Caused by: java.security.AccessControlException: access denied (java.lang.RuntimePermission accessClassInPackage.sun.corba)
at java.security.AccessControlContext.checkPermission(Unknown Source)
at java.security.AccessController.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkPackageAccess(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
at com.sun.corba.ee.impl.io.IIOPOutputStream$1.run(IIOPOutputStream.java:70)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.corba.ee.impl.io.IIOPOutputStream.(IIOPOutputStream.java:66)
... 51 more

Dennis Gesker

Hi Tim:

I've sent follow-up email as instructed.

Dennis

On 6/6/07, glassfish@javadesktop.org wrote:
>
> Hi, Dennis.
>
> Sorry this isn't working for you, either.
>
> Thanks for reporting the GlassFish build and JDK versions you are using.
>
> I have several questions for you (and Vimal)...
>
> Is your EAR small enough that you could e-mail it to me or point me to it
> so I could try it here to see if I can reproduce it? I realize that's not
> always possible for any number of reasons, but it's worth asking. You can
> e-mail me at tjquinn a-t dev d-o-t java d-o-t net.
>
> Do you use injection to get references to the remote EJBs or do you use
> explicit naming look-ups?
>
> Did this work for you in earlier builds of GlassFish with the other
> variables being the same (platform, JDK release, etc.)?
>
> Have you happened to try this with JDK 5 instead of 6?
>
> Also, if you look at either the doc or the blog entry I pointed Vimal to
> you can turn on Java Web Start tracing. This creates a trace file when any
> Java Web Start app runs that contains any System.out and System.errcontents. Please turn tracing (not logging) on and post that or send it to
> me as well.
>
> - Tim
> [Message sent by forum member 'tjquinn' (tjquinn)]
>
> http://forums.java.net/jive/thread.jspa?messageID=220836
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
> For additional commands, e-mail: users-help@glassfish.dev.java.net
>
>

--
Dennis R. Gesker
email: dennis@gesker.com
Key Id: 0xEFA10A51
First things first, but not necessarily in that order. -- Unknown
[att1.html]

vimalkansal
Offline
Joined: 2004-03-23

It appears that Glassfish signs the appclient jar automatically as per the following statement, which I reproduce from the article at http://java.sun.com/developer/technicalArticles/J2EE/jws-glassfish/part4...

[b]Auto-signed and Manually Signed JARs[/b]

Some of the GlassFish ACC code needs elevated permissions. In addition, some of the code triggered by your client code – such as code to communicate with an EJB on the back-end server – also needs elevated permissions. This is true whether you launch using the appclient command or the Java Web Start support. What is different is that, as we have just seen, the Java Web Start security rules require that code with elevated permissions be signed in order to run.

The GlassFish app server automatically signs the appserv-jwsacc.jar file that runs the ACC during a Java Web Start launch. When an end user uses Java Web Start software to launch an application client, the GlassFish server signs the generated application client JAR file for that application client, if it has not already done so. In both cases, the GlassFish server uses a self-signed certificate that it generates during creation of a GlassFish domain.

Your end users might not trust the self-signed GlassFish certificate. You can provide signed copies of these files yourself, using your own certificate, in which case the GlassFish server serves those files instead. You can sign the appserv-jwsacc.jar file any time after you have completed the GlassFish installation. Sign the generated application client JAR file any time after you have deployed the application that contains the application client. The GlassFish app server does not overwrite your signed files unless you redeploy the application, in which case you can simply sign the new generated application client JAR.

tjquinn
Offline
Joined: 2005-03-30

Hi, Vimal.

Just to confirm, you are using the built-in support for Java Web Start in GlassFish, correct?

One thing that might help is if you could post the entire console log output from the Java Web Start launch. You can turn on Java Web Start tracing which will capture all that output to a file. (This blog entry describes how to do that: http://blogs.sun.com/quinn/entry/launch_that_app_client .)

As you point out, GlassFish should be taking care of permissions for the code in the app client or any JARs in the EAR that the app client uses. There is no need to add any logic to the NetBeans build.xml to sign the JAR yourself if you are using the automatic GlassFish support.

- Tim

Dennis Gesker

Hello Tim:

Not to piggy back on Vimal's issue but I think I'm experiencing a similar
issue.

I'm able to deploy (using nb6m9/jdk6u1/winXP) an enterprise application to
glassfish (b49/jdk6/linux) that contains a client-app. The client app
launches just fine at first via a link in the web-module.

However, when I attempt to utilize a remote session bean contained in the
ejb-module from the client-app the jws process starts and it appears to
download the app but the app ultimately does not launch. Nothing gets
reported in the console of the app server (I'm running the app server on
linux using asadmin start-domain --verbose so I can see the log output) and
jws does not complain. The launch process just seems to stop.

The issue seems very close to that reported by Vimal except I'm not seeing
any errors reported.

Any recommendation on where I might look to solve the issue?

Dennis

On 6/6/07, glassfish@javadesktop.org wrote:
>
> Hi, Vimal.
>
> Just to confirm, you are using the built-in support for Java Web Start in
> GlassFish, correct?
>
> One thing that might help is if you could post the entire console log
> output from the Java Web Start launch. You can turn on Java Web Start
> tracing which will capture all that output to a file. (This blog entry
> describes how to do that:
> http://blogs.sun.com/quinn/entry/launch_that_app_client .)
>
> As you point out, GlassFish should be taking care of permissions for the
> code in the app client or any JARs in the EAR that the app client uses.
>
> - Tim
> [Message sent by forum member 'tjquinn' (tjquinn)]
>
> http://forums.java.net/jive/thread.jspa?messageID=220772
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
> For additional commands, e-mail: users-help@glassfish.dev.java.net
>
>

--
Dennis R. Gesker
email: dennis@gesker.com
Key Id: 0xEFA10A51
First things first, but not necessarily in that order. -- Unknown
[att1.html]

tjquinn
Offline
Joined: 2005-03-30

Hi, Dennis.

Sorry this isn't working for you, either.

Thanks for reporting the GlassFish build and JDK versions you are using.

I have several questions for you (and Vimal)...

Is your EAR small enough that you could e-mail it to me or point me to it so I could try it here to see if I can reproduce it? I realize that's not always possible for any number of reasons, but it's worth asking. You can e-mail me at tjquinn a-t dev d-o-t java d-o-t net.

Do you use injection to get references to the remote EJBs or do you use explicit naming look-ups?

Did this work for you in earlier builds of GlassFish with the other variables being the same (platform, JDK release, etc.)?

Have you happened to try this with JDK 5 instead of 6?

Also, if you look at either the doc or the blog entry I pointed Vimal to you can turn on Java Web Start tracing. This creates a trace file when any Java Web Start app runs that contains any System.out and System.err contents. Please turn tracing (not logging) on and post that or send it to me as well.

- Tim

tjquinn
Offline
Joined: 2005-03-30

Oh, one other bit of information that will help with the diagnosis...

Can you try this experiment? Using the information from NetBeans as to where it builds the EAR, please deploy it yourself using

asadmin deploy --retrieve

(This deploys the app and also retrieves the augmented app client JAR file.)

Then launch the app client using the appclient script:

appclient --client

and please let us know whether that works or not.

The appclient and Java Web Start launch code paths are largely the same but there are some differences and it helps to know the outcome in each scenario.

Thanks.

- Tim

Dennis Gesker

Using the command line as instructed the app-client also fails but the
errors displayed are a bit different...

Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError:
com/alamon/wrap/SimpleUIElement
at com.alamon.client.model.EmployeeComboBoxModel.(
EmployeeComboBoxModel.java:37)
at ea.NewJFrame.initComponents(NewJFrame.java:39)
at ea.NewJFrame.(NewJFrame.java:17)
at ea.NewJFrame$2.run(NewJFrame.java:105)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
at java.awt.EventDispatchThread.pumpOneEventForFilters(
EventDispatchThread.java:273)
at java.awt.EventDispatchThread.pumpEventsForFilter(
EventDispatchThread.java:183)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(
EventDispatchThread.java:173)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java
:168)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java
:160)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)

On 6/6/07, glassfish@javadesktop.org wrote:
>
> Oh, one other bit of information that will help with the diagnosis...
>
> Can you try this experiment? Using the information from NetBeans as to
> where it builds the EAR, please deploy it yourself using
>
> asadmin deploy --retrieve
>
> (This deploys the app and also retrieves the augmented app client JAR
> file.)
>
> Then launch the app client using the appclient script:
>
> appclient --client
>
> and please let us know whether that works or not.
>
>
> The appclient and Java Web Start launch code paths are largely the same
> but there are some differences and it helps to know the outcome in each
> scenario.
>
> Thanks.
>
> - Tim
> [Message sent by forum member 'tjquinn' (tjquinn)]
>
> http://forums.java.net/jive/thread.jspa?messageID=220854
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
> For additional commands, e-mail: users-help@glassfish.dev.java.net
>
>

--
Dennis R. Gesker
email: dennis@gesker.com
Key Id: 0xEFA10A51
First things first, but not necessarily in that order. -- Unknown
[att1.html]

tjquinn
Offline
Joined: 2005-03-30

I am downloading Dennis's example and will see what happens why I try it on my system. I think that's probably the most productive way to proceed.

Stay tuned.

- Tim

chiss
Offline
Joined: 2004-04-14

Hello everyone,

I'm having the same exception trying to access an injected EJB using a Web-started app client. Using the appclient -client script works ok, but using the generated jnlp file gives me that internal error/security exception. My setup is :

->glassfish b41d
->JDK 1.6.0 update 1
-> Win2k

Everything worked fine with Netbeans 5.5, b24 and JDK 1.5.0 on Win2k. While technically it's not the same app-client (we did one last winter), we just recently decided to upgrade everything (NetBeans 5.5.1, JDK 1.6 and Glassfish b41d) and we just started a new project using an app-client and got that error.

Today, a colleague of mine got a partial success with one EJB that worked and one that did not (in the same app-client). I haven't had the time to investigate, but at first glance the one that works is using primitive arguments/return value (strings), while the one that doesn't uses entities (EJB3 pojos).

At first I thought it was because the project was originally created in Netbeans 5.5, so I started a very basic one in 5.5.1, still the same exception. Thinking it was the injection that didn't work, we put some System.out.println() and found that the injection works ok, but accessing the method throws the security exception. Even trying to create an InitialContext to do the classic lookup throws the security exception. Again, starting the app-client using the appclient -client script works ok. Looking at the log, there's a warning just a few lines before about using the IIOP end point (or something like that, I'm at home and don't remember the message), and something about or something like that...is this related at all?

Anyway, we're about to test the same app-client on a clean machine with JDK 1.5.0 to see if the problem is with JDK 1.6 or with b41d. I'll keep you posted with anything I find that could be useful.

Bye!

Francis Perreault

tjquinn
Offline
Joined: 2005-03-30

Hello, Francis.

Thank you for the detailed information and I'll be very interested to see what results you have with your next experiments. There are some differences in how the app client container has to work with Java SE 1.5 as compared with 1.6 so your results will be significant.

Would you be able and willing to send me a zip of your NetBeans project directory so that I could debug this further on systems here? (You could omit the build and dist directories to keep the file smaller.) If so, please send it to me at tjquinn a-t dev d-o-t java d-o-t net. I would very much appreciate it, because the key differences may be not only that POJOs (and not primitives) are passed but whether they are POJOs from the app client or from a Java library.

Thank you again.

- Tim

vimalkansal
Offline
Joined: 2004-03-23

Hi,

I will also be sending zip of my netbeans prject, if that is ok.

Vimal

tjquinn
Offline
Joined: 2005-03-30

Vimal, that would be fine. Having three or four example projects or apps will help make sure that we understand the scope of the problem and, if it's a GlassFish problem, fix it so all examples work.

If any of you who are sending projects have are any set-up steps required - resources, users, etc. - please let me know those when you send the zip of the project.

I have opened issue 3144 (https://glassfish.dev.java.net/issues/show_bug.cgi?id=3144) to track this problem. If you can, please attach your projects to that issue. If you would prefer not to publish them so widely, of course feel free to e-mail them to me instead.

Thanks.

- Tim

tjquinn
Offline
Joined: 2005-03-30

Vimal,

Please post which build of GlassFish you are using and what release of the Java SE JDK you are using.

Thanks.

- Tim

mbazs
Offline
Joined: 2005-12-17

Did you sign the appclient with 'jarsigner'?

When it wasn't signed, it did the same for me.

vimalkansal
Offline
Joined: 2004-03-23

No I did not. I am deploying the ear file (which has the appclient inside it) from within the Nebeans 6.0. I wonder how do I do it from within the Nebeans?

Vimal

mbazs
Offline
Joined: 2005-12-17

I've appended this target at the end of the enterprise application's build.xml:


resolveexecutable="true" failonerror="true" ignoremissing="false">



sign.bat:
jarsigner -keystore -storetype -storepass -keypass
%1

Ant will insert the EAR filename to %1.

You'll have to create a keystore, which contains a certificate and private key. You can create a fake one, as I know, but I use a real certificate-key pair.