Hi,

As struts2 comes along with spring integration with
struts2-spring-plugin-2.0.11.jar,after starting the tomcat server its unable
to load that jar and getting an exception as:

SEVERE: Exception starting filter struts2
Unable to load bean: type:com.opensymphony.xwork2.ObjectFactory
class:org.apache.struts2.spring.StrutsSpringObjectFactory - bean -
jar:file:/E:/Struts2WorkSpace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/SampleStruts2/WEB-INF/lib/struts2-spring-plugin-2.0.11.jar!/struts-plugin.xml:30:132
        at
com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.register(XmlConfigurationProvider.java:208)
        at
org.apache.struts2.config.StrutsXmlConfigurationProvider.register(StrutsXmlConfigurationProvider.java:101)
        at
com.opensymphony.xwork2.config.impl.DefaultConfiguration.reload(DefaultConfiguration.java:131)
        at
com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:52)
        at
org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:395)
        at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:452)
        at
org.apache.struts2.dispatcher.FilterDispatcher.init(FilterDispatcher.java:201)
        at
org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:225)
        at
org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:308)
        at
org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:79)
        at
org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:3540)
        at
org.apache.catalina.core.StandardContext.start(StandardContext.java:4110)
        at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1012)
        at org.apache.catalina.core.StandardHost.start(StandardHost.java:718)
        at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1012)
        at 
org.apache.catalina.core.StandardEngine.start(StandardEngine.java:442)
        at 
org.apache.catalina.core.StandardService.start(StandardService.java:450)
        at 
org.apache.catalina.core.StandardServer.start(StandardServer.java:683)
        at org.apache.catalina.startup.Catalina.start(Catalina.java:537)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:271)
        at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:409)
Caused by: java.lang.NoClassDefFoundError:
org/springframework/context/ApplicationContextAware
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClass(Unknown Source)
        at java.security.SecureClassLoader.defineClass(Unknown Source)
        at
org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:1629)
        at
org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:850)
        at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1299)
        at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1181)
        at java.lang.ClassLoader.loadClassInternal(Unknown Source)
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClass(Unknown Source)
        at java.security.SecureClassLoader.defineClass(Unknown Source)
        at
org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:1629)
        at
org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:850)
        at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1299)
        at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1181)
        at
com.opensymphony.xwork2.util.ClassLoaderUtil.loadClass(ClassLoaderUtil.java:139)
        at
com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.register(XmlConfigurationProvider.java:180)
        ... 24 more


What is the reason for this?I have checked whether I have loaded same jar
double times,but tht's not tht problem?what might b the reason?Does any body
came across this one?

Also,the link:
http://www.roseindia.net/struts/hibernate-spring/integrate.shtml helps in
integrating struts1+hibernate+springs.But, since I would like to work with
struts2+Hibernate+Spring,what modifications I have to do to satisfy my
requirement?Since ation forms concept is not there in struts2...!!!

Thanks.



RajiR wrote:
> 
> Ok,,thx for the replies....i'll try using JNDI and with spring
> integration.I have worked using struts2+hibernate,it works fine..
> 
> Laurie Harper wrote:
>> 
>> Struts1 provided a data-source configuration element because, at the 
>> time that was added, there was no consistent mechanism for configuring 
>> data sources that worked across servlet containers. That changed a long 
>> time ago and Struts first deprecated, and then removed, its support for 
>> the data-source configuration element.
>> 
>> The preferred way to set up a data source (using a connection pool or 
>> not) is through JNDI using your servlet container configuration. The 
>> article Jeromy linked to mentions JNDI and links to more detailed 
>> documentation for various servlet containers and application servers.
>> 
>> In short:
>> 
>> 1) configure a data source (connection pool) and expose it via JNDI, 
>> using your servlet container or application server as described in the 
>> documentation linked from that article;
>> 
>> 2) modify any code you have that uses a data source (connection pool) to 
>> obtain it from JNDI, using the code in that article
>> 
>> You don't need Struts2 to be able to do this for you, as there are 
>> standard mechanisms you can use instead. Of course the prior reference 
>> to Spring is a good one to look into since Spring provides all sorts of 
>> help in configuring and using data sources and the database beneath them
>> :-)
>> 
>> L.
>> 
>> RajiR wrote:
>>> Hi,
>>> 
>>> In this link :
>>> http://dev.mysql.com/tech-resources/articles/connection_pooling_with_connectorj.html,
>>> we can preform connection pooling only after configuring it in our
>>> configuration files.If it is in the case of struts1, struts-config.xml
>>> file
>>> has a tag called <data-source/> and there we can configure.But,what
>>> about
>>> struts2 how can we configure in its configuration file(struts.xml)?I
>>> think
>>> only after configuring in the configuration file(for eg., struts.xml  in
>>> the
>>> case of struts2),we can use the connection pool using a java program as
>>> it
>>> is explained in the link provided by you.So the problem is with how to
>>> configure the pool in the struts.xml?I think I am clear...!!
>>> 
>>> Thanks.
>>> 
>>> Jeromy Evans - Blue Sky Minds wrote:
>>>>
>>>> RajiR wrote:
>>>>> Can't we implement connection pooling in struts2 alone?If so ,may I
>>>>> know
>>>>> the
>>>>> reason please...!!!
>>>>>
>>>>> Thanks.
>>>>>
>>>>>
>>>>>   
>>>> Struts 2 itself doesn't provide a connection pooling implementation and 
>>>> probably shouldn't.
>>>>
>>>> MySql provide a pooled DataSource that you can use immediately.  Set it 
>>>> up the same way as your current DataSource
>>>> http://dev.mysql.com/tech-resources/articles/connection_pooling_with_connectorj.html
>>>>
>>>> Does that help?
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>>>> For additional commands, e-mail: [EMAIL PROTECTED]
>>>>
>>>>
>>>>
>>> 
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>> 
>> 
>> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Struts2-connection-pooling-using-MySQL-tp15584715p15607230.html
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to