Skip to main content

appclient: Unable to access jarfile

1 reply [Last post]
Joined: 2010-01-14


I have a standalone ejb-client jarfile, which I have successfully deployed on glassfish by placing it to the folder glassfish/domain/domain1/autodeploy. Now that I want to run this application, I typed the following in folder glassfish/bin:

./appclient -client MyJarFile.jar

I am getting "Unable to access jarfile MyJarFile.jar"

I am able to run the application successfully with NetBeans, but not when I try the above.

Please help.



Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Joined: 2005-03-30


In general you are not required to deploy a stand-alone app client to the server, although you can if you want to. Depending on whether you want to deploy the client or not, there are two approaches to try. Both start with the same steps:

Use NetBeans to clean-and-build your client project. Note in the NetBeans output exactly where NetBeans stored the resulting JAR. Let's assume the project is MyTestApp so the JAR is named MyTestApp.jar.

Now in an OS shell add ${installRoot}/bin to your path, where ${installRoot} is wherever you installed GlassFish. (${installRoot}/bin will contain the asadmin and appclient scripts, among other things)

Now follow A or B below.

[b]A. Continue without deploying the client[/b]

Launch the app client using

appclient -client [i]path-to-the-client-JAR-NetBeans-built[/i]

That should work.

[b]B. Continue deploying the client[/b]

1. Instead of copying (or moving) your client JAR file into the autodeploy directory, deploy your client using

asadmin deploy --retrieve clientFiles [i]path-to-the-client-JAR-NetBeans-built[/i]

This not only deploys the client but also downloads some files into the new clientFiles subdirectory.

2. Launch your client using

appclient -client clientFiles/MyTestAppClient.jar

Note that the JAR file name has "Client" in it that is not in your project name.

That should work.

Let us know how it goes.

- Tim