Hi,

I tried searching for ApplicationContext on the this site and found this
thread:

http://old.nabble.com/Axis2-service-and-spring-problem%2C-can%27t-find-Spring%27s-ApplicationContext.-ts22842176.html#a22842176

Basically I have an Axis2 skeleton class. In that class is the following
code:

ApplicationContext ctx = new
ClassPathXmlApplicationContext("my-beans2.xml");

myDAO theDAO = (myDAO) ctx.getBean("myDAO");


The problem is that this doesn't apparently work if in Axis2. Standalone
this code worked fine.

I know that the Spring jars are in the classpath so I can't think of any
reason why I would get this error. Since this is a textbook way of getting
the application context I don't understand why this is happening.

The problem that appears in the log is:

[ERROR] org/springframework/context/ApplicationContext
java.lang.NoClassDefFoundError:
org/springframework/context/ApplicationContext
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Unk nown Source)
at java.lang.Class.getConstructor0(Unknown Source)
at java.lang.Class.newInstance0(Unknown Source)
etc etc

So at the end of the other thread there was the suggestion to create your
own ApplicationContextHolder class.  The problem is if I have my beans in a
file, such as my-beans2.xml, how can I create an ApplicationContextHolder
that reads from that file and gives me access to the beans?


Thanks,

Andy 

-- 
View this message in context: 
http://old.nabble.com/Axis2-and-ApplicationContext-tp26598402p26598402.html
Sent from the Axis - User mailing list archive at Nabble.com.

Reply via email to