Should i set EntityManagerFactory in my main class, then inject the static
class down through each object until arriving at the class (DataAccessImpl)
where EntityManagerFactory will be used to create an EntityManager?
-----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
>