Re: Struts2 connection pooling using MySQL

2008-02-21 Thread RajiR

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 repliesi'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 

Re: Struts2 connection pooling using MySQL

2008-02-21 Thread Dave Newton
--- RajiR [EMAIL PROTECTED] wrote:
 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:

Looks more like you don't have Spring itself on your classpath:

 Caused by: java.lang.NoClassDefFoundError:
 org/springframework/context/ApplicationContextAware

Did you download Spring and include the appropriate jar(s) in your app?

Dave



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



Re: Struts2 connection pooling using MySQL

2008-02-20 Thread Jeromy Evans


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]



Re: Struts2 connection pooling using MySQL

2008-02-20 Thread Frans Thamura
hi there

i got a too many connection when try use spring-hibernate with struts2

and this is not struts2 problem

i think the connection pool is not struts2 responsibility as the controller

and if we use spring, this will become injection work with the
database tech like ORM ot JDBC

F

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



Re: Struts2 connection pooling using MySQL

2008-02-20 Thread RajiR

Can't we implement connection pooling in struts2 alone?If so ,may I know the
reason please...!!!

Thanks.


nuwan chandrasoma-2 wrote:
 
 Hi,
 
 Why do not you give a try with Spring. as struts2 has built in support 
 for spring, you can use springs connection pooling very easily.
 
 Thanks,
 
 Nuwan.
 
 
 
 RajiR wrote:
 Hi All,

 Since struts1 has connection pooling mechanism using data-source/
 tag,what
 is the procedure of connection pooling mechanism in struts2?
  Can we do tht using bean class=/ tag?I have seen from
 some
 of the search results for oracle db using
 class:oracle.jdbc.pool.OracleConnectionCacheImpl. But I need to connect
 to
 MySQL database,how to implement connection pooling in struts.xml for
 mysql
 database?

 Please reply as soon as possible.

 Thanks.
   
 
 
 -
 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-tp15584715p15586219.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]



Re: Struts2 connection pooling using MySQL

2008-02-20 Thread Nuwan Chandrasoma

Hi,

Why do not you give a try with Spring. as struts2 has built in support 
for spring, you can use springs connection pooling very easily.


Thanks,

Nuwan.



RajiR wrote:

Hi All,

Since struts1 has connection pooling mechanism using data-source/ tag,what
is the procedure of connection pooling mechanism in struts2?
 Can we do tht using bean class=/ tag?I have seen from some
of the search results for oracle db using
class:oracle.jdbc.pool.OracleConnectionCacheImpl. But I need to connect to
MySQL database,how to implement connection pooling in struts.xml for mysql
database?

Please reply as soon as possible.

Thanks.
  



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



Re: Struts2 connection pooling using MySQL

2008-02-20 Thread Jeromy Evans
Right.  The configuration file the mysql reference refers to is the 
Container configuration, for example, server.xml or context.xml provided 
with Tomcat.  Every J2EE container provides that configuration.  Struts 
1 provides some config to simply it, but Struts 2 doesn't provide 
convenience config like that.


Setup your DataSource for the Container, then reference it in web.xml.  
eg. 
http://tomcat.apache.org/tomcat-5.5-doc/jndi-datasource-examples-howto.html


The only issue for Struts2 users is how you access the DataSource within 
your actions or services. If you use Spring it's easy via DI.  If you 
Guice it's also easy via DI.  If you don't use a DI container you can 
look-up the DataSource every time you need it, or place the instance in 
your Application Context, as you'd do with a servlet.


Hope that helps.

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]



Re: Struts2 connection pooling using MySQL

2008-02-20 Thread Laurie Harper
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]



Re: Struts2 connection pooling using MySQL

2008-02-20 Thread Frans Thamura
 eg.
 http://tomcat.apache.org/tomcat-5.5-doc/jndi-datasource-examples-howto.html

is this connectio data source is the best implementation

we are using hibernate c3p0, any suggestion

F

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



Re: Struts2 connection pooling using MySQL

2008-02-20 Thread RajiR

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]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Struts2-connection-pooling-using-MySQL-tp15584715p15586542.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]



Re: Struts2 connection pooling using MySQL

2008-02-20 Thread RajiR

Ok,,thx for the repliesi'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-tp15584715p15587014.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]



Re: Struts2 connection pooling using MySQL

2008-02-20 Thread Frans Thamura
dont forget to share the code.


Thx

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