axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From renjith kalappurackal <>
Subject " Accessing a file from service Class "
Date Tue, 14 Aug 2007 18:08:58 GMT
Hi All,
I have a problem facing while try to read a file from a web services that is packaged as aar.
My application  structure is as follows
The server I am using is jboss-3.0.8_tomcat-4.1.24.
And I wrote code to access file in my local machine as below in lets say
MessageContext ctx = MessageContext.getCurrentMessageContext();
AxisService asrv = ctx.getAxisService();
fin = (FileInputStream) asrv.getClassLoader().getResourceAsStream(xml)
Where xml being the name of the file lets say (myconfig.xml) And I placed this file in axis2/WEB-INF/classes.
And put in a jar file in C:\jboss-3.0.8_tomcat-4.1.24\tomcat-4.1.x\shared\lib.
And I deployed my services in axis2.war and placed axis2.war in C:\jboss-3.0.8_tomcat-4.1.24\server\default\deploy\webapps.
This solution worked fine in local environment.
But when I moved the solution to Linux server it failed becuase of NullPointerException in
AxisService asrv = ctx.getAxisService();
    The structure of server is different being Converter.class in shared/lib directory of
/home/jboss-3.0.8_tomcat-4.1.24/tomcat-4.1.x/shared/lib. but axis2 is deployed as exploded
form under /home/jboss-3.0.8_tomcat-4.1.24/tomcat-4.1.x/webapps/mydomain/ and this erro is
happening whenI tried to access my config file that is in /home/jboss-3.0.8_tomcat-4.1.24/tomcat-4.1.x/webapps/mydomain/axis2/WEB-INF/clasess/myconfig.xml
from my service class (let say MyService.class) in AAR that 
   This error is happening when MyService.classs after accessing Converter.class in shared/lib
try to get the messageContext. 
   I think I did somethign terrible wrong here. Could anyone tell me the best way to access
this myconfig.xml in /home/jboss-3.0.8_tomcat-4.1.24/tomcat-4.1.x/webapps/mydomain/axis2/WEB-INF/clasess/
directory from a class that is placed in a jar in shared/lib that is being called by my service
class in AAR.

  Thanks in advance,

Be a better Globetrotter. Get better travel answers from someone who knows.
Yahoo! Answers - Check it out.
View raw message