wood burning stoves 2.0*
The moose likes Web Services and the fly likes Using Glassfish instead of Axis2 in Eclipse Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "Using Glassfish instead of Axis2 in Eclipse" Watch "Using Glassfish instead of Axis2 in Eclipse" New topic
Author

Using Glassfish instead of Axis2 in Eclipse

Chris Stabler
Greenhorn

Joined: Oct 22, 2009
Posts: 13
I have a post below about boolean variables and i seem to have had other problems with Eclipse and web services. I am currently using Eclipse Galileo.

I am going to give Glassfish a try - maybe things are a bit easier and straightforward.

I create a Dynamic Web Project -> Target Runtime: Glassfish v3 Java EE 6.

I create a package name then a java source file with some methods that i want to turn into a web service.

right click on the java file -> Web Services -> Create Web Service.

Configuration:

Server: Glassfish v3 Java EE 6
Web Service Runtime: Apache Axis 2. <--- why does it have to be Axis 2? i thought glassfish was going to replace axis 2 altogether? even if i make another selection(Glassfish) it still chooses Axis 2 for some reason.
Service Project: WebService
Service EAR Project: WebServiceEAR.

Click Finish.

Error:
cannot Deploy DssGlassServiceEAR
java.util.concurrent.ExecutionException: java.lang.IllegalArgumentException: port out of range:1114848
at java.util.concurrent.FutureTask$Sync.innerGet(FutureTask.java:232)
at java.util.concurrent.FutureTask.get(FutureTask.java:91)
at com.sun.enterprise.jst.server.sunappsrv.SunAppServerBehaviour.publishDeployedDirectory(SunAppServerBehaviour.java:743)
at com.sun.enterprise.jst.server.sunappsrv.SunAppServerBehaviour.publishModuleForGlassFishV3(SunAppServerBehaviour.java:591)
at com.sun.enterprise.jst.server.sunappsrv.SunAppServerBehaviour.publishModule(SunAppServerBehaviour.java:281)
at org.eclipse.wst.server.core.model.ServerBehaviourDelegate.publishModule(ServerBehaviourDelegate.java:949)
at org.eclipse.wst.server.core.model.ServerBehaviourDelegate.publishModules(ServerBehaviourDelegate.java:1039)
at org.eclipse.wst.server.core.model.ServerBehaviourDelegate.publish(ServerBehaviourDelegate.java:872)
at org.eclipse.wst.server.core.model.ServerBehaviourDelegate.publish(ServerBehaviourDelegate.java:708)
at org.eclipse.wst.server.core.internal.Server.publishImpl(Server.java:2731)
at org.eclipse.wst.server.core.internal.Server.publish(Server.java:1115)
at org.eclipse.jst.ws.internal.consumption.ui.command.StartServerCommand$1.run(StartServerCommand.java:132)
at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121)
Caused by: java.lang.IllegalArgumentException: port out of range:1114848
at java.net.InetSocketAddress.<init>(InetSocketAddress.java:118)



Any ideas on what i could be doing wrong? thanks!
Prateek Parekh
Ranch Hand

Joined: Apr 17, 2010
Posts: 34
cannot Deploy DssGlassServiceEAR
java.util.concurrent.ExecutionException: java.lang.IllegalArgumentException: port out of range:1114848


You should configure your Glassfish server to use a valid port i.e. somewhere in the range 1023 - 65535.
The axis runtime and application server have 2 different objectives. Check out the following article. It will help clear things up.
http://www.softwareagility.gr/index.php?q=node/21
Chris Stabler
Greenhorn

Joined: Oct 22, 2009
Posts: 13
Prateek Parekh wrote:
cannot Deploy DssGlassServiceEAR
java.util.concurrent.ExecutionException: java.lang.IllegalArgumentException: port out of range:1114848


You should configure your Glassfish server to use a valid port i.e. somewhere in the range 1023 - 65535.
The axis runtime and application server have 2 different objectives. Check out the following article. It will help clear things up.
http://www.softwareagility.gr/index.php?q=node/21


i have eclipse open now after having installed the glassfish plugin but i see no where to change the port number. can you give me a lead on this?

also currently i just want to create the webservice on localhost. i dont see why there is even a port issue to begin with...


thanks --
Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198
    
    1
Hi!
Do NOT do the following when developing your web service:
right click on the java file -> Web Services -> Create Web Service.

The tools in Eclipse uses Axis or Apache CXF, not GlassFish (Metro).

What you need to do to develop the simplest form of web service in Eclipse and deploy it to GlassFish is:
- Create a dynamic web project.
- Develop your web service endpoint implementation class (annotated with @WebService etc).
- Deploy the project to GlassFish.

