问题
i have installed the glassfish eclipse tools bundle...
i can start a project like dynamic web & a ear project and deploy them on the glassfish... it works perfect & under the localhost url i will get an hello world
but how i do this if i want to make an application client. please help... at the moment i simply created an "app client project in eclipse" & added it to the same ear, but i have no idea how to start this...
help - any tutorial how to start?!!
回答1:
Not the only only answer to this question but the appclient approach mentioned in Jeff's answer is a viable approach, but I was able to execute a client using this mechanism in eclipse and I wanted to share that approach. This approach will let you execute a java application with a main method acting as a client.
What you want to do is setup an External Tools Configuration.
- Create a new Program type of external tool configuration.
- Set location to point to the path of the appclient, for me (using embedded glassfish eclipse plugin) it was [PATH TO ECLIPSE]\plugins\oracle.eclipse.runtime.glassfish_3.1.1.0\glassfish3\glassfish\bin\appclient.bat
- Set working directory to your output/build directory e.g. ${project_loc}/target/classes
- Set arguments to ${java_type_name}
Select the class in your project with a main method that you wish to run as the client app and then select your external tool from the run external tools menu.
回答2:
There are two ways to do it. I'm afraid I can't be very specific, but I can point you in the right direction. (I'm just learning myself)
- You can enable Web Start for the application client EAR in GlassFish. You can do this either in the deployment descriptor (so it's enabled every time you deploy) or you can go into the GlassFish admin console, navigate to the Application, and check the checkbox to enable it. I have made a little progress on this approach.
- You can run it manually from the command line using, I believe, the "appclient" command. I have not been able to get this working yet.
Good luck, and if you learn more, I'd appreciate it if you let me know since I'm in the same boat as you.
Jeff
来源:https://stackoverflow.com/questions/2044682/eclipse-howto-start-a-application-client-on-java-ee-glassfish-appl-srv