users@glassfish.java.net

RE: AppClient/JWS/Derby/Security problems

From: Martin, Ray <armart3_at_tycho.ncsc.mil>
Date: Fri, 13 Oct 2006 15:26:42 -0400

Hello, Mr. Quinn,
 
Yes, immediately following your request on 9/26, 2:58, i was able to get
together the requested information and returned a reply at 3:16, 9/26. Are
you able to find that email or should i send it again? There was four
attachments to the email that i sent on 9/26 at 3:16. i received a copy of
the email from the mail list causing me to believe that the attachments had
made their way through the system.
 
Doing some searches - I cannot find my reply of 9/26, 3:16 on Nabble - so,
maybe it did not make it.

-----Original Message-----
From: Timothy.Quinn_at_Sun.COM [mailto:Timothy.Quinn_at_Sun.COM]
Sent: Friday, October 13, 2006 3:08 PM
To: users_at_glassfish.dev.java.net
Subject: Re: AppClient/JWS/Derby/Security problems


Hi, Ray.

In my last note I'd asked if you could confirm a couple of things and send
along, just so I'm sure I'm looking at the latest, the trace output.

If you sent those I guess I missed them.


So to make sure I recall correctly, at this point are you adding derby.jar
to your application in the same way you are adding pastry.jar? And the only
thing that is not working at this point is adding persistence into the mix
and launching that from Java Web Start?

Can you - once more - send along the error messages and stack trace you get
during the attempted Java Web Start launch?



- Tim

Martin, Ray wrote:

Hello,
 
What is the status of runnin' appclient/JWS/Derby?
 
Is there an answer or is it time to fold the cards and go home?
 
thanx,
Ray

-----Original Message-----
From: Timothy.Quinn_at_Sun.COM <mailto:Timothy.Quinn_at_Sun.COM> [
mailto:Timothy.Quinn_at_Sun.COM <mailto:Timothy.Quinn_at_Sun.COM> ]
Sent: Tuesday, September 26, 2006 2:17 PM
To: users_at_glassfish.dev.java.net <mailto:users_at_glassfish.dev.java.net>
Subject: Re: AppClient/JWS/Derby/Security problems


Hi, Martin.

Martin, Ray wrote:

First, I need to apologize. You are gonna get a little frustrated with my
stupidity.
 
I don't know what an 'app client jar' is.
 
My understanding is that I create a J2SE application that I want to run on
the client's desktop. I can go around and load every user's desktop with
this desktop application. And so far this is not an 'app client' - just a
desktop application. Then I say this is too cumbersome going around loading
everyone's desktop. And I say "ah, look. If I deploy this desktop
application to Glassfish and select the Java Web Start checkbox, I will get
out of the business of loading every user's machine with my application".
My understanding is that at the point in time when I deploy to Glassfish,
the application now becomes an 'app client'. But, I had not read anywhere
(or, if I did, it totally went over my head) that I needed to do anything
but deploy my application to Glassfish (I use the admin console at port 4848
and choose App Client Modules). So, this is the way that I have been
running for months. After having done a "Clean and Build" in Netbeans, I
use the Glassfish console and I select (using the browse button) the jar
file from the dist directory that Netbeans has created.

I may have added unnecessarily to the confusion. Yes, what you are doing
works.



 
When you say, "...reran my very simple test in which I bundled a JAR into an
app client JAR, ..." - I do not know what 'bundled' means - this is very
embarrassing and I had to scrape deep to admit this.

Just different words to describe what you describe below about including an
additional JAR into the application's JAR.


 
The only thing that I know how to do is include third party jar files into
my application jar file using build.xml. I need pastry.jar (along with
others) for the application to run. I just went and verified that I had not
inadvertently placed pastry.jar into Glassfish's lib directory. So, after
deploying the desktop application to Glassfish, I go to a web page, poke the
hyperlink, Java Web Start whirs, the application is visible on the client's
desktop. If I go to a second machine, get to the same web page, poke the
hyperlink, Java Web Start does its thing, the application is visible on the
second machine. On both machine's using the desktop application, I select
my ChatAddon, and I can communicate between the two instances of the
application.

Do your build.xml customizations add the pastry.jar to the application JAR
so that its path as stored in the application JAR is lib/pastry.jar? (I
suspect strongly that the answer is yes but I want to verify that.)


 
In my small understanding, I never created an app client jar. In my
understanding, Glassfish provides an 'App Client container' - which I have
come to think of in some way as a Spring container or a JADE container.
But, I never do anything special. My understanding was that I merely
plunked my desktop application into Glassfish, the magic happens, and I run
my application from any machine on the network. And this is exactly what
happened for me on the Chat thingie. After the magic of Glassfish, I could
chat between several machines (using my app) - and some of those machines
(certainly not including my development machine) have never had this code
loaded- which said to me that pastry.jar was available because it was
contained in the application jar file.

Yes, I agree. The key is that the extra JAR must not only be present in the
application JAR but the manifest must also refer to it in the Class-Path
attribute using the correct path. My NetBeans (5.5 beta 2) added a
Class-Path entry for my extra JAR as lib/extra.jar. In my earlier
experiments my extra.jar was added at the "top level" of the application
JAR. I made sure that it was added to the app JAR as lib/extra.jar and my
test was able to load resources from that extra.jar.


 
Everything is going gggreat - then I add persistence - and things go
downhill from there. Don't forget that you guys have gotten me past all
roadblocks to the point where running appclient from the commandline is also
gggreat including persistence.

So to make sure I recall correctly, at this point are you adding derby.jar
to your application in the same way you are adding pastry.jar? And the only
thing that is not working at this point is adding persistence into the mix
and launching that from Java Web Start?

Can you - once more - send along the error messages and stack trace you get
during the attempted Java Web Start launch?

Thanks.

- Tim