web service using resin

g3p3nk

Junior Member
Aug 12, 2008
17
0
0
hi,

i've been using resin-3.0.19 as web server for quite some time now.
just recently, i would like to build a web service using the same resin.

i stumbled upon apache axis2 for the web service part, but i don't know how to configure the resin so that it works with axis2.
i've been wasting hours and hours looking around, reading stuffs but i still can't get it to work.

is there any step-by-step guide to use axis2 with resin?
there are lots of guides using apache tomcat, but not resin.. thus i'm stuck..
i need to know the minimum configuration, just to get it working.

i even followed the steps listed on this blog
http://charithaka.blogspot.com...oy-apache-axis2-on-res...
but no i got some http error 200, i didn't get the expected result.
so i'm just spinning my wheel here >,<

or does axis2 just not work with resin? do i have to use something different? something other than axis2..?

any help would be appreciated.
thanks in advance, cheers =]
 

DaveSimmons

Elite Member
Aug 12, 2001
40,730
670
126
HTTP 200 = OK, it's not an error.

If you got a blank page with the 200 response your code may have a bug in it and error reporting may be disabled.

I've never heard of resin so I can't help with the setup. Switch to PHP or Perl and I'll be slightly less useless :)
 

g3p3nk

Junior Member
Aug 12, 2008
17
0
0
@DaveSimmons
when i got that http 200 error, i haven't imported any of my existing applications yet (written in java).
what i was doing was just following the step-by-step guide that charithaka made in his blog (http://charithaka.blogspot.com/search/label/Resin).
so i'm not sure if the code has a bug or something, as they are downloaded fresh from their respective sites (http://www.caucho.com/download/ for resin, and http://ws.apache.org/axis2/download/1_4/download.cgi for axis2).

and out of curiosity, how do you enable error reporting?

and afaik, resin is comparable to apache tomcat, as php / perl to javascript.
resin / tomcat is just a web server application.
while i realized many people use tomcat, i can't change mine from resin to tomcat for various reasons.

thanks for the reply though =]


anybody knows how to set resin for axis2?


edit: link to charithaka's blog is fixed.
 

Tea Bag

Golden Member
Sep 11, 2004
1,575
3
0
Why Resin 3.0.19? It looks like Resins up to version 4 - there's a good chance Axis2 relies on some dependencies within the container that aren't up to date. Another thing to consider is the JDK verison you're running it under.

EDIT: I read it as you did the above example using the 3.0.x build and not the new Resin. I'd first check to see what version of the JDK Caucho recommends and go from there. Crank up the container's logging level or the WAR files logging and see if the war deploys correctly. There's got to be a log even at default levels that may give some insight.

and out of curiosity, how do you enable error reporting?