GlassFish will automatically generate the WSDL and other artifacts, as needed.
Best wishes!
Chris Stabler
Greenhorn

Joined: Oct 22, 2009
Posts: 13
Ivan Krizsan wrote:Hi!
Do NOT do the following when developing your web service:
right click on the java file -> Web Services -> Create Web Service.

The tools in Eclipse uses Axis or Apache CXF, not GlassFish (Metro).

What you need to do to develop the simplest form of web service in Eclipse and deploy it to GlassFish is:
- Create a dynamic web project.
- Develop your web service endpoint implementation class (annotated with @WebService etc).
- Deploy the project to GlassFish.

GlassFish will automatically generate the WSDL and other artifacts, as needed.
Best wishes!


Thanks for the tip Ivan. When you say "- Develop your web service endpoint implementation class (annotated with @WebService etc)." does that mean just create my java class?

I really don't have a simple web service that i need to test. i have multiple jar files that contains classes, and other various dependency classes. what would be the standard to to annotate all of these or is it necessary? ive got 40 or 50 classes combined, most of them exported out into a jar file.

In effect, what i picture in my mind is that i should:

1. Create a dynamic web service project in eclipse.

2. create the java class that contains the methods that i want to be accessible by a web service client.

3. Export the project to Glassfish.

Should i import that project by loading up the actual glassfish IDE? or does eclipse offer an export to a glassfish project? does it even matter?

I also have a couple of 3rd party libraries that i depend on and some .jar files that are customized that i have written. i assume that this is also not a problem.

Look to hear back from you and thanks for the tips and information.!
Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198
    
    1
Hi!
Chris Stabler wrote:When you say "- Develop your web service endpoint implementation class (annotated with @WebService etc)." does that mean just create my java class?

Exactly!
i have multiple jar files that contains classes, and other various dependency classes.

Treat those as you would treat JAR files to be included in a dynamic web project, that is, place them in the designated web application library folder.


3. Export the project to Glassfish.

If you mean "Deploy to GlassFish", then you are correct.

Should i import that project by loading up the actual glassfish IDE? or does eclipse offer an export to a glassfish project? does it even matter?

Eclipse does not offer a specific GlassFish project. As before, you can use a regular Dynamic Web Application project and deploy it to GlassFish. You should have the latest GlassFish plugin installed in Eclipse and configured an instance of a GlassFish server, also in Eclipse.
As you may already know, the procedure to deploy a web application in Eclipse is:
- Right-click on the project node in the Package Browser window.
- Select "Run As" and select "Run on Server".
- Select the configured GlassFish server.

Hope this helps!
Chris Stabler
Greenhorn

Joined: Oct 22, 2009
Posts: 13
Ivan Krizsan wrote:Hi!
Chris Stabler wrote:When you say "- Develop your web service endpoint implementation class (annotated with @WebService etc)." does that mean just create my java class?

Exactly!
i have multiple jar files that contains classes, and other various dependency classes.

Treat those as you would treat JAR files to be included in a dynamic web project, that is, place them in the designated web application library folder.


3. Export the project to Glassfish.

If you mean "Deploy to GlassFish", then you are correct.

Should i import that project by loading up the actual glassfish IDE? or does eclipse offer an export to a glassfish project? does it even matter?

Eclipse does not offer a specific GlassFish project. As before, you can use a regular Dynamic Web Application project and deploy it to GlassFish. You should have the latest GlassFish plugin installed in Eclipse and configured an instance of a GlassFish server, also in Eclipse.
As you may already know, the procedure to deploy a web application in Eclipse is:
- Right-click on the project node in the Package Browser window.
- Select "Run As" and select "Run on Server".
- Select the configured GlassFish server.

Hope this helps!


IVAN -

thanks so much for the tips and help. i got everything to work as you said and after i figured a few other problems that i was having on my own. I still get some weird ADB, sub element errors (without glassfish) and some element errors even using glassfish. I am wondering if eclipse is just not ready for primetime when it comes to pushing some complex types(home grown or 3rd party) into a wsdl correctly so other non-java clients can properly communicate with the web service.

After trying out netbeans 6.8 for a day yesterday and getting everything working with no errors(save putting the war file on another machine), i would say netbeans is the better way to go. netbeans comes automatically with glassfish and apache derby which is a nice plus up. The wsdl that it creates also that you connect to doesnt require you to have to set up variables for each request and response just to be able to call a web service method. Netbeans just seems to be cleaner and easier.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Using Glassfish instead of Axis2 in Eclipse