You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Alex Bates <ab...@san.rr.com> on 2002/11/27 09:41:03 UTC

why have to copy .class files of existing webapp into Axis web-inf folder??

Hi,
 
I have an existing webapp running on Tomcat.  I want to expose some
methods in this webapp as Axis web services.  Axis is a separate webapp
- the examples I've seen so far have had to copy .class or .jar files
into the Axis WEB-INF\classes directory.
 
But this approach doesn't seem reasonable, it would lead to versioning
issues (i.e. how often to copy from
"tomcat\webapps\MyWebApp\WEB-INF\classes" to
"tomcat\webapps\axis\WEB-INF\classes" to keep the two versions in sync
).  
 
What I'm looking for is something similar to the ability to expose
existing COM components as web services with Microsoft's WSTK; but
instead of COM components they're Java components running in a webapp.  
 
I tried simply creating a WSDD for my existing app and not copying the
.class and .jar files into the axis\WEB-INF directory, and got the
following exeption:
 
 
Fault - org.apache.axis.ConfigurationException: Could not find class for
the service named: com.mycompany.myservice
Hint: you may need to copy your class files/tree into the right location
(which depends on the servlet system you are using).
AxisFault
 faultCode: {http://xml.apache.org/axis/}Server.generalException
 faultString: Could not find class for the service named: 
com.mycompany.myservice
Hint: you may need to copy your class files/tree into the right location
(which depends on the servlet system you are using).
 faultActor: null
 faultDetail: 
 
 
 
Thanks in advance -
 
Alex
(please cc: alex.bates@teradata-ncr.com)
 

Re: why have to copy .class files of existing webapp into Axis web-inf folder??

Posted by Lajos Moczar <lm...@galatea.com>.
I can answer one thing, which is that I suggest you copy the AXIS jars 
into MyWebApp instead of the other way around. You'll need to update 
your web.xml with some of the things from the Axis web.xml (most, 
actually). Then you need a server-config.wsdd in the WEB-INF directory 
of your webapp so your service automatically deploys when your app starts.

I'm writing all this up as a FlashGuide on my site, so if you want more 
info, check it in a couple of days.

Regards,

Lajos

http://www.galatea.com/flashguides

Alex Bates wrote:
> Hi,
> 
>  
> 
> I have an existing webapp running on Tomcat.  I want to expose some 
> methods in this webapp as Axis web services.  Axis is a separate webapp 
> ? the examples I?ve seen so far have had to copy .class or .jar files 
> into the Axis WEB-INF\classes directory.
> 
>  
> 
> But this approach doesn?t seem reasonable, it would lead to versioning 
> issues (i.e. how often to copy from ?tomcat\webapps\MyWebApp\WEB-INF\ 
> classes? to ?tomcat\webapps\axis\WEB-INF\classes? to keep the two 
> versions in sync ). 
> 
>  
> 
> What I?m looking for is something similar to the ability to expose 
> existing COM components as web services with Microsoft?s WSTK; but 
> instead of COM components they?re Java components running in a webapp. 
> 
>  
> 
> I tried simply creating a WSDD for my existing app and not copying the 
> .class and .jar files into the axis\WEB-INF directory, and got the 
> following exeption:
> 
>  
> 
>  
> 
> Fault - org.apache.axis.ConfigurationException: Could not find class for the service named: com.mycompany.myservice
> 
> Hint: you may need to copy your class files/tree into the right location (which depends on the servlet system you are using).
> 
> AxisFault
> 
>  faultCode: {http://xml.apache.org/axis/}Server.generalException
> 
>  faultString: Could not find class for the service named: 
> 
> com.mycompany.myservice
> 
> Hint: you may need to copy your class files/tree into the right location (which depends on the servlet system you are using).
> 
>  faultActor: null
> 
>  faultDetail: 
> 
>  
> 
>  
> 
>  
> 
> Thanks in advance ?
> 
>  
> 
> Alex
> 
> (please cc: alex.bates@teradata-ncr.com 
> <ma...@teradata-ncr.com>)
> 
>  
> 


-- 
galatea.com
Cocoon training, consulting & support


Re: why have to copy .class files of existing webapp into Axis web-inf folder??

Posted by Steve Loughran <st...@iseran.com>.
I should add that if you use xdoclet to create your web.xml (as everyone
should, if they can), then the CVS version of Axis has all the @webdoclet
tags needed to declare axis's bit of the web.xml; So you can run xdoclet
over both your own source and axis and web.xml will get everything you need.
Which is what I do.

----- Original Message -----
From: "Steve Loughran" <st...@iseran.com>
To: <ax...@xml.apache.org>
Sent: Wednesday, November 27, 2002 11:57
Subject: Re: why have to copy .class files of existing webapp into Axis
web-inf folder??

> What you need to do is add axis.jar and dependent jars to your webapp, and
> copy the relevant bits of axis' web.xml  for it to work. Then have your
> adminclient talk to the new webapp, instead of axis.



Re: NoClassDefFoundError: javax/servlet/http/HttpServlet

Posted by Trond Hjelmaas <th...@cse.unsw.EDU.AU>.
quote from http://xml.apache.org/axis/ (install section)

-----
Axis 1.0 client and Java1.4
Axis 1.0 shipped with a bug that surfaced afterwards: clients need
servlet.jar or j2ee.jar on their classpath when running on Java1.4. This
has been fixed in the CVS version. If you get a NoClassDefFoundError on
the client side, with Java failing to find javax/servlet/ServletContext,
either correct the classpath or upgrade to a later version of Axis.
------

could it be the same problem?



On Thu, 28 Nov 2002, Xander van der Merwe wrote:

> I'm getting the above exception under Orion 1.5.2 when starting the Orion
> Server and it tries to auto load the Axis AdminServlet (running under the
> JDK 1.4.1).  Now, javax.servlet.http.HttpServlet is part of the Orion.jar
> file, so I doesn't quite make sense to me. Any ideas why this might heppen?
>
> Thanks in advance
> Xander
>
>


NoClassDefFoundError: javax/servlet/http/HttpServlet

Posted by Xander van der Merwe <xa...@softtech.co.nz>.
I'm getting the above exception under Orion 1.5.2 when starting the Orion
Server and it tries to auto load the Axis AdminServlet (running under the
JDK 1.4.1).  Now, javax.servlet.http.HttpServlet is part of the Orion.jar
file, so I doesn't quite make sense to me. Any ideas why this might heppen?

Thanks in advance
Xander



RFClosure on fixing errors while stepping through Axis install docs

Posted by Sherif Abushadi <ap...@amgando.org>.
thanks for reading.

if you want to get right down to it, just read the first paragraph and the
last.


i'm looking for comments on the "progress" i've made while setting up axis
1.0 under tomcat 3.3.1. -- my setup is the simplest one, i suppose,  where
axis is running as a webapp under tomcat and the axis libs folder
( called _libs_ below ) is here:
  TOMCAT_HOME \ webapps \ axis \ WEB-INF \ lib

and i've just gotten it to work.  it's ugly but it works.

i'm doing this in preparation to develop a simple web service for a client
which will expose a single method to clients.

stepping through the installdoc
http://cvs.apache.org/viewcvs.cgi/~checkout~/xml-axis/java/docs/install.html

the process has included the following hesitant moves :

1. happyaxis.jsp returns error --> add [ activation.jar ] to _libs_
                                             --> add [ mail.jar ] and [
xmlsec.jar ]  for sport

*restarted tomcat here*

re: #1 -- everything is ok now.

2. "Test a SOAP Endpoint" returns error:  [ compiler not found in
classpath ]
http://localhost:8080/axis/services/Version?method=getVersion
--> add [ tools.jar ] to _libs_

*restarted tomcat here*

re: # 2 -- works fine now.

3. "Test a JWS Endpoint" returns error [ import cannot find
javax.servlet.* ]
http://localhost:8080/axis/EchoHeaders.jws?method=list
--> add [ servlet.jar ] to _libs_

*restarted tomcat here*

re: #3 -- everything works.

i now receive valid, error-free responses from my axis 1.0 installation when
clicking the links in the axis installation doc.  nice, right?

i have a strange feeling about this.

partly because i don't think my client will appreciate me moving files
around

and partly because i couldn't recreate the error to document it in this
email.


when trying to recreated the error i hit more ambiguous walls:

i tried renaming the class files to activation.old, tools.old and
servlet.old but
happyaxis.jsp seems to remember that activation.jar was there and gets
huffy with me

java.lang.NoClassDefFoundError: javax/activation/DataSource
           at java.lang.Class.forName0(Native Method)
           at java.lang.Class.forName(Class.java:115)
           at happyaxis_1.classExists(happyaxis_1.java:46)
           at happyaxis_1.probeClass(happyaxis_1.java:89)
           at happyaxis_1.wantClass(happyaxis_1.java:183)
           at happyaxis_1._jspService(happyaxis_1.java:363)

whereas before it nicely told me what was missing.

after fixing that i suddenly get full functionality, as if i didn't ever
need tools.jar and
servlet.jar in the first place. (remember, they're still named tools.old and
servlet.old)

of course i *restarted tomcat here* while making the changes to the file
names to
recreate the error messages.

any comments would be of help.

to clarify, what is one *supposed* to do to fix these errors that come up
while
testing an installation of axis 1.0 on tomcat 3.3.1 ?

many thanks in advance,

sherif




Re: why have to copy .class files of existing webapp into Axis web-inf folder??

Posted by Steve Loughran <st...@iseran.com>.
----- Original Message -----
From: "Alex Bates" <ab...@san.rr.com>
To: <ax...@xml.apache.org>
Sent: Wednesday, November 27, 2002 00:41
Subject: why have to copy .class files of existing webapp into Axis web-inf
folder??


> Hi,
>
> I have an existing webapp running on Tomcat.  I want to expose some
> methods in this webapp as Axis web services.  Axis is a separate webapp
> - the examples I've seen so far have had to copy .class or .jar files
> into the Axis WEB-INF\classes directory.
>
> But this approach doesn't seem reasonable, it would lead to versioning
> issues (i.e. how often to copy from
> "tomcat\webapps\MyWebApp\WEB-INF\classes" to
> "tomcat\webapps\axis\WEB-INF\classes" to keep the two versions in sync
> ).
>
> What I'm looking for is something similar to the ability to expose
> existing COM components as web services with Microsoft's WSTK; but
> instead of COM components they're Java components running in a webapp.
>
> I tried simply creating a WSDD for my existing app and not copying the
> .class and .jar files into the axis\WEB-INF directory, and got the
> following exeption:

separate webapps=separate classloaders; of course you got a
classNotFoundException.

What you need to do is add axis.jar and dependent jars to your webapp, and
copy the relevant bits of axis' web.xml  for it to work. Then have your
adminclient talk to the new webapp, instead of axis.




Re: why have to copy .class files of existing webapp into Axis web-inf folder??

Posted by Adam Leggett <ad...@upco.co.uk>.
Alex,

Simply put the axis runtime in your own webapp, i.e the required jars,
config etc. 
Axis can happily co-exist as a subcomponent within your application.

Adam

On Wed, 2002-11-27 at 08:41, Alex Bates wrote:
> Hi,
>  
> I have an existing webapp running on Tomcat.  I want to expose some
> methods in this webapp as Axis web services.  Axis is a separate webapp
> - the examples I've seen so far have had to copy .class or .jar files
> into the Axis WEB-INF\classes directory.
>  
> But this approach doesn't seem reasonable, it would lead to versioning
> issues (i.e. how often to copy from
> "tomcat\webapps\MyWebApp\WEB-INF\classes" to
> "tomcat\webapps\axis\WEB-INF\classes" to keep the two versions in sync
> ).  
>  
> What I'm looking for is something similar to the ability to expose
> existing COM components as web services with Microsoft's WSTK; but
> instead of COM components they're Java components running in a webapp.  
>  
> I tried simply creating a WSDD for my existing app and not copying the
> .class and .jar files into the axis\WEB-INF directory, and got the
> following exeption:
>  
>  
> Fault - org.apache.axis.ConfigurationException: Could not find class for
> the service named: com.mycompany.myservice
> Hint: you may need to copy your class files/tree into the right location
> (which depends on the servlet system you are using).
> AxisFault
>  faultCode: {http://xml.apache.org/axis/}Server.generalException
>  faultString: Could not find class for the service named: 
> com.mycompany.myservice
> Hint: you may need to copy your class files/tree into the right location
> (which depends on the servlet system you are using).
>  faultActor: null
>  faultDetail: 
>  
>  
>  
> Thanks in advance -
>  
> Alex
> (please cc: alex.bates@teradata-ncr.com
> <ma...@teradata-ncr.com> )
>  
-- 
====================================
Adam Leggett (adam.leggett@upco.co.uk)
Applications Solution Provider

UPCO http://www.upco.co.uk

Office :     +44 113 201 0600
Direct Line: +44 113 201 0631
Fax :        +44 113 201 0666

Marshall Mill, Marshall Street,
Leeds LS11 9YJ
====================================

The contents of this e-mail are intended for the named addressees and
may contain confidential and/or priviledged material. If received in
error, please contact UPCO on +44 (0) 113 201 0600 and then delete the
entire e-mail from your system. Unauthorised review, distribution,
disclosure or other use of this information could constitute a breach of
confidence. Your co-operation in this matter is greatly appreciated


Re: why have to copy .class files of existing webapp into Axis web-inf folder??

Posted by Mitch Gitman <mg...@usa.net>.
Alex, I'm sure this answer is not the one you're looking for, but it might 
help you in the long term and would at least help others. It seems to me 
you're making an unnecessary architectural assumption. Your application is 
not your web application; your webapp is one way of looking at your 
application.

If I were you, I would do some refactoring and separate out the true heart 
of your application (the M in MVC) from the webapp-specific portions of it 
-- the JSP pages (which would be the V) and any webapp-specific controllers 
(the C), a la Struts. I would make sure the application itself is in a 
separate package and presents an interface that, at least to some extent, 
could be used interchangeably by a webapp or as a web service.

I did this myself and thoroughly tested my model component before I even 
looked at presenting it as a web service. The one sacrifice to web services 
I subsequently had to make with the interface was to change my List values 
into raw arrays. I did this directly in the interface, although I could 
have just added an extra layer of interface over it and preserved the List 
instances.

At 00:41 27.11.02 -0800, Alex Bates wrote:

>Hi,
>
>
>
>I have an existing webapp running on Tomcat.  I want to expose some 
>methods in this webapp as Axis web services.  Axis is a separate webapp 
>the examples I ve seen so far have had to copy .class or .jar files into 
>the Axis WEB-INF\classes directory.
>
>
>
>But this approach doesn t seem reasonable, it would lead to versioning 
>issues (i.e. how often to copy from 
>tomcat\webapps\MyWebApp\WEB-INF\classes to 
>tomcat\webapps\axis\WEB-INF\classes to keep the two versions in sync ).
>
>
>
>What I m looking for is something similar to the ability to expose 
>existing COM components as web services with Microsoft s WSTK; but instead 
>of COM components they re Java components running in a webapp.
>
>
>
>I tried simply creating a WSDD for my existing app and not copying the 
>.class and .jar files into the axis\WEB-INF directory, and got the 
>following exeption:
>
>
>
>
>
>Fault - org.apache.axis.ConfigurationException: Could not find class for 
>the service named: com.mycompany.myservice
>Hint: you may need to copy your class files/tree into the right location 
>(which depends on the servlet system you are using).
>AxisFault
>  faultCode: {http://xml.apache.org/axis/}Server.generalException
>  faultString: Could not find class for the service named:
>com.mycompany.myservice
>Hint: you may need to copy your class files/tree into the right location 
>(which depends on the servlet system you are using).
>  faultActor: null
>  faultDetail:
>
>
>
>
>
>
>Thanks in advance
>
>
>
>Alex
>
>(please cc: <ma...@teradata-ncr.com>alex.bates@teradata-ncr.com)
>
>