(In Resin, If you're sticking with 3.0.x)

http://caucho.com/resin-3.0/tr...echnique.xtp#debug-log

(In the Axis2 WAR)

Logging's enabled for INFO level up to ERROR but if you want to crank it up even higher, before you build it modify the $AXIS2_HOME/log4j.properties file and change the logger you want to from 'INFO' to 'DEBUG'

looks like stuff gets spit out to $RESIN_HOME/log - check that before you crank up logging in either place because you'll get a LOT of noise.
 

g3p3nk

Junior Member
Aug 12, 2008
17
0
0
@Tea Bag
we've been using resin 3.0.x for at least 7years now. it's abit hard to even upgrade the resin, as the current resin works, and we need to re-test the app if we were updating it..
thus, i'm leaning toward not changing the resin if possible.
web service works with resin 3.0.x using axis1 (although i don't know how to do it as well, as i wasn't the one setting it up, and i can't get a hold of the guy who set that up a couple years ago).

btw, i was trying to re-run resin with axis2 (fresh start), but i can't seem to set the path for "resin.conf" which was looked for by resin.
do you know how to set the path? i'm running it under windows vista x86.. i know you can try calling cd %RESIN_HOME%/lib | ln -s /var/unity/conf/.. but under windows.. how do you do this?

the last time i got http 200 error, was because i put the whole resin into C:/ thus resin.conf is located at C:/resin/conf/ which is the default path for resin (in windows anyways). and since i moved resin into my desktop, it stopped working.
any idea? ^^;

p.s.: i'm resin newbie ^^;
 

Tea Bag

Golden Member
Sep 11, 2004
1,575
3
0
If it can't find resin.conf, it's not starting up.

First, open a command prompt to see if RESIN_HOME is even set. Type 'echo %RESIN_HOME%' in a command prompt.

If it's not set, or set incorrectly set RESIN_HOME to your 'fresh start' directory adding (or updating) the environment variable.

To add environment variables, the steps listed here for XP work but in vista I'm not sure.. http://www.search.stilegal.com/main/R10463.htm.

(test it by making the change and typing 'echo %RESIN_HOME%' in a NEW command prompt)

Then, can you do these steps? http://caucho.com/resin-3.0/in...nstall.xtp#quickstart?

Don't bother dropping the Axis2 war in there if the server doesn't even start up with those steps. Monitor the log directory and make sure the app started without error. THEN try to deploy the Axis2 war.

FYI - I've never used Caucho Resin before but I've configured enough servlet containers and app servers to know what works and what doesn't.. so my best advice to you is stick to the Resin documentation and install it according to that and get it running first before you work from a blog post trying to get stuff to run.
 

g3p3nk

Junior Member
Aug 12, 2008
17
0
0
@Tea Bag

ahh i finally get the resin running (w/ help of my friend) ._.
apparently, when i copy pasted my old conf file into the newer version of resin, the resin refuses the old conf file.. somehow, i don't know why.. so i'm switching back to 3.0.x.

anyways, now i'm importing axis2 war into webapps folder in resin.
now i'm hitting this error..

com.caucho.config.LineConfigException: WEB-INF/web.xml:26: `org.apache.axis2.transport.http.AxisServlet' is not a known servlet. Servlets belong in the classpath, often in WEB-INF/classes.

i've been fiddling around with the conf file, trying to point the jars on the specified class-loader, but no luck..

any idea how to resolve this?

p.s.: thanks for the links about changing environment variables, i learned new stuff.. =]
 

Tea Bag

Golden Member
Sep 11, 2004
1,575
3
0
I hate to use the old "it works on my machine" excuse, but I got it working following these steps:

1. Downloaded 3.0.19 from Caucho's site

2. I Did _NOT_ set %RESIN_HOME%, just ran RESIN_HOME/httpd.exe from the command line - but i have JAVA_HOME set in my path (not thinking this makes a big difference, but just pointing it out)

3. Hit the test page at http://localhost:8080/ after it was up and running.

4. Built the axis2.war file from the version download you supplied above as directed in the instructions and copied the WAR file in the RESIN_HOME/webapps directory

5. Waited for it to deploy, and hit http://localhost:8080/axis2/ without error.

the ONLY other thing I can think of is your JDK version, I'm using:
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_12-b04)
Java HotSpot(TM) Client VM (build 1.5.0_12-b04, mixed mode, sharing)


and the axis2 war was built with ANT:
Apache Ant version 1.7.0 compiled on December 13 2006

So I don't know what to tell you, its got to be something with your configuration - mabye try these steps?

Good luck.
 

g3p3nk

Junior Member
Aug 12, 2008
17
0
0
@Tea Bag
i did the steps you mentioned above. it works to 3rd point. right after i drop axis2.war, it throws the same error.
by setting up JAVA_HOME, you mean the environment variable? if yes, then my machine didn't have it set before, so i added JAVA_HOME with its value pointing to the folder where java is installed C:\j2sdk1.4.2_13\bin


this is my installed java version (taken from typing java -version on my console):
java version "1.6.0_01"
Java(TM) SE Runtime Environment (build 1.6.0_01-b07)
Java HotSpot(TM) Client VM (build 1.6.0_01-b07, mixed mode)

is this a problem?


and i'm not sure about apache ant.. is that something that i have to install?
or.. is there any way to check if i have apache ant installed? because i don't remember setting up / installing apache ant..

thanks for the reply! your help is most appreciated.
 

Tea Bag

Golden Member
Sep 11, 2004
1,575
3
0
Apache ANT is what's used to build the WAR file from that distribution of Axis2. Where are you getting the WAR from if you're not building it? You need a version of ANT to build that file.

You should just be able to type 'ant -version' at the command line and have a prompt similar to my above statement show up.

You also have JAVA_HOME set to JDK 1.4, but your PATH may have a JRE set and that's why 1.6 is showing up when you do a -version. Modify the PATH environment variable to look at %JAVA_HOME% .. You'll probably have to copy that whole PATH variable out and find where the 1.6 JRE is being used if you're expecting JDK 1.4 to be used.

EDIT: I don't know if you did it from scratch so try extracting http://www.caucho.com/download/resin-3.0.19.zip into a NEW directory somewhere and run it from the command line (RESIN_HOME/httpd.exe) .. mess with RESIN_HOME later.
 

g3p3nk

Junior Member
Aug 12, 2008
17
0
0
hmm, i tried typing ant -version on the console, but it says 'ant' is not recognized as an internal or external command, operable program or batch file.

as for the axis2 war, i was downloading it here http://archive.apache.org/dist.../1_4/axis2-1.4-war.zip
in a sense, i wasn't exporting that .war. all i did was just dropping that .war into webapps folder, and resin did the unpackaging itself, and it failed.

since the system can't even find apache ant, i'm leaning to that my machine doesn't have the needed ant installed. if so, is it enough if i just download this file http://apache.raffsoftware.com...ache-ant-1.7.1-src.zip?

i have yet to configure the JAVA_HOME. when i checked my eclipse, the JDK i'm using is 1.4, but the JRE being used is 1.6..... hmmmm.. i need to double check this..

and i did download from the exact same link you specified above, and started from fresh 2 hours ago (i put all those painful config files aside).
 

Tea Bag

Golden Member
Sep 11, 2004
1,575
3
0
I just downloaded that WAR file and deployed it, no problem. I don't know what to tell you, it's got to be something with your specific configuration - be it JDK or what have you. Try to get that cleared up first or maybe try another environment.
 

PinkAngel

Junior Member
Jul 30, 2009
5
0
0
Hi. I am having the same problem with Axis2 deployed to Resin. I am using Resin 3.1.3. Since I needed to embed Axis2 to our existing application, I changed our application's web.xml to include the below lines of codes:

<servlet>
<servlet-name>AxisServlet</servlet-name>
<display-name>Apache-Axis Servlet</display-name>
<servlet-class>
org.apache.axis2.transport.http.AxisServlet
</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>

<servlet-mapping>
<servlet-name>AxisServlet</servlet-name>
<url-pattern>/services/*</url-pattern>
</servlet-mapping>

Then I dropped axis2.war to Resin's webapps folder. However, when I started resin, i got the below error as well:

'org.apache.axis2.transport.http.AxisServlet' is not a known servlet. Servlets belong in the classpath, often in WEB-INF/classes.
I already added axis2-transport-http-1.5.jar to our lib folder as well as to the classpath variable. Am I missing some steps here?

Thanks a lot in advance for your help.
 

g3p3nk

Junior Member
Aug 12, 2008
17
0
0
@PinkAngel
this is what i noticed some other day.
if you are deploying axis2 v1.5, it will only work with resin 4.x..
if you are on the same boat as me (have to use older resin), then try deploying axis2 v1.4 instead.
for some bizarre reason, resin 3.x won't take axis2 v1.5.
try it with axis2 v1.4, and see if it solves your problem.
 

PinkAngel

Junior Member
Jul 30, 2009
5
0
0
@g3p3nk
Thank you for your response. I tried using axis2 v1.4 but I am getting this error:
Caused by: com.caucho.config.ConfigException: java.io.FileNotFoudException: \\usr\local\resin\lib\resin.jar(The network path was not found) at com.caucho.config.TypeStrategyFactory.init(TypeStrategyFacto
y.java:162)

What seems to be the problem here? Also, i noticed that axis2 v1.4 does not have transport.jar.

thanks in advance for your valuable help
 

g3p3nk

Junior Member
Aug 12, 2008
17
0
0
@PinkAngel
honestly, i'm still learning about this web service thing too, so i'm not too sure as how resin behaves with axis2..

i'd better not make any random guesses, and wait for someone savvy around the area.

but if i have to make a guess, then it'd be to check %RESIN_HOME%\resin\lib\ and see if resin.jar is there.. also it maybe because of the misconfigured resin.conf, <class-loader path="xxxxx">? i don't know =(
 

PinkAngel

Junior Member
Jul 30, 2009
5
0
0
hi,
I changed my class loader path in resin.conf. But when i deployed the application, i got the old error:

500 Servlet Exception

WEB-INF/web.xml:80: 'org.apache.axis2.transport.http.AxisServlet' is not
a known servlet. Servlets belong in the classpath, often in WEB-INF/classes.

I need help badly. :'(
 

PinkAngel

Junior Member
Jul 30, 2009
5
0
0
I was just wondering, is there anything that i need to set up or configure in web.xml or in build.xml or in resin.conf? I totally have no idea why it cannot see the servlet which is inside axis2.jar.
 

PinkAngel

Junior Member
Jul 30, 2009
5
0
0
Hi All,
I resolved the Servlet Exception I posted above.What I did was re-check my classpath environment variable and removed the duplicate entries for axis2-1.2.jar. However, when I tried to deploy my application, I got the below error:

javax.servlet.ServletException: javax.servlet.ServletException: org.apache.axis2.deployment.DeploymentException: The "Dispatch" phase is not found on the global "InFlow" phase of the axis2.xml file. Make sure the phase is within the axis2.xml file.

any idea how to resolve this?

thanks.