Solved

Deploying a JAVA web service using JBOSS 4.0.2

Posted on 2009-03-30
13
1,214 Views
Last Modified: 2013-12-02
Hello,

I am new to this and spent time on google but couldn't find anything that works, so feel free to give me tips, links and comments please :)

I created an application in Java 1.5. I can execute it and it's working fine. Now I want to deploy it as a web service so certain methods can be used by other application.

I have to deploy it on Tomcat (I can install any version) No other constraints. I have a full access to the server.
Could you tell me the best way to do it (what to install, etc) or refer me to a tutorial?

Thanks a lot, java configuration has been driving me crazy.
0
Comment
Question by:yann247
  • 7
  • 6
13 Comments
 
LVL 20

Expert Comment

by:Venabili
ID: 24027233
OK - I am  a bit confused - do you want to delpoy on tomcat or on jboss?
On JBoss: http://www.ibm.com/developerworks/webservices/library/ws-deployjava.html
On tomcat: http://www.cs.cmu.edu/~eran/lectures/TA_axis_and_deploy-Eran_Toch.ppt for example.

And if you never read this: http://java.sun.com/webservices/docs/1.5/tutorial/doc/ - it might be a good idea also.
0
 
LVL 20

Expert Comment

by:Venabili
ID: 24027238
0
 

Author Comment

by:yann247
ID: 24028614
Actually I have both, I'm just looking for the easiest/fastest way.
Kind of like with .NET where you just have to add [Webservice] in front of a method, and then stubs and every config thing is generated.

Is it easier on Jboss or tomcat? I have both
0
 
LVL 20

Accepted Solution

by:
Venabili earned 500 total points
ID: 24028716
I prefer Tomcat because this is what I had been using for a very long time and is a bit easier to setup.

Hm. IS there a chance to migrate to Java 6? Because there you have a very .NET like way to work with web services:
http://mywheel.net/blog/index.php/2007/03/28/web-services-in-java-6/ and you do not even need a server. Now - thw performance of this is pretty bad... but it is ok for testing. :) For real development, http://mywheel.net/blog/index.php/2007/04/18/deploying-java-6-web-services-in-tomcat/ 

If you are stuck at Java 5, I guess you just need to brace yourself and follow one of the step-by-step guides. http://anupjani.wordpress.com/2009/03/27/java-web-service-example/ is not that bad. :)
0
 

Author Comment

by:yann247
ID: 24028730
thank you for pointing me in the right direction!
0
 
LVL 20

Expert Comment

by:Venabili
ID: 24028743
Let me know if I can help you with anything else :) It's kinda... strange the first time you try to deploy it but after this you do not even think about it - it becomes logical in a strange way :)
0
3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

 

Author Comment

by:yann247
ID: 24029467
Ok I might need your help again.
I installed Tomcat 5.5 on the server I'm working on. I could access it via ip.of.the.server:8080. I tried to access the administration panel but got a message saying that I had to install it. So i stopped tomcat, restarted it but now I cant connect to the server. I tried changing the port to 7070 but still nothing.

When I stop tomcat and I try ip:7070 I instantly get an error msg in IE saying that eh website is encountering problems.
If i start it IE tries to connect forever and the page stays blank... I can see the tomcat icon though...

any idea?
0
 
LVL 20

Expert Comment

by:Venabili
ID: 24029577
How did you install it? Changing the port had probably done more bad than good -- it might be something in your browser setup stopping it now(unless if you are on the same machine). I suspect that something is not installed or configured properly.
0
 

Author Comment

by:yann247
ID: 24029765
I reinstalled the whole thing and I can access tomcat again.
I added a user in tomcat-users.xml but when I access ip:8080/ tomcat doesnt ask for a login, and when I click on the manager it just says that I dont have permission

how can i log in?
0
 
LVL 20

Expert Comment

by:Venabili
ID: 24029934
This is really a different question from what we started with :)
How did you add it? Did you add the appropriate role? Had you setup an application? What happens if you try http://localhost:8080/examples
0
 

Author Comment

by:yann247
ID: 24030009
this is working fine I can access the axis application (beginning of the tutorial) I was just trying to acess the manager.
0
 

Author Comment

by:yann247
ID: 24030353
I'm blocked in the tutorial. Should I create a new topic or can you help me here? :)
0
 

Author Comment

by:yann247
ID: 24030431
I'm getting an exception:

[root@uat_ui test]# java org.apache.axis.wsdl.Java2WSDL -o hello.wsdl -l.http://localhost:8080/axis/services/hello. -n urn:hello -p.hello. urn:hello myapp.Hello
Exception in thread "main" java.lang.NoClassDefFoundError: javax/xml/rpc/encoding/TypeMappingRegistry

This looks like a classpath problem but I followed the tutorial and set it:
[root@uat_ui test]# echo $CLASSPATH
/usr/local/axis-1_4/lib/:/usr/java/jdk1.5.0_18/lib/:.:/usr/local/axis-1_4/lib/axis.jar:/usr/local/axis-1_4/lib/axis-ant.jar:/usr/local/axis-1_4/lib/commons-discovery-0.2.jar


[root@uat_ui test]# ll /usr/local/axis-1_4/lib/

total 2712

-rwx--x--x  1 root root   62983 Oct 23  2006 activation.jar

-rwx--x--x  1 root root   33202 Apr 22  2006 axis-ant.jar

-rwx--x--x  1 root root 1599570 Apr 22  2006 axis.jar

-rwx--x--x  1 root root   71442 Apr 22  2006 commons-discovery-0.2.jar

-rwx--x--x  1 root root   38015 Apr 22  2006 commons-logging-1.0.4.jar

-rwx--x--x  1 root root   31191 Apr 22  2006 jaxrpc.jar

-rwx--x--x  1 root root  352668 Apr 22  2006 log4j-1.2.8.jar

-rw-r--r--  1 root root     921 Apr 22  2006 log4j.properties

-rwx--x--x  1 root root  347137 Oct 27  2004 mail.jar

-rwx--x--x  1 root root   18979 Apr 22  2006 saaj.jar

-rwx--x--x  1 root root  126771 Apr 22  2006 wsdl4j-1.5.1.jar

Open in new window

0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Understanding websocket example in spring 1 54
Printing to a specific printer tray (HP 806dn printer) 3 83
firstChar challenge 13 107
allswap challenge 6 76
Verbose logging is used to diagnose garbage collector problems. By default, -verbose:gc output is written to either native_stderr.log or native_stdout.log.   It is also possible to redirect the logs to a user-specified file. This article will de…
There are numerous questions about how to setup an IBM HTTP Server to be administered from WebSphere Application Server administrative console. I do hope this article will wrap things up and become a reference for this task. You need three things…
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.

919 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now