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
Converter.java.
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 converter.java 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
/home/wpape/jboss-3.0.8_tomcat-4.1.24/tomcat-4.1.x/webapps/commence/erpsync/axis2/WEB-INF/services/myAAR.aar.
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,
Renjith
---------------------------------
Be a better Globetrotter. Get better travel answers from someone who knows.
Yahoo! Answers - Check it out.