Skip to main content

External JAR files in Application Client

13 replies [Last post]
igorilla
Offline
Joined: 2009-02-24

My AppClient gets deployed OK (well, with errors like "Error attempting to process extensions from the manifest of JAR file" for each JAR file, but I learned those should be ignored..).

When the application tries to log something, I get this:
Feb 24, 2009 2:29:59 PM com.sun.enterprise.appclient.MainWithModuleSupport
WARNING: ACC003: Application threw an exception.
java.lang.NoClassDefFoundError: org/apache/log4j/Category

Where do I put external JAR files to get the AppClient run properly?

They currently sit in "domains/domain1/lib/ext/" (where I put JAR file for MySQL connector, which runs just fine) on the server AND in "META-INF/lib" path of the main client's JAR file. File MANIFEST.MF reads: Class-Path: myjar.jar log4j-1.2.15.jar

The project is run with this script (you may see that I tried APPCPATH as well):
#!/bin/sh

export APPCPATH=$APPCPATH:/opt/glassfish/domains/domain1/lib/ext:/opt/glassfish/domains/domain1/generated/xml/j2ee-modules/MyProject1

/opt/glassfish/bin/appclient -client /opt/glassfish/domains/domain1/generated/xml/j2ee-modules/MyProject1/MyProject1.jar

Can anyone help?

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Anissa Lam

[att1.html]

Pavneet Kaur

[att1.html]

anilam
Offline
Joined: 2005-03-29

Can you do

%asadmin version --verbose=true

and report back. thanks.

Pavneet Kaur

[att1.html]

Siraj Ghaffar

Performance Advisor is supported on the latest release of the
application server, Sun GlassFish Enterprise Server v2.1 - look at the
documentation at
http://docs.sun.com/app/docs/doc/820-7188/giaoq?a=view

It is not supported on older versions.

Pavneet Kaur wrote:
> C:\JavaCAPS6\appserver\bin>asadmin version --verbose=true
> Version = Sun Java System Application Server 9.1_02 (build b05-p01)
> Command version executed successfully.
>
>
> glassfish@javadesktop.org wrote:
>> Can you do
>>
>> %asadmin version --verbose=true
>>
>> and report back. thanks.
>> [Message sent by forum member 'anilam' (anilam)]
>>
>> http://forums.java.net/jive/thread.jspa?messageID=333843
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
>> For additional commands, e-mail: users-help@glassfish.dev.java.net
>>
>>
>>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net For
> additional commands, e-mail: users-help@glassfish.dev.java.net

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
For additional commands, e-mail: users-help@glassfish.dev.java.net

June.Parks@Sun.COM

You may have mistaken another directory for the installation directory.
There are other lib subdirectories, and it's easy to get confused.
Also, make sure you restart the domain.

June

On 02/25/09 09:40 AM, Pavneet Kaur wrote:
> All,
>
> I am trying to setup the performance advisor on Glassfish v2 domain
> following instructions on
> http://docs.sun.com/app/docs/doc/820-7188/gianp?a=view. Issue is that
> I do not see the tasks in asadmin GUI after adding the
> performance-advisor.jar to appserver-install/lib as instructed. Any
> idea whats going on here?
>
> Thanks,
>
> Pavneet
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net For
> additional commands, e-mail: users-help@glassfish.dev.java.net

[att1.html]

Pavneet Kaur

[att1.html]
[moz-screenshot-25.jpg]

Ludovic Champenois

Pavneet Kaur wrote:
> I stopped the domain, copied the jar and then restarted the server.
...
Are you using GlassFish v2.1?
I am not sure if perf advisor works with older GlassFish installations...

Ludo

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
For additional commands, e-mail: users-help@glassfish.dev.java.net

John Clingan

Ludo, correct, GlassFish v2.1 is required.

Looking at the screen snapshot that was sent, it is a Java CAPS
installation. JavaCAPS does not yet run on GlassFish v2.1.

On Feb 25, 2009, at 11:09 AM, Ludovic Champenois wrote:

> Pavneet Kaur wrote:
>> I stopped the domain, copied the jar and then restarted the server.
> ...
> Are you using GlassFish v2.1?
> I am not sure if perf advisor works with older GlassFish
> installations...
>
> Ludo
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
> For additional commands, e-mail: users-help@glassfish.dev.java.net
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
For additional commands, e-mail: users-help@glassfish.dev.java.net

Pavneet Kaur

[att1.html]

Siraj Ghaffar

Pavneet Kaur wrote:
> All,
>
> I am trying to setup the performance advisor on Glassfish v2 domain
> following instructions on
> http://docs.sun.com/app/docs/doc/820-7188/gianp?a=view. Issue is that
> I do not see the tasks in asadmin GUI after adding the
> performance-advisor.jar to appserver-install/lib as instructed. Any
> idea whats going on here?
>
> Thanks,
>
> Pavneet
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net For
> additional commands, e-mail: users-help@glassfish.dev.java.net
Did you restart the server after copying the jar to
/lib directory? Are you using v2.1?

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
For additional commands, e-mail: users-help@glassfish.dev.java.net

tjquinn
Offline
Joined: 2005-03-30

You are close.

You need to get the log4j JAR file onto the class path, in one of several ways:

- Set the environment variable APPCPATH so it includes the full path to the log4j JAR file itself, not the containing directory.

- Set the environment variable VMARGS to -Djava.endorsed.dirs=/opt/glassfish/domains/domain1/lib/ext:${your-JRE-home}/lib/endorsed

Also, you should avoid referring to the internal app server directories such as under the generated directory. That is not an official published interface for GlassFish and, conceivably, the contents of such directories, their locations, and even their existence could change from release to release.

Let us know if either of these helps.

- Tim

igorilla
Offline
Joined: 2009-02-24

Thanks very much. :)

I followed the first choice:
export APPCPATH=$APPCPATH:/opt/glassfish/domains/domain1/lib/ext/myexternaljar1.jar:/opt/glassfish/domains/domain1/lib/ext/log4j-1.2.15.jar

..and it worked!