users@glassfish.java.net

RE: AppClient/JWS/Derby/Security problems

From: Martin, Ray <armart3_at_tycho.ncsc.mil>
Date: Fri, 8 Sep 2006 11:53:02 -0400

Sir,

Maybe i need to upgrade to more recent than 9.0b48?

Yes, i get the same results with and without specifying -mainclass.

Thanx for the pointer about "Annotations in app clients ..." because my Main
class starts the View (DrawingEditor) and the Model - who in turn starts the
DataAccessImpl where i was trying to locate the annotation stuff. So, what
i was seeing certainly aligns with what you telling me. Thanx - i would
have worked quite a while to find the rationale behind that one.

At the beginning of my (long-winded) email, i suggested that i was seeing a
difference between running my application in appclient versus appclient/JWS.
i really cannot come to that conclusion because it is just a matter of the
SecurityManager not running during appclient runs while in appclient/JWS the
SecurityManager is running. You pointed out how to get appclient/JWS to
accept user defined policy at the URL of the appclient/JWS running from
Glassfish. i attempted to follow, but i didn't do so good - i don't believe
appclient/JWS is 'seeing' my policy file, but i don't know how to prove or
disprove that. Can you suggest what to look for??? - the URL? the policy
file?

After i get my URL/policy problem fixed then i can state whether my
'appclient only' behaves as appclient/JWS. Do you think my problem could be
a jar signing issue?

Thank you kindly. i am very appreciative of everyone's help.

-----Original Message-----
From: Timothy.Quinn_at_Sun.COM [mailto:Timothy.Quinn_at_Sun.COM]
Sent: Thursday, September 07, 2006 6:29 PM
To: armart3_at_tycho.ncsc.mil
Cc: Sanjeeb Kumar Sahoo; Marina Vatkina; users_at_glassfish.dev.java.net
Subject: Re: AppClient/JWS/Derby/Security problems


Hello, again, Martin.

A couple of added notes...

Marina mentioned that toplink-essentials.jar will need to be in the
classpath. That's true and in addition the appclient command and the
Java Web Start support in GlassFish takes care of that for you
automatically. I need to double-check that the Java Web Start piece
does so correctly in 9.0 b48 which is what you are using. The current
code base definitely includes it, and the app client command has
included that JAR for some time so you should be okay there.

You should not see any difference between specifying -mainclass on the
command line and omitting that option and specifying Main-Class in the
manifest of the app client jar. Either way should work.

One other detail, following up on Sahoo's comment: Annotations in app
clients work only on items declared in the main class and they must be
static, not instance, items. It is the Java EE spec that imposes this
restriction, so the app client container honors it.

- Tim

Sanjeeb Kumar Sahoo wrote:
> Hi Martin,
>
> I have a couple of questions regarding the issue you are facing while
> running your application using appclient container.
>
> 1. You mentioned that you emf is *null* even when you annotated it
> with @PersistenceUnit. Where is this emf defined? It has to be defined
> in the main class only.
>
> 2. Can you send us the revised appclient command that you run now?
>
> To start with, don't use -mainclass option to appclient. Specify
> Main-Class in manifest.mf of the client jar.
>
> Thanks,
> Sahoo
>