Re: validation xmls in a Struts2 application with no Internet connection
I could not re-produce it with most recent version, 2.3.16. Both DTD versions work correctly on an off-line Tomcat :) I think there is a mis-version-configuration between struts and xwork with that non-maven old application. Sorry for the inconvenience! Thanks! On 12/15/2013 03:53 PM, Lukasz Lenart wrote: Hmm... so it must be some small bug, a typo somewhere. Can you register an issue with the stacktrace and explanation that it works with 1.0.2? Thanks - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: validation xmls in a Struts2 application with no Internet connection
No problem! Thanks for conformation! 2013/12/16 Yasser Zamani yasser.zam...@live.com: I could not re-produce it with most recent version, 2.3.16. Both DTD versions work correctly on an off-line Tomcat :) I think there is a mis-version-configuration between struts and xwork with that non-maven old application. Sorry for the inconvenience! Thanks! On 12/15/2013 03:53 PM, Lukasz Lenart wrote: Hmm... so it must be some small bug, a typo somewhere. Can you register an issue with the stacktrace and explanation that it works with 1.0.2? Thanks - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: validation xmls in a Struts2 application with no Internet connection
2013/12/14 Yasser Zamani yasser.zam...@live.com: Hi there, We have a Struts2 application with some validation XMLs with following DOCTYPE: !DOCTYPE validators PUBLIC -//Apache Struts//XWork Validator 1.0.3//EN http://struts.apache.org/dtds/xwork-validator-1.0.3.dtd; When we run this application on a server which has access to struts.apache.org, there is no problem. But when we run it on a server which has no access to struts.apache.org, Struts can not create default validation interceptor with following exception: Caught Exception while registering Interceptor class org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor - interceptor - jar:file:/home/yasser/Applications/apache-tomcat-7.0.29/webapps/TAAM/WEB-INF/lib/struts2-core-2.3.1.1.jar!/struts-default.xml:148:127 at com.opensymphony.xwork2.ObjectFactory.buildInterceptor(ObjectFactory.java:213) at com.opensymphony.xwork2.config.providers.InterceptorBuilder.constructInterceptorReference(InterceptorBuilder.java:70) at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.lookupInterceptorReference(XmlConfigurationProvider.java:1035) I think it has nothing to do with validators' configuration - XmlConfigurationProvider is used to parse struts.xml, so please check if you use the correct DOCTYPE there https://issues.apache.org/jira/browse/WW-3741 Regards -- Łukasz + 48 606 323 122 http://www.lenart.org.pl/ - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: validation xmls in a Struts2 application with no Internet connection
I reviewed Struts internally and discovered that in all places it uses 1.0.2 instead of 1.0.3. So, I guessed if I rewrite my DOCTYPE to: !DOCTYPE validators PUBLIC -//Apache Struts//XWork Validator 1.0.2//EN http://struts.apache.org/dtds/xwork-validator-1.0.2.dtd; it may work. I tried and yeah, it works! (However, it's some was confusing that xwork-validator-1.0.3.dtd is present in xwork.jar but we cannot use it *offline* until Struts also use it internally) Sorry for the inconvenience! Thanks for your reply. Sincerely Yours, Yasser. On 12/15/2013 01:44 PM, Lukasz Lenart wrote: 2013/12/14 Yasser Zamani yasser.zam...@live.com: Hi there, We have a Struts2 application with some validation XMLs with following DOCTYPE: !DOCTYPE validators PUBLIC -//Apache Struts//XWork Validator 1.0.3//EN http://struts.apache.org/dtds/xwork-validator-1.0.3.dtd; When we run this application on a server which has access to struts.apache.org, there is no problem. But when we run it on a server which has no access to struts.apache.org, Struts can not create default validation interceptor with following exception: Caught Exception while registering Interceptor class org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor - interceptor - jar:file:/home/yasser/Applications/apache-tomcat-7.0.29/webapps/TAAM/WEB-INF/lib/struts2-core-2.3.1.1.jar!/struts-default.xml:148:127 at com.opensymphony.xwork2.ObjectFactory.buildInterceptor(ObjectFactory.java:213) at com.opensymphony.xwork2.config.providers.InterceptorBuilder.constructInterceptorReference(InterceptorBuilder.java:70) at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.lookupInterceptorReference(XmlConfigurationProvider.java:1035) I think it has nothing to do with validators' configuration - XmlConfigurationProvider is used to parse struts.xml, so please check if you use the correct DOCTYPE there https://issues.apache.org/jira/browse/WW-3741 Regards - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: validation xmls in a Struts2 application with no Internet connection
Hmm... so it must be some small bug, a typo somewhere. Can you register an issue with the stacktrace and explanation that it works with 1.0.2? Thanks -- Łukasz + 48 606 323 122 http://www.lenart.org.pl/ 2013/12/15 Yasser Zamani yasser.zam...@live.com: I reviewed Struts internally and discovered that in all places it uses 1.0.2 instead of 1.0.3. So, I guessed if I rewrite my DOCTYPE to: !DOCTYPE validators PUBLIC -//Apache Struts//XWork Validator 1.0.2//EN http://struts.apache.org/dtds/xwork-validator-1.0.2.dtd; it may work. I tried and yeah, it works! (However, it's some was confusing that xwork-validator-1.0.3.dtd is present in xwork.jar but we cannot use it *offline* until Struts also use it internally) Sorry for the inconvenience! Thanks for your reply. Sincerely Yours, Yasser. On 12/15/2013 01:44 PM, Lukasz Lenart wrote: 2013/12/14 Yasser Zamani yasser.zam...@live.com: Hi there, We have a Struts2 application with some validation XMLs with following DOCTYPE: !DOCTYPE validators PUBLIC -//Apache Struts//XWork Validator 1.0.3//EN http://struts.apache.org/dtds/xwork-validator-1.0.3.dtd; When we run this application on a server which has access to struts.apache.org, there is no problem. But when we run it on a server which has no access to struts.apache.org, Struts can not create default validation interceptor with following exception: Caught Exception while registering Interceptor class org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor - interceptor - jar:file:/home/yasser/Applications/apache-tomcat-7.0.29/webapps/TAAM/WEB-INF/lib/struts2-core-2.3.1.1.jar!/struts-default.xml:148:127 at com.opensymphony.xwork2.ObjectFactory.buildInterceptor(ObjectFactory.java:213) at com.opensymphony.xwork2.config.providers.InterceptorBuilder.constructInterceptorReference(InterceptorBuilder.java:70) at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.lookupInterceptorReference(XmlConfigurationProvider.java:1035) I think it has nothing to do with validators' configuration - XmlConfigurationProvider is used to parse struts.xml, so please check if you use the correct DOCTYPE there https://issues.apache.org/jira/browse/WW-3741 Regards - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
validation xmls in a Struts2 application with no Internet connection
Hi there, We have a Struts2 application with some validation XMLs with following DOCTYPE: !DOCTYPE validators PUBLIC -//Apache Struts//XWork Validator 1.0.3//EN http://struts.apache.org/dtds/xwork-validator-1.0.3.dtd; When we run this application on a server which has access to struts.apache.org, there is no problem. But when we run it on a server which has no access to struts.apache.org, Struts can not create default validation interceptor with following exception: Caught Exception while registering Interceptor class org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor - interceptor - jar:file:/home/yasser/Applications/apache-tomcat-7.0.29/webapps/TAAM/WEB-INF/lib/struts2-core-2.3.1.1.jar!/struts-default.xml:148:127 at com.opensymphony.xwork2.ObjectFactory.buildInterceptor(ObjectFactory.java:213) at com.opensymphony.xwork2.config.providers.InterceptorBuilder.constructInterceptorReference(InterceptorBuilder.java:70) at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.lookupInterceptorReference(XmlConfigurationProvider.java:1035) at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadInterceptorStack(XmlConfigurationProvider.java:852) at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadInterceptorStacks(XmlConfigurationProvider.java:865) at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadInterceptors(XmlConfigurationProvider.java:888) at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.addPackage(XmlConfigurationProvider.java:468) at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadPackages(XmlConfigurationProvider.java:278) at org.apache.struts2.config.StrutsXmlConfigurationProvider.loadPackages(StrutsXmlConfigurationProvider.java:112) at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:204) at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:66) at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:390) at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:436) at org.apache.struts2.dispatcher.ng.InitOperations.initDispatcher(InitOperations.java:69) at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.init(StrutsPrepareAndExecuteFilter.java:51) at org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:277) at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:258) at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:382) at org.apache.catalina.core.ApplicationFilterConfig.init(ApplicationFilterConfig.java:103) at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4650) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5306) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:618) at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:963) at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1600) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) at java.util.concurrent.FutureTask.run(FutureTask.java:166) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:724) Caused by: java.lang.RuntimeException: java.lang.RuntimeException: java.lang.RuntimeException: java.lang.RuntimeException: java.lang.RuntimeException: java.lang.RuntimeException: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException at com.opensymphony.xwork2.inject.ContainerImpl$MethodInjector.inject(ContainerImpl.java:295) at com.opensymphony.xwork2.inject.ContainerImpl.inject(ContainerImpl.java:485) at com.opensymphony.xwork2.inject.ContainerImpl$6.call(ContainerImpl.java:523) at com.opensymphony.xwork2.inject.ContainerImpl$6.call(ContainerImpl.java:521) at com.opensymphony.xwork2.inject.ContainerImpl.callInContext(ContainerImpl.java:574) at
Connection between Struts Application and DB.
Hi All, I have my DB and web application running in different machine. And whenever my DB machine restart my application fail since it can't connect to the DB. I have to restart my application every time my DB start. I am using Struts Plug-in to load connection information from web.xml file and creating the DAO factory from the information. DAO factory is stored in servlet context. Now this daoFactory is used by each DAO class to create the connection. This problem exist in my system for long time and trying to fix it. I have put my most code here to make things clear. 1. Context parameter in web.xml context-param descriptionType of DB.{ 1 = Oracle }/description param-namedbType/param-name param-value1/param-value /context-param context-param descriptionResource reference for the database./description param-nameresRef/param-name param-valuejdbc/mydb/param-value /context-param 2. Plug-in configuration in struts-config.xml plug-in className=com.anjib.plugin.DBConfigPlugin 3. My DBConfigPlugin class public class DBConfigPlugin implements PlugIn { private static Log log = LogFactory.getLog(DBConfigPlugin.class.getName()); private DBConfig dbConfig; public void destroy() { //Nothing to do here } public void init(ActionServlet servlet, ModuleConfig config) throws ServletException { ServletContext servletContext = servlet.getServletContext(); /* Create factory for database */ String resRef = servletContext.getInitParameter(resRef); int dbType = 0; if (resRef == null || resRef.trim().length() == 0) { log.fatal(Parameter resRef is null or invalid); } try { dbType = Integer.parseInt(servletContext.getInitParameter(dbType)); } catch (NumberFormatException nfe) { log.fatal(nfe); log.error(Parameter dbType is not numeric); } if (dbType != DBConfig.ORACLE) { log.fatal(Parameter dbType has to be 1 (Oracle)); } DBConfig = new DBConfig(resRef, dbType); DAOFactory daoFactory = DAOFactory.getDAOFactory(DBConfig); servletContext.setAttribute(daoFactory, daoFactory); } public DBConfig getDBConfig() { return DBConfig; } public void setDBConfig(DBConfig DBConfig) { this.DBConfig = DBConfig; } } 4. Create connection in DAOFactory class public abstract class DAOFactory { private DBConfig dbConfig; public static DAOFactory getDAOFactory(DBConfig dbConfig) { switch (dbConfig.getDbType()) { case DBConfig.ORACLE: return new OracleDAOFactory(dbConfig); default: return null; } } public DAOFactory(DBConfig dbConfig) { this.dbConfig = dbConfig; } public Connection createConnection() throws DAOException { try { String str = java:comp/env/ + dbConfig.getResRef(); DataSource dataSource = (DataSource) ServiceLocator.getInstance().getDataSource(str); return dataSource.getConnection(); } catch (SQLException se) { throw new DAOException(se.getMessage(), se); } catch (ServiceLocatorException tase) { throw new DAOException(tase.getMessage(), tase); } } } 5. In my com.anjib.actions.BaseAction class public abstract class BaseAction extends org.apache.struts.action.Action { private static Log log = LogFactory.getLog(BaseAction.class.getName()); protected DAOFactory daoFactory = null; private String message = null; private UserInfo userInfo = null; @Override public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { userInfo = new UserInfo(); setUserInfo((UserInfo) request.getSession().getAttribute(userInfo)); ActionErrors errors = new ActionErrors(); if (request.getSession().getAttribute(loginStatus) == null) { errors.add(error, new ActionMessage(error.notloggedin)); this.saveErrors(request, errors); return mapping.findForward(sessionEnded); } ServletContext servletContext = servlet.getServletContext(); try { daoFactory = (DAOFactory) servletContext.getAttribute(daoFactory); } catch (NullPointerException npex) { log.debug(npex); log.error(Couldn't find the valid
Struts 2 PASSING CONNECTION TO IREPORT
I have created some reports with iReport BY connecting to sql server database, and I tried to integrated them with my struts2 web application. While the documentation for the jasperReport plugin explains how to use a datasource and a compiled template to generate a report, I wasn't able to find out how to use a database connection as a datasource and how to pass parameters to the report. I have the jrxml and jasper files. I need to pass the connection to ireport. Can anyone give me a solution.? Thanking you advance. -- View this message in context: http://struts.1045723.n5.nabble.com/Struts-2-PASSING-CONNECTION-TO-IREPORT-tp5514559p5514559.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
RE: [struts-user] Struts 2 PASSING CONNECTION TO IREPORT
-Original Message- From: Thameem [mailto:thameem@gmail.com] Sent: Saturday, February 25, 2012 0:21 To: user@struts.apache.org Subject: [struts-user] Struts 2 PASSING CONNECTION TO IREPORT I have created some reports with iReport BY connecting to sql server database, and I tried to integrated them with my struts2 web application. While the documentation for the jasperReport plugin explains how to use a datasource and a compiled template to generate a report, I wasn't able to find out how to use a database connection as a datasource and how to pass parameters to the report. I have the jrxml and jasper files. I need to pass the You are not giving much to go on here, are they in the same web application? If not this may be pointless exercise. connection to ireport. Can anyone give me a solution.? *** THIS SOUNDS FISHY TO ME BUT *** Try putting the connection in to the request or session scope. Thanking you advance. -- View this message in context: http://struts.1045723.n5.nabble.com/Struts-2-PASSING-CONNECTIO N-TO-IREPORT-tp5514559p5514559.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Struts 2 PASSING CONNECTION TO IREPORT
The JR plugin expects the datasource to be the S2 action, not a connection. If you have an existing JR report you may want to consider just keeping it as-is and streaming back the result. Dave On Sat, Feb 25, 2012 at 12:20 AM, Thameem thameem@gmail.com wrote: I have created some reports with iReport BY connecting to sql server database, and I tried to integrated them with my struts2 web application. While the documentation for the jasperReport plugin explains how to use a datasource and a compiled template to generate a report, I wasn't able to find out how to use a database connection as a datasource and how to pass parameters to the report. I have the jrxml and jasper files. I need to pass the connection to ireport. Can anyone give me a solution.? Thanking you advance. -- View this message in context: http://struts.1045723.n5.nabble.com/Struts-2-PASSING-CONNECTION-TO-IREPORT-tp5514559p5514559.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Struts 2 PASSING CONNECTION TO IREPORT
My experience with jasper, i prefer not use s2. Use direct query. It is painfull map s2 to report. On Feb 25, 2012 7:20 PM, Thameem thameem@gmail.com wrote: I have created some reports with iReport BY connecting to sql server database, and I tried to integrated them with my struts2 web application. While the documentation for the jasperReport plugin explains how to use a datasource and a compiled template to generate a report, I wasn't able to find out how to use a database connection as a datasource and how to pass parameters to the report. I have the jrxml and jasper files. I need to pass the connection to ireport. Can anyone give me a solution.? Thanking you advance. -- View this message in context: http://struts.1045723.n5.nabble.com/Struts-2-PASSING-CONNECTION-TO-IREPORT-tp5514559p5514559.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
RE: Connection Pooling with Struts
Anjib, i'd certainly take a look at hibernate, i've been using it for a while now and find it easy enough and functionally rich enough for most things. adam Date: Tue, 7 Dec 2010 14:36:01 -0500 From: anji...@hotmail.com To: user@struts.apache.org Subject: Connection Pooling with Struts I have to do DB connection (Oracle 10g) in my application developed in Struts 1.3.8. Currently I am implementing JDBC. As far I understand this is not a good technique for real project. So I am hoping someone could suggest me how to do DB handling efficiently? Thanks Anjib - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Connection Pooling with Struts
Sure I will For time being I used DBCP. Anjib On 12/8/2010 12:54 PM, adam pinder wrote: Anjib, i'd certainly take a look at hibernate, i've been using it for a while now and find it easy enough and functionally rich enough for most things. adam Date: Tue, 7 Dec 2010 14:36:01 -0500 From: anji...@hotmail.com To: user@struts.apache.org Subject: Connection Pooling with Struts I have to do DB connection (Oracle 10g) in my application developed in Struts 1.3.8. Currently I am implementing JDBC. As far I understand this is not a good technique for real project. So I am hoping someone could suggest me how to do DB handling efficiently? Thanks Anjib - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Connection Pooling with Struts
I have to do DB connection (Oracle 10g) in my application developed in Struts 1.3.8. Currently I am implementing JDBC. As far I understand this is not a good technique for real project. So I am hoping someone could suggest me how to do DB handling efficiently? Thanks Anjib - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Connection Pooling with Struts
in java you have the choose which way is the best for your project to handle databases. there exists several frameworks for this job like hibernate, myBatis, spring jdbc tempalate, ... . google for it and look which framework is the best for your project. Johannes anjibman wrote: I have to do DB connection (Oracle 10g) in my application developed in Struts 1.3.8. Currently I am implementing JDBC. As far I understand this is not a good technique for real project. So I am hoping someone could suggest me how to do DB handling efficiently? Thanks Anjib - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - --- web: http://www.jgeppert.com twitter: http://twitter.com/jogep -- View this message in context: http://old.nabble.com/Connection-Pooling-with-Struts-tp30399631p30400023.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Connection Pooling with Struts
I was thinking for Hibernate. So only way for struts is use one of these framework? Anjib On 12/7/2010 3:26 PM, Johannes Geppert wrote: in java you have the choose which way is the best for your project to handle databases. there exists several frameworks for this job like hibernate, myBatis, spring jdbc tempalate, ... . google for it and look which framework is the best for your project. Johannes anjibman wrote: I have to do DB connection (Oracle 10g) in my application developed in Struts 1.3.8. Currently I am implementing JDBC. As far I understand this is not a good technique for real project. So I am hoping someone could suggest me how to do DB handling efficiently? Thanks Anjib - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - --- web: http://www.jgeppert.com twitter: http://twitter.com/jogep - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Connection Pooling with Struts
Nop, You dont need using a framework... if you pick one just will make your life easier! If you`re starting a new project I`d get one framework, however if the project it`s already ready, just keep doing in the same way! On Tue, Dec 7, 2010 at 3:36 PM, Anjib Mulepati anji...@hotmail.com wrote: I was thinking for Hibernate. So only way for struts is use one of these framework? Anjib On 12/7/2010 3:26 PM, Johannes Geppert wrote: in java you have the choose which way is the best for your project to handle databases. there exists several frameworks for this job like hibernate, myBatis, spring jdbc tempalate, ... . google for it and look which framework is the best for your project. Johannes anjibman wrote: I have to do DB connection (Oracle 10g) in my application developed in Struts 1.3.8. Currently I am implementing JDBC. As far I understand this is not a good technique for real project. So I am hoping someone could suggest me how to do DB handling efficiently? Thanks Anjib - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - --- web: http://www.jgeppert.com twitter: http://twitter.com/jogep - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Connection Pooling with Struts
Is the question about connection pooling, as the subject line indicates, or is the question about generic DB handling and JDBC v. ORMs? Dave On Tue, Dec 7, 2010 at 4:20 PM, Arthur Neves arthu...@gmail.com wrote: Nop, You dont need using a framework... if you pick one just will make your life easier! If you`re starting a new project I`d get one framework, however if the project it`s already ready, just keep doing in the same way! On Tue, Dec 7, 2010 at 3:36 PM, Anjib Mulepati anji...@hotmail.com wrote: I was thinking for Hibernate. So only way for struts is use one of these framework? Anjib On 12/7/2010 3:26 PM, Johannes Geppert wrote: in java you have the choose which way is the best for your project to handle databases. there exists several frameworks for this job like hibernate, myBatis, spring jdbc tempalate, ... . google for it and look which framework is the best for your project. Johannes anjibman wrote: I have to do DB connection (Oracle 10g) in my application developed in Struts 1.3.8. Currently I am implementing JDBC. As far I understand this is not a good technique for real project. So I am hoping someone could suggest me how to do DB handling efficiently? Thanks Anjib - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - --- web: http://www.jgeppert.com twitter: http://twitter.com/jogep - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Connection Pooling with Struts
Ok now I get confuse. I was thinking simple JDBC can't (or complex to ) handle connection pooling. So framework make work easy. If framework is not used what are other alternatives to handle connection pooling beside JDBC itself? Anjib On 12/7/2010 4:20 PM, Arthur Neves wrote: Nop, You dont need using a framework... if you pick one just will make your life easier! If you`re starting a new project I`d get one framework, however if the project it`s already ready, just keep doing in the same way! On Tue, Dec 7, 2010 at 3:36 PM, Anjib Mulepatianji...@hotmail.com wrote: I was thinking for Hibernate. So only way for struts is use one of these framework? Anjib On 12/7/2010 3:26 PM, Johannes Geppert wrote: in java you have the choose which way is the best for your project to handle databases. there exists several frameworks for this job like hibernate, myBatis, spring jdbc tempalate, ... . google for it and look which framework is the best for your project. Johannes anjibman wrote: I have to do DB connection (Oracle 10g) in my application developed in Struts 1.3.8. Currently I am implementing JDBC. As far I understand this is not a good technique for real project. So I am hoping someone could suggest me how to do DB handling efficiently? Thanks Anjib - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - --- web: http://www.jgeppert.com twitter: http://twitter.com/jogep - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Connection Pooling with Struts
A connection pooling library? On Tue, Dec 7, 2010 at 4:25 PM, Anjib Mulepati anji...@hotmail.com wrote: Ok now I get confuse. I was thinking simple JDBC can't (or complex to ) handle connection pooling. So framework make work easy. If framework is not used what are other alternatives to handle connection pooling beside JDBC itself? Anjib On 12/7/2010 4:20 PM, Arthur Neves wrote: Nop, You dont need using a framework... if you pick one just will make your life easier! If you`re starting a new project I`d get one framework, however if the project it`s already ready, just keep doing in the same way! On Tue, Dec 7, 2010 at 3:36 PM, Anjib Mulepatianji...@hotmail.com wrote: I was thinking for Hibernate. So only way for struts is use one of these framework? Anjib On 12/7/2010 3:26 PM, Johannes Geppert wrote: in java you have the choose which way is the best for your project to handle databases. there exists several frameworks for this job like hibernate, myBatis, spring jdbc tempalate, ... . google for it and look which framework is the best for your project. Johannes anjibman wrote: I have to do DB connection (Oracle 10g) in my application developed in Struts 1.3.8. Currently I am implementing JDBC. As far I understand this is not a good technique for real project. So I am hoping someone could suggest me how to do DB handling efficiently? Thanks Anjib - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - --- web: http://www.jgeppert.com twitter: http://twitter.com/jogep - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Connection Pooling with Struts
E.g -. http://commons.apache.org/dbcp/ On Tue, Dec 7, 2010 at 4:27 PM, Dave Newton davelnew...@gmail.com wrote: A connection pooling library? On Tue, Dec 7, 2010 at 4:25 PM, Anjib Mulepati anji...@hotmail.com wrote: Ok now I get confuse. I was thinking simple JDBC can't (or complex to ) handle connection pooling. So framework make work easy. If framework is not used what are other alternatives to handle connection pooling beside JDBC itself? Anjib On 12/7/2010 4:20 PM, Arthur Neves wrote: Nop, You dont need using a framework... if you pick one just will make your life easier! If you`re starting a new project I`d get one framework, however if the project it`s already ready, just keep doing in the same way! On Tue, Dec 7, 2010 at 3:36 PM, Anjib Mulepatianji...@hotmail.com wrote: I was thinking for Hibernate. So only way for struts is use one of these framework? Anjib On 12/7/2010 3:26 PM, Johannes Geppert wrote: in java you have the choose which way is the best for your project to handle databases. there exists several frameworks for this job like hibernate, myBatis, spring jdbc tempalate, ... . google for it and look which framework is the best for your project. Johannes anjibman wrote: I have to do DB connection (Oracle 10g) in my application developed in Struts 1.3.8. Currently I am implementing JDBC. As far I understand this is not a good technique for real project. So I am hoping someone could suggest me how to do DB handling efficiently? Thanks Anjib - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - --- web: http://www.jgeppert.com twitter: http://twitter.com/jogep - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Connection Pooling with Struts
So I can use this DBCP Componenet instead of framework? Anjib E.g -. http://commons.apache.org/dbcp/ On Tue, Dec 7, 2010 at 4:27 PM, Dave Newtondavelnew...@gmail.com wrote: A connection pooling library? On Tue, Dec 7, 2010 at 4:25 PM, Anjib Mulepatianji...@hotmail.com wrote: Ok now I get confuse. I was thinking simple JDBC can't (or complex to ) handle connection pooling. So framework make work easy. If framework is not used what are other alternatives to handle connection pooling beside JDBC itself? Anjib On 12/7/2010 4:20 PM, Arthur Neves wrote: Nop, You dont need using a framework... if you pick one just will make your life easier! If you`re starting a new project I`d get one framework, however if the project it`s already ready, just keep doing in the same way! On Tue, Dec 7, 2010 at 3:36 PM, Anjib Mulepatianji...@hotmail.com wrote: I was thinking for Hibernate. So only way for struts is use one of these framework? Anjib On 12/7/2010 3:26 PM, Johannes Geppert wrote: in java you have the choose which way is the best for your project to handle databases. there exists several frameworks for this job like hibernate, myBatis, spring jdbc tempalate, ... . google for it and look which framework is the best for your project. Johannes anjibman wrote: I have to do DB connection (Oracle 10g) in my application developed in Struts 1.3.8. Currently I am implementing JDBC. As far I understand this is not a good technique for real project. So I am hoping someone could suggest me how to do DB handling efficiently? Thanks Anjib - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - --- web: http://www.jgeppert.com twitter: http://twitter.com/jogep - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Connection Pooling with Struts
Dude, I can't sit quietly any longer! How you connect to a database has NOTHING WHATSOEVER to do with the Struts/2 Framework. I would advise you to keep the two separated in your mind. Much like you wouldn't look to a Database connection to serve a web page, neither should you look to Struts/2 as a Database connection. On Tue, Dec 7, 2010 at 3:36 PM, Anjib Mulepati anji...@hotmail.com wrote: So I can use this DBCP Componenet instead of framework? Anjib E.g -. http://commons.apache.org/dbcp/ On Tue, Dec 7, 2010 at 4:27 PM, Dave Newtondavelnew...@gmail.com wrote: A connection pooling library? On Tue, Dec 7, 2010 at 4:25 PM, Anjib Mulepatianji...@hotmail.com wrote: Ok now I get confuse. I was thinking simple JDBC can't (or complex to ) handle connection pooling. So framework make work easy. If framework is not used what are other alternatives to handle connection pooling beside JDBC itself? Anjib On 12/7/2010 4:20 PM, Arthur Neves wrote: Nop, You dont need using a framework... if you pick one just will make your life easier! If you`re starting a new project I`d get one framework, however if the project it`s already ready, just keep doing in the same way! On Tue, Dec 7, 2010 at 3:36 PM, Anjib Mulepatianji...@hotmail.com wrote: I was thinking for Hibernate. So only way for struts is use one of these framework? Anjib On 12/7/2010 3:26 PM, Johannes Geppert wrote: in java you have the choose which way is the best for your project to handle databases. there exists several frameworks for this job like hibernate, myBatis, spring jdbc tempalate, ... . google for it and look which framework is the best for your project. Johannes anjibman wrote: I have to do DB connection (Oracle 10g) in my application developed in Struts 1.3.8. Currently I am implementing JDBC. As far I understand this is not a good technique for real project. So I am hoping someone could suggest me how to do DB handling efficiently? Thanks Anjib - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - --- web: http://www.jgeppert.com twitter: http://twitter.com/jogep - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Connection Pooling with Struts
Dude I am asking about ORM tool not Struts framework itself. Please see the reply from Johannes. Thanks Anjib On 12/7/2010 5:19 PM, stanl...@gmail.com wrote: Dude, I can't sit quietly any longer! How you connect to a database has NOTHING WHATSOEVER to do with the Struts/2 Framework. I would advise you to keep the two separated in your mind. Much like you wouldn't look to a Database connection to serve a web page, neither should you look to Struts/2 as a Database connection. On Tue, Dec 7, 2010 at 3:36 PM, Anjib Mulepatianji...@hotmail.com wrote: So I can use this DBCP Componenet instead of framework? Anjib E.g -. http://commons.apache.org/dbcp/ On Tue, Dec 7, 2010 at 4:27 PM, Dave Newtondavelnew...@gmail.com wrote: A connection pooling library? On Tue, Dec 7, 2010 at 4:25 PM, Anjib Mulepatianji...@hotmail.com wrote: Ok now I get confuse. I was thinking simple JDBC can't (or complex to ) handle connection pooling. So framework make work easy. If framework is not used what are other alternatives to handle connection pooling beside JDBC itself? Anjib On 12/7/2010 4:20 PM, Arthur Neves wrote: Nop, You dont need using a framework... if you pick one just will make your life easier! If you`re starting a new project I`d get one framework, however if the project it`s already ready, just keep doing in the same way! On Tue, Dec 7, 2010 at 3:36 PM, Anjib Mulepatianji...@hotmail.com wrote: I was thinking for Hibernate. So only way for struts is use one of these framework? Anjib On 12/7/2010 3:26 PM, Johannes Geppert wrote: in java you have the choose which way is the best for your project to handle databases. there exists several frameworks for this job like hibernate, myBatis, spring jdbc tempalate, ... . google for it and look which framework is the best for your project. Johannes anjibman wrote: I have to do DB connection (Oracle 10g) in my application developed in Struts 1.3.8. Currently I am implementing JDBC. As far I understand this is not a good technique for real project. So I am hoping someone could suggest me how to do DB handling efficiently? Thanks Anjib - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - --- web: http://www.jgeppert.com twitter: http://twitter.com/jogep - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Connection Pooling with Struts
On Tue, Dec 7, 2010 at 6:15 PM, Anjib wrote: I am asking about ORM tool not Struts framework itself. I think the point was more along the lines of why are you asking here, since you're not asking about the Struts framework. Dave
Re: Connection Pooling with Struts
Then you should be asking on the appropriate list. http://www.catb.org/~esr/faqs/smart-questions.html#forum On Tue, Dec 7, 2010 at 6:15 PM, Anjib anji...@hotmail.com wrote: Dude I am asking about ORM tool not Struts framework itself. Please see the reply from Johannes. Thanks Anjib On 12/7/2010 5:19 PM, stanl...@gmail.com wrote: Dude, I can't sit quietly any longer! How you connect to a database has NOTHING WHATSOEVER to do with the Struts/2 Framework. I would advise you to keep the two separated in your mind. Much like you wouldn't look to a Database connection to serve a web page, neither should you look to Struts/2 as a Database connection. On Tue, Dec 7, 2010 at 3:36 PM, Anjib Mulepatianji...@hotmail.com wrote: So I can use this DBCP Componenet instead of framework? Anjib E.g -. http://commons.apache.org/dbcp/ On Tue, Dec 7, 2010 at 4:27 PM, Dave Newtondavelnew...@gmail.com wrote: A connection pooling library? On Tue, Dec 7, 2010 at 4:25 PM, Anjib Mulepatianji...@hotmail.com wrote: Ok now I get confuse. I was thinking simple JDBC can't (or complex to ) handle connection pooling. So framework make work easy. If framework is not used what are other alternatives to handle connection pooling beside JDBC itself? Anjib On 12/7/2010 4:20 PM, Arthur Neves wrote: Nop, You dont need using a framework... if you pick one just will make your life easier! If you`re starting a new project I`d get one framework, however if the project it`s already ready, just keep doing in the same way! On Tue, Dec 7, 2010 at 3:36 PM, Anjib Mulepatianji...@hotmail.com wrote: I was thinking for Hibernate. So only way for struts is use one of these framework? Anjib On 12/7/2010 3:26 PM, Johannes Geppert wrote: in java you have the choose which way is the best for your project to handle databases. there exists several frameworks for this job like hibernate, myBatis, spring jdbc tempalate, ... . google for it and look which framework is the best for your project. Johannes anjibman wrote: I have to do DB connection (Oracle 10g) in my application developed in Struts 1.3.8. Currently I am implementing JDBC. As far I understand this is not a good technique for real project. So I am hoping someone could suggest me how to do DB handling efficiently? Thanks Anjib - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - --- web: http://www.jgeppert.com twitter: http://twitter.com/jogep - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
RE: Connection Pooling with Struts
careful stan..he has a PhD from an Indian University! Martin __ Man1: in my next life I want to be an attorney from the Middle-East Man1: why do you want to be an attorney from the Middle-East? Man1: so i can work for an American Company Date: Tue, 7 Dec 2010 16:19:48 -0600 Subject: Re: Connection Pooling with Struts From: stanl...@gmail.com To: user@struts.apache.org Dude, I can't sit quietly any longer! How you connect to a database has NOTHING WHATSOEVER to do with the Struts/2 Framework. I would advise you to keep the two separated in your mind. Much like you wouldn't look to a Database connection to serve a web page, neither should you look to Struts/2 as a Database connection. On Tue, Dec 7, 2010 at 3:36 PM, Anjib Mulepati anji...@hotmail.com wrote: So I can use this DBCP Componenet instead of framework? Anjib E.g -. http://commons.apache.org/dbcp/ On Tue, Dec 7, 2010 at 4:27 PM, Dave Newtondavelnew...@gmail.com wrote: A connection pooling library? On Tue, Dec 7, 2010 at 4:25 PM, Anjib Mulepatianji...@hotmail.com wrote: Ok now I get confuse. I was thinking simple JDBC can't (or complex to ) handle connection pooling. So framework make work easy. If framework is not used what are other alternatives to handle connection pooling beside JDBC itself? Anjib On 12/7/2010 4:20 PM, Arthur Neves wrote: Nop, You dont need using a framework... if you pick one just will make your life easier! If you`re starting a new project I`d get one framework, however if the project it`s already ready, just keep doing in the same way! On Tue, Dec 7, 2010 at 3:36 PM, Anjib Mulepatianji...@hotmail.com wrote: I was thinking for Hibernate. So only way for struts is use one of these framework? Anjib On 12/7/2010 3:26 PM, Johannes Geppert wrote: in java you have the choose which way is the best for your project to handle databases. there exists several frameworks for this job like hibernate, myBatis, spring jdbc tempalate, ... . google for it and look which framework is the best for your project. Johannes anjibman wrote: I have to do DB connection (Oracle 10g) in my application developed in Struts 1.3.8. Currently I am implementing JDBC. As far I understand this is not a good technique for real project. So I am hoping someone could suggest me how to do DB handling efficiently? Thanks Anjib - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - --- web: http://www.jgeppert.com twitter: http://twitter.com/jogep - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Error: Cannot get a connection, pool error Timeout waiting for idle object
Hi friends, I am still having the problem, here is the config in my struts-config.xml data-sources data-source type=*org.apache.commons.dbcp.BasicDataSource* set-property property=*driverClassName* value=*com.mysql.jdbc.Driver* / set-property property=*url* value=*jdbc:mysql://localhost:3306/db* / set-property property=*username* value=*root* / set-property property=*maxActive* value=*10* / set-property property=*maxWait* value=*5000* / set-property property=*defaultAutoCommit* value=*false* / set-property property=*defaultReadOnly* value=*false* / /data-source /data-sources thanks abhishek On Sat, Mar 13, 2010 at 4:48 PM, abhishek jain abhishek.netj...@gmail.comwrote: Hi friends. I am using strurts 1 with mysql and is using the datasource in struts-config.xml. I am gettting the following errors in my log file, Cannot get a connection, pool error Timeout waiting for idle object What could be the reason to this error, it seems like this is because of db which is mysql in my case, Pl. advice, what to do in to remove this error, I have searched net and could not find a sol. -- Thanks and kind Regards, Abhishek jain
Re: Error: Cannot get a connection, pool error Timeout waiting for idle object
Hi friends, Additional to the config file i also realized that the connection with my server never ends when viewed on browser, i mean the status bar always says that Waiting for URL., Pl. help on the Error: Cannot get a connection, pool error Timeout waiting for idle object, thanks abhishek On Mon, Mar 15, 2010 at 11:44 AM, abhishek jain abhishek.netj...@gmail.comwrote: Hi friends, I am still having the problem, here is the config in my struts-config.xml data-sources data-source type=*org.apache.commons.dbcp.BasicDataSource* set-property property=*driverClassName* value=*com.mysql.jdbc.Driver* / set-property property=*url* value=*jdbc:mysql://localhost:3306/db* / set-property property=*username* value=*root* / set-property property=*maxActive* value=*10* / set-property property=*maxWait* value=*5000* / set-property property=*defaultAutoCommit* value=*false* / set-property property=*defaultReadOnly* value=*false* / /data-source /data-sources thanks abhishek On Sat, Mar 13, 2010 at 4:48 PM, abhishek jain abhishek.netj...@gmail.com wrote: Hi friends. I am using strurts 1 with mysql and is using the datasource in struts-config.xml. I am gettting the following errors in my log file, Cannot get a connection, pool error Timeout waiting for idle object What could be the reason to this error, it seems like this is because of db which is mysql in my case, Pl. advice, what to do in to remove this error, I have searched net and could not find a sol. -- Thanks and kind Regards, Abhishek jain -- Thanks and kind Regards, Abhishek jain +91 9971376767
Error: Cannot get a connection, pool error Timeout waiting for idle object
Hi friends. I am using strurts 1 with mysql and is using the datasource in struts-config.xml. I am gettting the following errors in my log file, Cannot get a connection, pool error Timeout waiting for idle object What could be the reason to this error, it seems like this is because of db which is mysql in my case, Pl. advice, what to do in to remove this error, I have searched net and could not find a sol. -- Thanks and kind Regards, Abhishek jain
Creating connection object in Handlers
Hi , Is it a best practice to create a connection object in handlers and sending that object to DB functions that are called from handlers? Previously I was creating connection object in every DB function and closing it while coming back. I got some connection issues and now I am creating single connection object in the handler and sending it to every DB function and closing that connecition in the handler finally. Please let me know following this is a best practice or not. thanks in advance Shikai -- View this message in context: http://www.nabble.com/Creating-connection-object-in-Handlers-tp25780832p25780832.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
how to initialize database connection pool in struts 2?
in structs 1, in APPLICATION/WEB-INF/web.xml, i have the following line servlet servlet-nameDBInit/servlet-name servlet-classneuco.db.DBInitServlet/servlet-class load-on-startup1/load-on-startup /servlet to initialize/launch default databse connection pool, how can i do this in struts 2 ? tks in advance john
Re: how to initialize database connection pool in struts 2?
On Tuesday 07 April 2009 21:38:44 john lee wrote: in structs 1, in APPLICATION/WEB-INF/web.xml, i have the following line servlet servlet-nameDBInit/servlet-name servlet-classneuco.db.DBInitServlet/servlet-class load-on-startup1/load-on-startup /servlet to initialize/launch default databse connection pool, how can i do this in struts 2 ? tks in advance john Same way would work... -Wes -- Wes Wannemacher Author - Struts 2 In Practice Includes coverage of Struts 2.1, Spring, JPA, JQuery, Sitemesh and more http://www.manning.com/wannemacher - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
RE: how to initialize database connection pool in struts 2?
You can also use struts 2 spring capability and have the connection given to you through dependency injection. Sid Bhatia Try not. Do... or do not. There is no try -- Yoda _ _ mailto:sidharth.bhat...@gmail.com -Original Message- From: Wes Wannemacher [mailto:w...@wantii.com] Sent: Tuesday, April 07, 2009 11:29 PM To: Struts Users Mailing List Subject: Re: how to initialize database connection pool in struts 2? On Tuesday 07 April 2009 21:38:44 john lee wrote: in structs 1, in APPLICATION/WEB-INF/web.xml, i have the following line servlet servlet-nameDBInit/servlet-name servlet-classneuco.db.DBInitServlet/servlet-class load-on-startup1/load-on-startup /servlet to initialize/launch default databse connection pool, how can i do this in struts 2 ? tks in advance john Same way would work... -Wes -- Wes Wannemacher Author - Struts 2 In Practice Includes coverage of Struts 2.1, Spring, JPA, JQuery, Sitemesh and more http://www.manning.com/wannemacher - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
RE: how to initialize database connection pool in struts 2?
Could you tel me in detail/example? tks in advance john --- On Tue, 4/7/09, Sidharth Bhatia sidharth.bhat...@gmail.com wrote: From: Sidharth Bhatia sidharth.bhat...@gmail.com Subject: RE: how to initialize database connection pool in struts 2? To: 'Struts Users Mailing List' user@struts.apache.org, w...@wantii.com Date: Tuesday, April 7, 2009, 11:06 PM You can also use struts 2 spring capability and have the connection given to you through dependency injection. Sid Bhatia Try not. Do... or do not. There is no try -- Yoda _ _ mailto:sidharth.bhat...@gmail.com -Original Message- From: Wes Wannemacher [mailto:w...@wantii.com] Sent: Tuesday, April 07, 2009 11:29 PM To: Struts Users Mailing List Subject: Re: how to initialize database connection pool in struts 2? On Tuesday 07 April 2009 21:38:44 john lee wrote: in structs 1, in APPLICATION/WEB-INF/web.xml, i have the following line servlet servlet-nameDBInit/servlet-name servlet-classneuco.db.DBInitServlet/servlet-class load-on-startup1/load-on-startup /servlet to initialize/launch default databse connection pool, how can i do this in struts 2 ? tks in advance john Same way would work... -Wes -- Wes Wannemacher Author - Struts 2 In Practice Includes coverage of Struts 2.1, Spring, JPA, JQuery, Sitemesh and more http://www.manning.com/wannemacher - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
RE: JasperReports Plugin:How to specify JDBC connection?
I have been working on using Jasper with Struts2 2.0.11. Looking at the documentation it seems that the dataSource param is looking for a list. The question is what is in the list. Is it a list of connection parameters to the database, ie.. url, login name, password... or is it a list of results? Can anyone point me in the right direction? I have searched the web and cant find an article that shows how to connect to a database and produce a JasperReport from Struts2. Thanks in advance. Mel -Original Message- From: ravindra [mailto:ravin...@btpsoft.com] Sent: Tuesday, January 13, 2009 2:36 AM To: 'Struts Users Mailing List' Subject: RE: JasperReports Plugin:How to specify JDBC connection? *param in the struts.xml (param name=dataSource???/param) The param should be the name of the list object which is used to generate the report.For example, You should have a ListSomePojo mypojoList; as a property in your database which is used to generate the data in the table list.You should populate the list object in your prepare method. (param name=dataSource mypojoList/param -Original Message- From: Rajeshwari Godbole [mailto:rgodb...@gmail.com] Sent: Tuesday, January 13, 2009 2:12 PM To: user@struts.apache.org Subject: JasperReports Plugin:How to specify JDBC connection? Hello, *Problem*: I created a .jrxml report template in iReports that is using an Oracle database to retrieve data. Now I want to plug in this report into a existing webapp using the Struts2 plugin. The webapp uses JDBC to connect to the database. I'm not able to figure out what value to use for the *datasource *param in the struts.xml (param name=dataSource???/param) so that when I click on view report on the GUI, the compiled report template from the *location *param would be called and the data from the Oracle database given in the *datasource *param would be used to generate the report. *Background*: I've searched high and low and seen the last conversation on this between Milan Milanovichttp://www.nabble.com/user/UserProfile.jtp?user=1020045and Dave Newton but inspite of downloading the JasperReportResult.java (that Milan has kindly posted), I'm not able to get this to work. After I got the JasperReportResult.java, I got errors while compiling that required the classes com.opensymphony.xwork2.util.logging.Logger and LoggerFactory so I got xwork-2.1.0.jar that has the logging classes (was using xwork-2.0.5 earlier). Now I'm getting an error on line 288 that says Connection cannot be resolved (Connection conn = (Connection)stack.findValue(connection)). I tried importing java.sql package that fixes the compilation but still does not work Now, I get the error: java.lang.ClassCastException: java.lang.String org.apache.struts2.views.jasperreports.JasperReportsResult.doExecute(JasperR eportsResult.java:288) org.apache.struts2.dispatcher.StrutsResultSupport.execute(StrutsResultSuppor t.java:178) . Please help! Many thanks in advance. Given below is my action class and setting in struts.xml. I've the following in struts.xml: param name=connectionconnect/param and the following in my action: package com.db.mq.mon.report.ui.test.action; import java.sql.Connection; import java.sql.Driver; import java.sql.DriverManager; import java.util.ArrayList; import com.opensymphony.xwork2.ActionSupport; * * Jan 9, 2009 * */ public class AppReportAction extends ActionSupport { /** * */ private static final long serialVersionUID = 7763977968848348929L; private Connection myConn; private String connect; private ArrayListConnection dataSource = new ArrayListConnection(); public String execute() throws Exception { DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver()); myConn = DriverManager.getConnection(jdbc:oracle:thin:@192.168.120.102:1521:tvmdev, user2, sena120); connect = jdbc:oracle:thin:@192.168.120.102:1521:tvmdev; dataSource.add(myConn); return SUCCESS; } /** * @return the dataSource */ public ArrayList getDataSource() { return dataSource; } /** * @param dataSource the dataSource to set */ public void setDataSource(ArrayList dataSource) { this.dataSource = dataSource; } /** * @return the connect */ public String getConnect() { return connect; } /** * @param connect the connect to set */ public void setConnect(String connect) { this.connect = connect; } } http://www.nabble.com/user/UserProfile.jtp?user=1020045 - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
RE: JasperReports Plugin:How to specify JDBC connection?
List = ResultSet from Oracle. If you can project your resultset into Objects then you can address properties in the jasper report by fieldName. To be perfectly honest it has been a while since I have worked with raw JDBC objects, so I cannot remember what object you create to execute SQL to return a list. But lets say its a Query object. If you cannot project to objects then your list is usually filled with Objects[]s. Each entry in each array represents a column value in the row. So row = Object array. When you are passing a ListObject[] to JasperReports I am not sure how to address the fields but I am sure the syntax is something like field[0]. I don't know if there is a keyword like field or its just [0]. Mel Rosenberg-2 wrote: I have been working on using Jasper with Struts2 2.0.11. Looking at the documentation it seems that the dataSource param is looking for a list. The question is what is in the list. Is it a list of connection parameters to the database, ie.. url, login name, password... or is it a list of results? Can anyone point me in the right direction? I have searched the web and cant find an article that shows how to connect to a database and produce a JasperReport from Struts2. Thanks in advance. Mel -Original Message- From: ravindra [mailto:ravin...@btpsoft.com] Sent: Tuesday, January 13, 2009 2:36 AM To: 'Struts Users Mailing List' Subject: RE: JasperReports Plugin:How to specify JDBC connection? *param in the struts.xml (???) The param should be the name of the list object which is used to generate the report.For example, You should have a ListSomePojo mypojoList; as a property in your database which is used to generate the data in the table list.You should populate the list object in your prepare method. ( mypojoList -Original Message- From: Rajeshwari Godbole [mailto:rgodb...@gmail.com] Sent: Tuesday, January 13, 2009 2:12 PM To: user@struts.apache.org Subject: JasperReports Plugin:How to specify JDBC connection? Hello, *Problem*: I created a .jrxml report template in iReports that is using an Oracle database to retrieve data. Now I want to plug in this report into a existing webapp using the Struts2 plugin. The webapp uses JDBC to connect to the database. I'm not able to figure out what value to use for the *datasource *param in the struts.xml (???) so that when I click on view report on the GUI, the compiled report template from the *location *param would be called and the data from the Oracle database given in the *datasource *param would be used to generate the report. *Background*: I've searched high and low and seen the last conversation on this between Milan Milanovichttp://www.nabble.com/user/UserProfile.jtp?user=1020045and Dave Newton but inspite of downloading the JasperReportResult.java (that Milan has kindly posted), I'm not able to get this to work. After I got the JasperReportResult.java, I got errors while compiling that required the classes com.opensymphony.xwork2.util.logging.Logger and LoggerFactory so I got xwork-2.1.0.jar that has the logging classes (was using xwork-2.0.5 earlier). Now I'm getting an error on line 288 that says Connection cannot be resolved (Connection conn = (Connection)stack.findValue(connection)). I tried importing java.sql package that fixes the compilation but still does not work Now, I get the error: java.lang.ClassCastException: java.lang.String org.apache.struts2.views.jasperreports.JasperReportsResult.doExecute(JasperR eportsResult.java:288) org.apache.struts2.dispatcher.StrutsResultSupport.execute(StrutsResultSuppor t.java:178) . Please help! Many thanks in advance. Given below is my action class and setting in struts.xml. I've the following in struts.xml: connect and the following in my action: package com.db.mq.mon.report.ui.test.action; import java.sql.Connection; import java.sql.Driver; import java.sql.DriverManager; import java.util.ArrayList; import com.opensymphony.xwork2.ActionSupport; * * Jan 9, 2009 * */ public class AppReportAction extends ActionSupport { /** * */ private static final long serialVersionUID = 7763977968848348929L; private Connection myConn; private String connect; private ArrayListConnection dataSource = new ArrayListConnection(); public String execute() throws Exception { DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver()); myConn = DriverManager.getConnection(jdbc:oracle:thin:@192.168.120.102:1521:tvmdev, user2, sena120); connect = jdbc:oracle:thin:@192.168.120.102:1521:tvmdev; dataSource.add(myConn); return SUCCESS; } /** * @return the dataSource */ public ArrayList getDataSource() { return dataSource; } /** * @param dataSource the dataSource to set */ public void
Re: JasperReports Plugin:How to specify JDBC connection?
Mel Rosenberg wrote: I have been working on using Jasper with Struts2 2.0.11. Looking at the documentation it seems that the dataSource param is looking for a list. The question is what is in the list. Is it a list of connection parameters to the database, ie.. url, login name, password... or is it a list of results? Can anyone point me in the right direction? I have searched the web and cant find an article that shows how to connect to a database and produce a JasperReport from Struts2. The list is a JR data source used as the iterable object in the report (list of results). Dave - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
JasperReports Plugin:How to specify JDBC connection?
Hello, *Problem*: I created a .jrxml report template in iReports that is using an Oracle database to retrieve data. Now I want to plug in this report into a existing webapp using the Struts2 plugin. The webapp uses JDBC to connect to the database. I'm not able to figure out what value to use for the *datasource *param in the struts.xml (param name=dataSource???/param) so that when I click on view report on the GUI, the compiled report template from the *location *param would be called and the data from the Oracle database given in the *datasource *param would be used to generate the report. *Background*: I've searched high and low and seen the last conversation on this between Milan Milanovichttp://www.nabble.com/user/UserProfile.jtp?user=1020045and Dave Newton but inspite of downloading the JasperReportResult.java (that Milan has kindly posted), I'm not able to get this to work. After I got the JasperReportResult.java, I got errors while compiling that required the classes com.opensymphony.xwork2.util.logging.Logger and LoggerFactory so I got xwork-2.1.0.jar that has the logging classes (was using xwork-2.0.5 earlier). Now I'm getting an error on line 288 that says Connection cannot be resolved (Connection conn = (Connection)stack.findValue(connection)). I tried importing java.sql package that fixes the compilation but still does not work Now, I get the error: java.lang.ClassCastException: java.lang.String org.apache.struts2.views.jasperreports.JasperReportsResult.doExecute(JasperReportsResult.java:288) org.apache.struts2.dispatcher.StrutsResultSupport.execute(StrutsResultSupport.java:178) . Please help! Many thanks in advance. Given below is my action class and setting in struts.xml. I've the following in struts.xml: param name=connectionconnect/param and the following in my action: package com.db.mq.mon.report.ui.test.action; import java.sql.Connection; import java.sql.Driver; import java.sql.DriverManager; import java.util.ArrayList; import com.opensymphony.xwork2.ActionSupport; * * Jan 9, 2009 * */ public class AppReportAction extends ActionSupport { /** * */ private static final long serialVersionUID = 7763977968848348929L; private Connection myConn; private String connect; private ArrayListConnection dataSource = new ArrayListConnection(); public String execute() throws Exception { DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver()); myConn = DriverManager.getConnection(jdbc:oracle:thin:@192.168.120.102:1521:tvmdev, user2, sena120); connect = jdbc:oracle:thin:@192.168.120.102:1521:tvmdev; dataSource.add(myConn); return SUCCESS; } /** * @return the dataSource */ public ArrayList getDataSource() { return dataSource; } /** * @param dataSource the dataSource to set */ public void setDataSource(ArrayList dataSource) { this.dataSource = dataSource; } /** * @return the connect */ public String getConnect() { return connect; } /** * @param connect the connect to set */ public void setConnect(String connect) { this.connect = connect; } } http://www.nabble.com/user/UserProfile.jtp?user=1020045
RE: JasperReports Plugin:How to specify JDBC connection?
*param in the struts.xml (param name=dataSource???/param) The param should be the name of the list object which is used to generate the report.For example, You should have a ListSomePojo mypojoList; as a property in your database which is used to generate the data in the table list.You should populate the list object in your prepare method. (param name=dataSource mypojoList/param -Original Message- From: Rajeshwari Godbole [mailto:rgodb...@gmail.com] Sent: Tuesday, January 13, 2009 2:12 PM To: user@struts.apache.org Subject: JasperReports Plugin:How to specify JDBC connection? Hello, *Problem*: I created a .jrxml report template in iReports that is using an Oracle database to retrieve data. Now I want to plug in this report into a existing webapp using the Struts2 plugin. The webapp uses JDBC to connect to the database. I'm not able to figure out what value to use for the *datasource *param in the struts.xml (param name=dataSource???/param) so that when I click on view report on the GUI, the compiled report template from the *location *param would be called and the data from the Oracle database given in the *datasource *param would be used to generate the report. *Background*: I've searched high and low and seen the last conversation on this between Milan Milanovichttp://www.nabble.com/user/UserProfile.jtp?user=1020045and Dave Newton but inspite of downloading the JasperReportResult.java (that Milan has kindly posted), I'm not able to get this to work. After I got the JasperReportResult.java, I got errors while compiling that required the classes com.opensymphony.xwork2.util.logging.Logger and LoggerFactory so I got xwork-2.1.0.jar that has the logging classes (was using xwork-2.0.5 earlier). Now I'm getting an error on line 288 that says Connection cannot be resolved (Connection conn = (Connection)stack.findValue(connection)). I tried importing java.sql package that fixes the compilation but still does not work Now, I get the error: java.lang.ClassCastException: java.lang.String org.apache.struts2.views.jasperreports.JasperReportsResult.doExecute(JasperR eportsResult.java:288) org.apache.struts2.dispatcher.StrutsResultSupport.execute(StrutsResultSuppor t.java:178) . Please help! Many thanks in advance. Given below is my action class and setting in struts.xml. I've the following in struts.xml: param name=connectionconnect/param and the following in my action: package com.db.mq.mon.report.ui.test.action; import java.sql.Connection; import java.sql.Driver; import java.sql.DriverManager; import java.util.ArrayList; import com.opensymphony.xwork2.ActionSupport; * * Jan 9, 2009 * */ public class AppReportAction extends ActionSupport { /** * */ private static final long serialVersionUID = 7763977968848348929L; private Connection myConn; private String connect; private ArrayListConnection dataSource = new ArrayListConnection(); public String execute() throws Exception { DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver()); myConn = DriverManager.getConnection(jdbc:oracle:thin:@192.168.120.102:1521:tvmdev, user2, sena120); connect = jdbc:oracle:thin:@192.168.120.102:1521:tvmdev; dataSource.add(myConn); return SUCCESS; } /** * @return the dataSource */ public ArrayList getDataSource() { return dataSource; } /** * @param dataSource the dataSource to set */ public void setDataSource(ArrayList dataSource) { this.dataSource = dataSource; } /** * @return the connect */ public String getConnect() { return connect; } /** * @param connect the connect to set */ public void setConnect(String connect) { this.connect = connect; } } http://www.nabble.com/user/UserProfile.jtp?user=1020045 - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: [S2] Struts + JasperReports (iReport) - setting connection
Dear Dave, have you maybe managed to find time to see how we can define datasource in JasperReports for this kind of integration between Struts 2 and Jasper ? -- Thx, M. Milan Milanovic wrote: Dear Dave, it would be great if you can, because I'm just not sure what to set up in Jasper for datasource in this case, because it have more than 10 possible data sources to set. Is it JavaBeans set data source where I need to set Factory class and static method to call to retrieve array of the collection of javaBeans or it is maybe Custom JRDataSource where I need to set up also Factory class and that static method. In JasperReportsResult, you are calling this: JasperFillManager.fillReport(jasperReport, parameters, stackDataSource); where stackDataSource is JRDataSource. So you need somehow to set this datasource in report. -- Thx, M. newton.dave wrote: --- On Thu, 12/11/08, Milan Milanovic wrote: O.K. Thank you. When Jasper report is designed I need to set datasource for it and for every type of data source I need to fill those elements (data source class, method which return data source elements, etc.). There is no such things explained in Struts 2 JasperReports Tutorial. I don't recall having to do anything particularly weird in iReport, but I may have time to check later. I didn't have to do anything about a method that returned data source elements, though. Dave - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org -- View this message in context: http://www.nabble.com/-S2--Struts-%2B-JasperReports-%28iReport%29---setting-connection-tp20937308p20981232.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: [S2] Struts + JasperReports (iReport) - setting connection
Nope. --- On Fri, 12/12/08, Milan Milanovic milanmilanov...@yahoo.com wrote: From: Milan Milanovic milanmilanov...@yahoo.com Subject: Re: [S2] Struts + JasperReports (iReport) - setting connection To: user@struts.apache.org Date: Friday, December 12, 2008, 1:41 PM Dear Dave, have you maybe managed to find time to see how we can define datasource in JasperReports for this kind of integration between Struts 2 and Jasper ? -- Thx, M. Milan Milanovic wrote: Dear Dave, it would be great if you can, because I'm just not sure what to set up in Jasper for datasource in this case, because it have more than 10 possible data sources to set. Is it JavaBeans set data source where I need to set Factory class and static method to call to retrieve array of the collection of javaBeans or it is maybe Custom JRDataSource where I need to set up also Factory class and that static method. In JasperReportsResult, you are calling this: JasperFillManager.fillReport(jasperReport, parameters, stackDataSource); where stackDataSource is JRDataSource. So you need somehow to set this datasource in report. -- Thx, M. newton.dave wrote: --- On Thu, 12/11/08, Milan Milanovic wrote: O.K. Thank you. When Jasper report is designed I need to set datasource for it and for every type of data source I need to fill those elements (data source class, method which return data source elements, etc.). There is no such things explained in Struts 2 JasperReports Tutorial. I don't recall having to do anything particularly weird in iReport, but I may have time to check later. I didn't have to do anything about a method that returned data source elements, though. Dave - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org -- View this message in context: http://www.nabble.com/-S2--Struts-%2B-JasperReports-%28iReport%29---setting-connection-tp20937308p20981232.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: [S2] Struts + JasperReports (iReport) - setting connection
Dear Dave, O.K. I'm waiting for your (or anyone else's) answer. I asked the same thing on JR forum, so maybe I will get there answer, too. -- M. newton.dave wrote: Nope. --- On Fri, 12/12/08, Milan Milanovic milanmilanov...@yahoo.com wrote: From: Milan Milanovic milanmilanov...@yahoo.com Subject: Re: [S2] Struts + JasperReports (iReport) - setting connection To: user@struts.apache.org Date: Friday, December 12, 2008, 1:41 PM Dear Dave, have you maybe managed to find time to see how we can define datasource in JasperReports for this kind of integration between Struts 2 and Jasper ? -- Thx, M. Milan Milanovic wrote: Dear Dave, it would be great if you can, because I'm just not sure what to set up in Jasper for datasource in this case, because it have more than 10 possible data sources to set. Is it JavaBeans set data source where I need to set Factory class and static method to call to retrieve array of the collection of javaBeans or it is maybe Custom JRDataSource where I need to set up also Factory class and that static method. In JasperReportsResult, you are calling this: JasperFillManager.fillReport(jasperReport, parameters, stackDataSource); where stackDataSource is JRDataSource. So you need somehow to set this datasource in report. -- Thx, M. newton.dave wrote: --- On Thu, 12/11/08, Milan Milanovic wrote: O.K. Thank you. When Jasper report is designed I need to set datasource for it and for every type of data source I need to fill those elements (data source class, method which return data source elements, etc.). There is no such things explained in Struts 2 JasperReports Tutorial. I don't recall having to do anything particularly weird in iReport, but I may have time to check later. I didn't have to do anything about a method that returned data source elements, though. Dave - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org -- View this message in context: http://www.nabble.com/-S2--Struts-%2B-JasperReports-%28iReport%29---setting-connection-tp20937308p20981232.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org -- View this message in context: http://www.nabble.com/-S2--Struts-%2B-JasperReports-%28iReport%29---setting-connection-tp20937308p20981719.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
[OT] Re: [S2] Struts + JasperReports (iReport) - setting connection
I don't have anything configured in iReport for accessing data. I'm not even sure you could, since it's a non-standard data source, i.e., since value stack data source is meaningless outside S2 there would be no way for iReport to do anything about it. IIRC I used iReport for some of the initial layout but ended up resorting to editing the XML file (this was iReport 2.0.mumble, maybe iReport 3+ is better). Dave --- On Fri, 12/12/08, Milan Milanovic milanmilanov...@yahoo.com wrote: From: Milan Milanovic milanmilanov...@yahoo.com Subject: Re: [S2] Struts + JasperReports (iReport) - setting connection To: user@struts.apache.org Date: Friday, December 12, 2008, 2:10 PM Dear Dave, O.K. I'm waiting for your (or anyone else's) answer. I asked the same thing on JR forum, so maybe I will get there answer, too. -- M. newton.dave wrote: Nope. --- On Fri, 12/12/08, Milan Milanovic milanmilanov...@yahoo.com wrote: From: Milan Milanovic milanmilanov...@yahoo.com Subject: Re: [S2] Struts + JasperReports (iReport) - setting connection To: user@struts.apache.org Date: Friday, December 12, 2008, 1:41 PM Dear Dave, have you maybe managed to find time to see how we can define datasource in JasperReports for this kind of integration between Struts 2 and Jasper ? -- Thx, M. Milan Milanovic wrote: Dear Dave, it would be great if you can, because I'm just not sure what to set up in Jasper for datasource in this case, because it have more than 10 possible data sources to set. Is it JavaBeans set data source where I need to set Factory class and static method to call to retrieve array of the collection of javaBeans or it is maybe Custom JRDataSource where I need to set up also Factory class and that static method. In JasperReportsResult, you are calling this: JasperFillManager.fillReport(jasperReport, parameters, stackDataSource); where stackDataSource is JRDataSource. So you need somehow to set this datasource in report. -- Thx, M. newton.dave wrote: --- On Thu, 12/11/08, Milan Milanovic wrote: O.K. Thank you. When Jasper report is designed I need to set datasource for it and for every type of data source I need to fill those elements (data source class, method which return data source elements, etc.). There is no such things explained in Struts 2 JasperReports Tutorial. I don't recall having to do anything particularly weird in iReport, but I may have time to check later. I didn't have to do anything about a method that returned data source elements, though. Dave - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org -- View this message in context: http://www.nabble.com/-S2--Struts-%2B-JasperReports-%28iReport%29---setting-connection-tp20937308p20981232.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org -- View this message in context: http://www.nabble.com/-S2--Struts-%2B-JasperReports-%28iReport%29---setting-connection-tp20937308p20981719.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: [OT] Re: [S2] Struts + JasperReports (iReport) - setting connection
Dear Dave, O.K. I found the way to solve this. I will explain it where, maybe you can update Jasper tutorial. You need first to put your class that is located in a list for passing to JasperReports, into classpath in iReport (it have option for setting classpath). Then in data source query one need to choose Java bean data source and to enter full package.Class, and then access to its fields is enabled to be put in report. -- Milan newton.dave wrote: I don't have anything configured in iReport for accessing data. I'm not even sure you could, since it's a non-standard data source, i.e., since value stack data source is meaningless outside S2 there would be no way for iReport to do anything about it. IIRC I used iReport for some of the initial layout but ended up resorting to editing the XML file (this was iReport 2.0.mumble, maybe iReport 3+ is better). Dave --- On Fri, 12/12/08, Milan Milanovic milanmilanov...@yahoo.com wrote: From: Milan Milanovic milanmilanov...@yahoo.com Subject: Re: [S2] Struts + JasperReports (iReport) - setting connection To: user@struts.apache.org Date: Friday, December 12, 2008, 2:10 PM Dear Dave, O.K. I'm waiting for your (or anyone else's) answer. I asked the same thing on JR forum, so maybe I will get there answer, too. -- M. newton.dave wrote: Nope. --- On Fri, 12/12/08, Milan Milanovic milanmilanov...@yahoo.com wrote: From: Milan Milanovic milanmilanov...@yahoo.com Subject: Re: [S2] Struts + JasperReports (iReport) - setting connection To: user@struts.apache.org Date: Friday, December 12, 2008, 1:41 PM Dear Dave, have you maybe managed to find time to see how we can define datasource in JasperReports for this kind of integration between Struts 2 and Jasper ? -- Thx, M. Milan Milanovic wrote: Dear Dave, it would be great if you can, because I'm just not sure what to set up in Jasper for datasource in this case, because it have more than 10 possible data sources to set. Is it JavaBeans set data source where I need to set Factory class and static method to call to retrieve array of the collection of javaBeans or it is maybe Custom JRDataSource where I need to set up also Factory class and that static method. In JasperReportsResult, you are calling this: JasperFillManager.fillReport(jasperReport, parameters, stackDataSource); where stackDataSource is JRDataSource. So you need somehow to set this datasource in report. -- Thx, M. newton.dave wrote: --- On Thu, 12/11/08, Milan Milanovic wrote: O.K. Thank you. When Jasper report is designed I need to set datasource for it and for every type of data source I need to fill those elements (data source class, method which return data source elements, etc.). There is no such things explained in Struts 2 JasperReports Tutorial. I don't recall having to do anything particularly weird in iReport, but I may have time to check later. I didn't have to do anything about a method that returned data source elements, though. Dave - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org -- View this message in context: http://www.nabble.com/-S2--Struts-%2B-JasperReports-%28iReport%29---setting-connection-tp20937308p20981232.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org -- View this message in context: http://www.nabble.com/-S2--Struts-%2B-JasperReports-%28iReport%29---setting-connection-tp20937308p20981719.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org -- View this message in context: http://www.nabble.com/-S2--Struts-%2B-JasperReports-%28iReport%29---setting-connection-tp20937308p20983764.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e
Re: [S2] Struts + JasperReports (iReport) - setting connection
No one knows how to set-up Jasper report connection for this kind integration with Struts 2 ? -- M. Milan Milanovic wrote: Hi, I'm following this tutorial for integrating JasperReports in Struts app: http://struts.apache.org/2.0.14/docs/jasperreports-tutorial.html http://struts.apache.org/2.0.14/docs/jasperreports-tutorial.html . But I'm wondering how I should set up my connection on my report (e.g., in iReport designer) ? Should I set Custom JRDataSource, but what is Factory class then and its static metod to retrieve JRDataSource ? I know that ValueStackDataSource implements JRDataSource, but what I should set up in my report ? -- Thx, Milan -- View this message in context: http://www.nabble.com/-S2--Struts-%2B-JasperReports-%28iReport%29---setting-connection-tp20937308p20953678.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: [S2] Struts + JasperReports (iReport) - setting connection
--- On Thu, 12/11/08, Milan Milanovic wrote: No one knows how to set-up Jasper report connection for this kind integration with Struts 2 ? You've gotta have a little more patience. I'll see how my report is configured, but I don't recall anything about a factory in the report itself; I thought I just set the datasource. Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [S2] Struts + JasperReports (iReport) - setting connection
Dear Dave, O.K. Thank you. When Jasper report is designed I need to set datasource for it and for every type of data source I need to fill those elements (data source class, method which return data source elements, etc.). There is no such things explained in Struts 2 JasperReports Tutorial. -- Thx, M. newton.dave wrote: --- On Thu, 12/11/08, Milan Milanovic wrote: No one knows how to set-up Jasper report connection for this kind integration with Struts 2 ? You've gotta have a little more patience. I'll see how my report is configured, but I don't recall anything about a factory in the report itself; I thought I just set the datasource. Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/-S2--Struts-%2B-JasperReports-%28iReport%29---setting-connection-tp20937308p20956141.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: [S2] Struts + JasperReports (iReport) - setting connection
--- On Thu, 12/11/08, Milan Milanovic wrote: O.K. Thank you. When Jasper report is designed I need to set datasource for it and for every type of data source I need to fill those elements (data source class, method which return data source elements, etc.). There is no such things explained in Struts 2 JasperReports Tutorial. I don't recall having to do anything particularly weird in iReport, but I may have time to check later. I didn't have to do anything about a method that returned data source elements, though. Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [S2] Struts + JasperReports (iReport) - setting connection
Dear Dave, it would be great if you can, because I'm just not sure what to set up in Jasper for datasource in this case, because it have more than 10 possible data sources to set. Is it JavaBeans set data source where I need to set Factory class and static method to call to retrieve array of the collection of javaBeans or it is maybe Custom JRDataSource where I need to set up also Factory class and that static method. -- Thx, M. newton.dave wrote: --- On Thu, 12/11/08, Milan Milanovic wrote: O.K. Thank you. When Jasper report is designed I need to set datasource for it and for every type of data source I need to fill those elements (data source class, method which return data source elements, etc.). There is no such things explained in Struts 2 JasperReports Tutorial. I don't recall having to do anything particularly weird in iReport, but I may have time to check later. I didn't have to do anything about a method that returned data source elements, though. Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/-S2--Struts-%2B-JasperReports-%28iReport%29---setting-connection-tp20937308p20956829.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]
[S2] Struts + JasperReports (iReport) - setting connection
Hi, I'm following this tutorial for integrating JasperReports in Struts app: http://struts.apache.org/2.0.14/docs/jasperreports-tutorial.html http://struts.apache.org/2.0.14/docs/jasperreports-tutorial.html . But I'm wondering how I should set up my connection on my report (e.g., in iReport designer) ? Should I set Custom JRDataSource, but what is Factory class then and its static metod to retrieve JRDataSource ? I know that ValueStackDataSource implements JRDataSource, but what I should set up in my report ? -- Thx, Milan -- View this message in context: http://www.nabble.com/-S2--Struts-%2B-JasperReports-%28iReport%29---setting-connection-tp20937308p20937308.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: connection to db with pooling in Struts
You can use this little snippet to get a connection: public Connection getConnection(String url, String driverClassName, String username, String password) throws SQLException { try { Class.forName(driverClassName); } catch (ClassNotFoundException e) { throw new SQLException(e.getMessage()); } if (username == null) { return DriverManager.getConnection(url); } return DriverManager.getConnection(url, username, password); } Personally I use hibernate with spring or guice to deal with all that connection junk these days. gbattine wrote: Hello guys, I'm newbie about Struts and I'm trying to understand a complex task (for me), that is obtaining a connection from connection pool (I use dbcp for this) and a datasource (that one of tomcat) and use this connection in dao layer. I'm trying to get this working, but it seems very difficult to me. Could you help me? I show what I did: -I added context in server.xml of tomcat -I added declaration into web.xml of application, like this: resource-ref descriptionDB Connection/description res-ref-namejdbc/TestDB/res-ref-name res-typejavax.sql.DataSource/res-type res-authContainer/res-auth /resource-ref Now my first question. What's next step? Could you please post simple code and comment to understand? What I imagine is now to have something to retrieve a connection and pass it to dao. Could you help me? Thanks very much -- View this message in context: http://www.nabble.com/connection-to-db-with-pooling-in-Struts-tp20738163p20767037.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: connection to db with pooling in Struts
That won't use the pool. Take a look at some of the code snippets at [1] Nils-H [1] - http://tomcat.apache.org/tomcat-6.0-doc/jndi-datasource-examples-howto.html On Mon, Dec 1, 2008 at 8:09 AM, Adam Ruggles [EMAIL PROTECTED] wrote: You can use this little snippet to get a connection: public Connection getConnection(String url, String driverClassName, String username, String password) throws SQLException { try { Class.forName(driverClassName); } catch (ClassNotFoundException e) { throw new SQLException(e.getMessage()); } if (username == null) { return DriverManager.getConnection(url); } return DriverManager.getConnection(url, username, password); } Personally I use hibernate with spring or guice to deal with all that connection junk these days. gbattine wrote: Hello guys, I'm newbie about Struts and I'm trying to understand a complex task (for me), that is obtaining a connection from connection pool (I use dbcp for this) and a datasource (that one of tomcat) and use this connection in dao layer. I'm trying to get this working, but it seems very difficult to me. Could you help me? I show what I did: -I added context in server.xml of tomcat -I added declaration into web.xml of application, like this: resource-ref descriptionDB Connection/description res-ref-namejdbc/TestDB/res-ref-name res-typejavax.sql.DataSource/res-type res-authContainer/res-auth /resource-ref Now my first question. What's next step? Could you please post simple code and comment to understand? What I imagine is now to have something to retrieve a connection and pass it to dao. Could you help me? Thanks very much -- View this message in context: http://www.nabble.com/connection-to-db-with-pooling-in-Struts-tp20738163p20767037.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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
connection to db with pooling in Struts
Hello guys, I'm newbie about Struts and I'm trying to understand a complex task (for me), that is obtaining a connection from connection pool (I use dbcp for this) and a datasource (that one of tomcat) and use this connection in dao layer. I'm trying to get this working, but it seems very difficult to me. Could you help me? I show what I did: -I added context in server.xml of tomcat -I added declaration into web.xml of application, like this: resource-ref descriptionDB Connection/description res-ref-namejdbc/TestDB/res-ref-name res-typejavax.sql.DataSource/res-type res-authContainer/res-auth /resource-ref Now my first question. What's next step? Could you please post simple code and comment to understand? What I imagine is now to have something to retrieve a connection and pass it to dao. Could you help me? Thanks very much -- View this message in context: http://www.nabble.com/connection-to-db-with-pooling-in-Struts-tp20738163p20738163.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]
Struts 2 Database Connection Pooling
I need to implement a database connection pool and was considering using the JNDI facilities provided by the servlet container (in my case, Apache Tomcat). Is there a Struts pattern for accessing JNDI resources in (a) a container neutral manner and (b) without tying my action classes to the servlet api or would I be better off creating an independant connection pool and injecting it through Spring? Regards - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts 2 Database Connection Pooling
AFAIK, there is no pattern. You can configure a datasource through Spring, or you could get it from JNDI once when your app starts (by writing a ServletContextListener) 2008/8/20, Roger [EMAIL PROTECTED]: I need to implement a database connection pool and was considering using the JNDI facilities provided by the servlet container (in my case, Apache Tomcat). Is there a Struts pattern for accessing JNDI resources in (a) a container neutral manner and (b) without tying my action classes to the servlet api or would I be better off creating an independant connection pool and injecting it through Spring? Regards - 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: ApplicationAware not triggering setApplication? Or, how best to reference a Connection pool?
My understanding is that the webwork API for ApplicationAware means that the interceptor will have it's setApplication(Map applicationData); triggered when the interceptor is run, thereby giving me access to the applicationcontext. ApplicationAware should be used with Actions not with interceptors, to access application just use public String intercept(ActionInvocation invocation) { Map appScope = invocation.getInvocationContext().getApplication(); } Regards -- Lukasz http://www.lenart.org.pl/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
ApplicationAware not triggering setApplication? Or, how best to reference a Connection pool?
Hi folks - i'm trying to write an interceptor in struts2 that has access to the ApplicationMap in the application context. My understanding is that the webwork API for ApplicationAware means that the interceptor will have it's setApplication(Map applicationData); triggered when the interceptor is run, thereby giving me access to the applicationcontext. Problem is, it isn't :) Here's the relevant parts... public class DBInterceptor extends AbstractInterceptor implements ApplicationAware { ... @Override public void setApplication(Map arg0) { logger.info(Receiving applicationMap...); this.applicationMap = arg0; } That logger is never triggered, 'applicationMap' is always null. My struts.xml is: interceptors interceptor name=dbsetup class=com.stonekeep.congo.interceptors.DBInterceptor / interceptor-stack name=mystack interceptor-ref name=dbsetup / interceptor-ref name=defaultStack / /interceptor-stack /interceptors (The goal here is to store a c3p0 connection pool object in the application context, so that I can get a connection from it on every hit - I assume this is the proper way to do this?) Thanks, any help would be appreciated... -dbs - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: ApplicationAware not triggering setApplication? Or, how best to reference a Connection pool?
Dave Belfer-Shevett wrote: Hi folks - i'm trying to write an interceptor in struts2 that has access to the ApplicationMap in the application context. My understanding is that the webwork API for ApplicationAware means that the interceptor will have it's setApplication(Map applicationData); triggered when the interceptor is run, thereby giving me access to the applicationcontext. The ApplicationAware interface only applies to actions. It's actually a feature of the ServletConfigInterceptor. That interceptor inspects the target action for the interface and injects the Map if present. XWork's dependency injection uses the @Inject annotation on properties and constructions. It can inject beans it knows of, however the application context is not one of them. The simplest way to access the application context in your interceptor is via the ActionInvocation argument: ie. Map applicationContext = actionInvocation.getIncovationContext().getApplication(); You can also inject beans directly into you interceptor via spring or guice if you're using one of those DI frameworks. Hope that helps, Jeromy Evans - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: ApplicationAware not triggering setApplication? Or, how best to reference a Connection pool?
Lukasz Lenart wrote: My understanding is that the webwork API for ApplicationAware means that the interceptor will have it's setApplication(Map applicationData); triggered when the interceptor is run, thereby giving me access to the applicationcontext. ApplicationAware should be used with Actions not with interceptors, to access application just use public String intercept(ActionInvocation invocation) { Map appScope = invocation.getInvocationContext().getApplication(); } That's done it, thank you very much. I was really stymied. -dbs - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [Struts2] Exception starting filter (Connection Timed Out)
Thanks for the suggestion, but I use Spring very heavily! ;) (Everything's bean-ified, and dependency injected...) 2008/5/5 KonTiki [EMAIL PROTECTED]: The Spring context listener is needed only if you do use Spring. If you do not, then this might be causing the error as Tomcat was unable to find the Spring classes. Try removing this: listener listener-classorg.springframework.web.context.ContextLoaderListener/listener-class /listener listener listener-classorg.springframework.web.context.request.RequestContextListener/listener-class /listener
Re: [Struts2] Exception starting filter (Connection Timed Out)
The Spring context listener is needed only if you do use Spring. If you do not, then this might be causing the error as Tomcat was unable to find the Spring classes. Try removing this: listener listener-classorg.springframework.web.context.ContextLoaderListener/listener-class /listener listener listener-classorg.springframework.web.context.request.RequestContextListener/listener-class /listener Pierre Thibaudeau-4 wrote: Just moving from Struts1 to Struts2.0.11. No problem on Tomcat 6.0.16. However, I get the following exception on startup with Tomcat 6.0.14. Does anyone know a way round this? (I've included excerpts from web.xml further down.) -- View this message in context: http://www.nabble.com/-Struts2--Exception-starting-filter-%28Connection-Timed-Out%29-tp16953438p17071258.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] Exception starting filter (Connection Timed Out)
Exception starting filter action2 2008/04/29 00:59:30 | at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadConfigurationFiles from upstair Infomtion, I think it's the problem of filter named action2 Xml files couldn't be found by the filter. try 2 heck the struts.xml files location. On 4/29/08, Pierre Thibaudeau [EMAIL PROTECTED] wrote: Just moving from Struts1 to Struts2.0.11. No problem on Tomcat 6.0.16. However, I get the following exception on startup with Tomcat 6.0.14. Does anyone know a way round this? (I've included excerpts from web.xml further down.) *** EXCEPTION TRACE: *** 2008/04/29 00:59:30 | Apr 29, 2008 12:59:30 AM org.apache.catalina.core.StandardContext filterStart 2008/04/29 00:59:30 | SEVERE: Exception starting filter action2 2008/04/29 00:59:30 | [unknown location] 2008/04/29 00:59:30 | at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadConfigurationFiles(XmlConfigurationProvider.java:835) 2008/04/29 00:59:30 | at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadDocuments(XmlConfigurationProvider.java:131) 2008/04/29 00:59:30 | at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.init(XmlConfigurationProvider.java:100) 2008/04/29 00:59:30 | at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reload(DefaultConfiguration.java:130) 2008/04/29 00:59:30 | at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:52) 2008/04/29 00:59:30 | at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:395) 2008/04/29 00:59:30 | at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:452) 2008/04/29 00:59:30 | at org.apache.struts2.dispatcher.FilterDispatcher.init(FilterDispatcher.java:201) 2008/04/29 00:59:30 | at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:275) 2008/04/29 00:59:30 | at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:397) 2008/04/29 00:59:30 | at org.apache.catalina.core.ApplicationFilterConfig.init(ApplicationFilterConfig.java:108) 2008/04/29 00:59:30 | at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:3696) 2008/04/29 00:59:30 | at org.apache.catalina.core.StandardContext.start(StandardContext.java:4343) 2008/04/29 00:59:30 | at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045) 2008/04/29 00:59:30 | at org.apache.catalina.core.StandardHost.start(StandardHost.java:719) 2008/04/29 00:59:30 | at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045) 2008/04/29 00:59:30 | at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443) 2008/04/29 00:59:30 | at org.apache.catalina.core.StandardService.start(StandardService.java:516) 2008/04/29 00:59:30 | at org.apache.catalina.core.StandardServer.start(StandardServer.java:710) 2008/04/29 00:59:30 | at org.apache.catalina.startup.Catalina.start(Catalina.java:566) 2008/04/29 00:59:30 | at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 2008/04/29 00:59:30 | at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) 2008/04/29 00:59:30 | at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 2008/04/29 00:59:30 | at java.lang.reflect.Method.invoke(Method.java:597) 2008/04/29 00:59:30 | at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288) 2008/04/29 00:59:30 | at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413) 2008/04/29 00:59:30 | at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 2008/04/29 00:59:30 | at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) 2008/04/29 00:59:30 | at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 2008/04/29 00:59:30 | at java.lang.reflect.Method.invoke(Method.java:597) 2008/04/29 00:59:30 | at org.tanukisoftware.wrapper.WrapperStartStopApp.run(WrapperStartStopApp.java:238) 2008/04/29 00:59:30 | at java.lang.Thread.run(Thread.java:619) 2008/04/29 00:59:30 | Caused by: Connection timed out - [unknown location] 2008/04/29 00:59:30 | at com.opensymphony.xwork2.util.DomHelper.parse(DomHelper.java:123) 2008/04/29 00:59:30 | at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadConfigurationFiles(XmlConfigurationProvider.java:830) 2008/04/29 00:59:30 | ... 31 more 2008/04/29 00:59:30 | Caused by: java.net.ConnectException: Connection timed out 2008/04/29 00:59:30 | at java.net.PlainSocketImpl.socketConnect(Native Method) 2008/04/29 00:59:30 | at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333) 2008/04/29 00
[Struts2] Exception starting filter (Connection Timed Out)
Just moving from Struts1 to Struts2.0.11. No problem on Tomcat 6.0.16. However, I get the following exception on startup with Tomcat 6.0.14. Does anyone know a way round this? (I've included excerpts from web.xml further down.) *** EXCEPTION TRACE: *** 2008/04/29 00:59:30 | Apr 29, 2008 12:59:30 AM org.apache.catalina.core.StandardContext filterStart 2008/04/29 00:59:30 | SEVERE: Exception starting filter action2 2008/04/29 00:59:30 | [unknown location] 2008/04/29 00:59:30 | at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadConfigurationFiles(XmlConfigurationProvider.java:835) 2008/04/29 00:59:30 | at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadDocuments(XmlConfigurationProvider.java:131) 2008/04/29 00:59:30 | at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.init(XmlConfigurationProvider.java:100) 2008/04/29 00:59:30 | at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reload(DefaultConfiguration.java:130) 2008/04/29 00:59:30 | at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:52) 2008/04/29 00:59:30 | at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:395) 2008/04/29 00:59:30 | at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:452) 2008/04/29 00:59:30 | at org.apache.struts2.dispatcher.FilterDispatcher.init(FilterDispatcher.java:201) 2008/04/29 00:59:30 | at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:275) 2008/04/29 00:59:30 | at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:397) 2008/04/29 00:59:30 | at org.apache.catalina.core.ApplicationFilterConfig.init(ApplicationFilterConfig.java:108) 2008/04/29 00:59:30 | at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:3696) 2008/04/29 00:59:30 | at org.apache.catalina.core.StandardContext.start(StandardContext.java:4343) 2008/04/29 00:59:30 | at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045) 2008/04/29 00:59:30 | at org.apache.catalina.core.StandardHost.start(StandardHost.java:719) 2008/04/29 00:59:30 | at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045) 2008/04/29 00:59:30 | at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443) 2008/04/29 00:59:30 | at org.apache.catalina.core.StandardService.start(StandardService.java:516) 2008/04/29 00:59:30 | at org.apache.catalina.core.StandardServer.start(StandardServer.java:710) 2008/04/29 00:59:30 | at org.apache.catalina.startup.Catalina.start(Catalina.java:566) 2008/04/29 00:59:30 | at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 2008/04/29 00:59:30 | at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) 2008/04/29 00:59:30 | at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 2008/04/29 00:59:30 | at java.lang.reflect.Method.invoke(Method.java:597) 2008/04/29 00:59:30 | at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288) 2008/04/29 00:59:30 | at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413) 2008/04/29 00:59:30 | at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 2008/04/29 00:59:30 | at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) 2008/04/29 00:59:30 | at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 2008/04/29 00:59:30 | at java.lang.reflect.Method.invoke(Method.java:597) 2008/04/29 00:59:30 | at org.tanukisoftware.wrapper.WrapperStartStopApp.run(WrapperStartStopApp.java:238) 2008/04/29 00:59:30 | at java.lang.Thread.run(Thread.java:619) 2008/04/29 00:59:30 | Caused by: Connection timed out - [unknown location] 2008/04/29 00:59:30 | at com.opensymphony.xwork2.util.DomHelper.parse(DomHelper.java:123) 2008/04/29 00:59:30 | at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadConfigurationFiles(XmlConfigurationProvider.java:830) 2008/04/29 00:59:30 | ... 31 more 2008/04/29 00:59:30 | Caused by: java.net.ConnectException: Connection timed out 2008/04/29 00:59:30 | at java.net.PlainSocketImpl.socketConnect(Native Method) 2008/04/29 00:59:30 | at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333) 2008/04/29 00:59:30 | at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195) 2008/04/29 00:59:30 | at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182) 2008/04/29 00:59:30 | at java.net.Socket.connect(Socket.java:518) 2008/04/29 00:59:30 | at java.net.Socket.connect(Socket.java:468) 2008/04/29 00:59:30 | at sun.net.NetworkClient.doConnect(NetworkClient.java:157) 2008/04/29 00:59:30 | at sun.net.www.http.HttpClient.openServer
Noob question(s). Interceptor breaking forms, and Connection handling?
Hi folks, I have two questions, and I apologize for the n00b approach. I'm just teaching myself struts2, coming from a PHP background (but I've done plenty of JEE and Java Swing programming, so the language isn't completely alien :) Question 1... I have a Logon form that works fine without an interceptor, but as soon as I add one, my getUsername() and other methods fail (the username is null). Struts.xml: http://pastebin.stonekeep.com/1893 DBInterceptor: http://pastebin.stonekeep.com/1894 Logon.java: http://pastebin.stonekeep.com/1895 If I uncomment the interceptor line in my struts.xml file, the Logon form validator fails. Line 29 shows 'null' in Logon.java. If i leave it commented out, it works fine. Question 2... In Logon.java, I'm using the execute() method to set up my JDBC connection (as pulled from my JBoss container datasource), setting up the Connection, and making the call. Wouldn't it make more sense to do that in an interceptor around every class, and do something like ic = new InitialContext(); dataSource = (DataSource)ic.lookup(java:JQuoDEV); c = dataSource.getConnection(); Logon action = (Logon)invocation.getAction(); action.connection = c; return invocation.invoke() ; I tried doing this, and saw the connection start up, but the Action class kept having the connection as 'null'. I think I'm either misunderstanding how the interceptor / action sequence works, or doing something blatantly stupid. Help? -dbs -- Dave Belfer-Shevet Stonekeep Consulting, Inc http://www.stonekeep.com/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Noob question(s). Interceptor breaking forms, and Connection handling?
--- Dave Belfer-Shevett [EMAIL PROTECTED] wrote: I have a Logon form that works fine without an interceptor, but as soon as I add one, my getUsername() and other methods fail (the username is null). When you declare interceptor-refs for an action you are declaring *all* the interceptors for that action. You either need to create a *complete* stack with your interceptor included or specify *all* the interceptors your action requires. Question 2... I tried doing this, and saw the connection start up, but the Action class kept having the connection as 'null'. I think I'm either misunderstanding how the interceptor / action sequence works, or doing something blatantly stupid. Without the actual implementation it will be difficult to help. What you probably meant in the code above was that you'd check for an interface that informs the interceptor that the action accepts a connection property. If the action being invoked implements the interface, get the connection and set it on the action. If you look at many of the S2/XWork interceptor source you'll see this technique used all over the place. That's certainly one way to handle connections. Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts2 connection pooling using MySQL
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]
Re: Struts2 connection pooling using MySQL
--- 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]
Struts2 connection pooling using MySQL
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. -- View this message in context: http://www.nabble.com/Struts2-connection-pooling-using-MySQL-tp15584715p15584715.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
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
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
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
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
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
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
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
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
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
dont forget to share the code. Thx - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
OOT: Too Many Connection
hi there, i am developing system using struts2, hibernate, and spring and show off the error too many connection , and the error show off after there is 300 user log to the systme can help anyone F - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: OOT: Too Many Connection
Hi Frans, You need to isolate what there's too many connections to. Is it the database, the http server or some other resource? My wild stab in the dark is that you're using the Session In View pattern with hibernate and a connection pool setup through spring. The pool is probably exhausted and you need to increase a setting in the pool's config (and perhaps match it in the database). It may also be worthwhile to design out unintended/unused connections. eg. don't use session-in-view on pages that don't need a hibernate session. Struts 2 is probably not a contributing factor and when you've isolated the problem you'll find better help in hibernate/spring's/others FAQ. Apache JMeter may help too: http://jakarta.apache.org/jmeter/ regards, Jeromy Frans Thamura wrote: hi there, i am developing system using struts2, hibernate, and spring and show off the error too many connection , and the error show off after there is 300 user log to the systme can help anyone F - 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: Struts 2 + Spring 2 + JPA + Oracle + Connection Caching/Pooling
Filipe, Funny, I was looking for the same information. Here's the Spring configuration I'm moving forward with to use the Oracle connection pooling: !-- Database connection using the Oracle connection pool -- bean id=dataSource class=oracle.jdbc.pool.OracleConnectionCacheImpl property name=connectionPoolDataSource bean class=oracle.jdbc.pool.OracleConnectionPoolDataSource property name=URL value=jdbc:oracle:thin:@devlxdb02:1522:xx / property name=user value=xx / property name=password value=xx / /bean /property property name=maxLimit value=10 / property name=minLimit value=2 / /bean Seems to work for now. There is probably a less verbose way to do this. And yes I agree this isn't a Struts question, but I hope it helps. thx, Ken K -- View this message in context: http://www.nabble.com/Struts-2-%2B-Spring-2-%2B-JPA-%2B-Oracle-%2B-Connection-Caching-Pooling-tp14284397p14398750.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: Struts 2 + Spring 2 + JPA + Oracle + Connection Caching/Pooling
Thanks! :) By the way, I have bad news... The OracleConnectionCachingImpl class is actually deprecated. Use OracleConnectionCacheManager with OracleDataSource instead. Take a look at: oracle JDBC reference: http://download-west.oracle.com/docs/cd/B12037_01/java.101/b10979/toc.htm oracle JDBC resources: http://www.oracle.com/technology/sample_code/tech/java/sqlj_jdbc/files/oracle10g/conncache/Readme.html Found it 2 days ago, thanks to an Eclipse warning :) How to port this to Spring/Struts2 I have no idea... I am actually doing my Model layer using directly jdbc. cheers On 12/18/07, kenk [EMAIL PROTECTED] wrote: Filipe, Funny, I was looking for the same information. Here's the Spring configuration I'm moving forward with to use the Oracle connection pooling: !-- Database connection using the Oracle connection pool -- bean id=dataSource class=oracle.jdbc.pool.OracleConnectionCacheImpl property name=connectionPoolDataSource bean class= oracle.jdbc.pool.OracleConnectionPoolDataSource property name=URLvalue= jdbc:oracle:thin:@devlxdb02:1522:xx / property name=user value=xx / property name=password value=xx / /bean /property property name=maxLimit value=10 / property name=minLimit value=2 / /bean Seems to work for now. There is probably a less verbose way to do this. And yes I agree this isn't a Struts question, but I hope it helps. thx, Ken K -- View this message in context: http://www.nabble.com/Struts-2-%2B-Spring-2-%2B-JPA-%2B-Oracle-%2B-Connection-Caching-Pooling-tp14284397p14398750.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] -- Filipe David Manana, [EMAIL PROTECTED] Obvious facts are like secrets to those not trained to see them.
Struts 2 + Spring 2 + JPA + Oracle + Connection Caching/Pooling
Hi all, I want to create a web app with Struts 2 that is Oracle database driven. Integrating Struts 2 + Spring 2 + JPA (as described in http://struts.apache.org/2.x/docs/struts-2-spring-2-jpa-ajax.html), how do I configure Oracle database Connection Caching (pooling)? Oracle's JDBC driver provided in the Oracle Instant Client package has a Connection Cache implementation class ( oracle.jdbc.pool.OracleConnectionCacheImpl) which I can use in my JDBC code. I have been unsuccessfully googling for how to enable this Connection Caching feature with Struts 2 + Spring 2 + JPA. Has anybody done it before? -- Filipe David Manana, [EMAIL PROTECTED] Obvious facts are like secrets to those not trained to see them.
Re: Struts 2 + Spring 2 + JPA + Oracle + Connection Caching/Pooling
I have no idea how to do that, but it isn't specific to Struts or JPA. Spring documentation would be the best place to look that up I guess. musachy On Dec 11, 2007 4:56 PM, Filipe David Manana [EMAIL PROTECTED] wrote: Hi all, I want to create a web app with Struts 2 that is Oracle database driven. Integrating Struts 2 + Spring 2 + JPA (as described in http://struts.apache.org/2.x/docs/struts-2-spring-2-jpa-ajax.html), how do I configure Oracle database Connection Caching (pooling)? Oracle's JDBC driver provided in the Oracle Instant Client package has a Connection Cache implementation class ( oracle.jdbc.pool.OracleConnectionCacheImpl) which I can use in my JDBC code. I have been unsuccessfully googling for how to enable this Connection Caching feature with Struts 2 + Spring 2 + JPA. Has anybody done it before? -- Filipe David Manana, [EMAIL PROTECTED] Obvious facts are like secrets to those not trained to see them. -- Hey you! Would you help me to carry the stone? Pink Floyd - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts 2 + Spring 2 + JPA + Oracle + Connection Caching/Pooling
Database Connection Pooling is typically handled (already) by the container. You can get your datasource from this connection pooling using JNDI. Spring has a way of doing this nicely using the JndiObjectFactoryBean. Each container has a different way to configure this JNDI configuration, so you need to read their documentation and play with it. Now, ORMs typically do their own connection caching (e.g. Hibernate), but in my understanding, the prefer way of doing connection pooling is via JNDI, so as to use the JEE specification appropriately. In the Struts sample, I think TopLink (instead of Hibernate) is used. Alternatively, the commons DBCP does connection pooling for you as well (if you don't want to use JNDI and rely on the container for pooling). It's a matter of creating a new bean id=datasource ... and let Spring inject the one you want. Your choice, of course. BTW, this is hardly a Struts question :) Filipe David Manana wrote: Hi all, I want to create a web app with Struts 2 that is Oracle database driven. Integrating Struts 2 + Spring 2 + JPA (as described in http://struts.apache.org/2.x/docs/struts-2-spring-2-jpa-ajax.html), how do I configure Oracle database Connection Caching (pooling)? Oracle's JDBC driver provided in the Oracle Instant Client package has a Connection Cache implementation class ( oracle.jdbc.pool.OracleConnectionCacheImpl) which I can use in my JDBC code. I have been unsuccessfully googling for how to enable this Connection Caching feature with Struts 2 + Spring 2 + JPA. Has anybody done it before? -- Filipe David Manana, [EMAIL PROTECTED] Obvious facts are like secrets to those not trained to see them. -- Alberto A. Flores http://www.linkedin.com/in/aflores - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: HELP! Could not open connection with host: jakarta.apache.org and port: 80??
This is usually a result of using the wrong DOCTYPE in one of your XML configuration files (in this case, one of /WEB-INF/validator-rules.xml, /WEB-INF/validator-rules-extra.xml, /WEB-INF/validation.xml). Make sure the declared DOCTYPE is appropriate to the version of Struts you're using. There have been bugs in DTD resolution in some versions of Struts, too; depending on which version you're using, an update may help. L. Ed snooper wrote: Hello kind person, I have a struts application that was working fine, but when I tried to move it to another server it started throwing the below error messages. Why is it trying to pull the DTD remotely? How can I fix? Thanks for any and all help Ed struts-config_1_2.dtd Aug 30, 2007 2:47:03 PM EDT Warning Net BEA-000905 Could not open connection with host: jakarta.apache.org and port: 80. Aug 30, 2007 2:47:03 PM EDT Error HTTP BEA-101216 Servlet: action failed to preload on startup in Web application: NCNR-IMS. javax.servlet.UnavailableException: Cannot load a validator resource from '/WEB-INF/validator-rules.xml,/WEB-INF/validator-rules-extra.xml,/WEB-INF/validation.xml' at org.apache.struts.validator.ValidatorPlugIn.init(ValidatorPlugIn.java:172) at org.apache.struts.action.ActionServlet.initModulePlugIns(ActionServlet.java:869) at org.apache.struts.action.ActionServlet.init(ActionServlet.java:336) at javax.servlet.GenericServlet.init(GenericServlet.java:258) at weblogic.servlet.internal.ServletStubImpl$ServletInitAction.run(ServletStubImpl.java:1099) at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321) at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121) at weblogic.servlet.internal.ServletStubImpl.createServlet(ServletStubImpl.java:975) at weblogic.servlet.internal.ServletStubImpl.createInstances(ServletStubImpl.java:954) at weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubImpl.java:893) at weblogic.servlet.internal.WebAppServletContext.preloadServlet(WebAppServletContext.java:3456) at weblogic.servlet.internal.WebAppServletContext.preloadServlets(WebAppServletContext.java:3413) at weblogic.servlet.internal.WebAppServletContext.preloadServlets(WebAppServletContext.java:3399) at weblogic.servlet.internal.WebAppServletContext.preloadResources(WebAppServletContext.java:3382) at weblogic.servlet.internal.WebAppServletContext.setStarted(WebAppServletContext.java:6262) at weblogic.servlet.internal.WebAppModule.start(WebAppModule.java:892) at weblogic.j2ee.J2EEApplicationContainer.start(J2EEApplicationContainer.java:2181) at weblogic.j2ee.J2EEApplicationContainer.activate(J2EEApplicationContainer.java:) at weblogic.j2ee.J2EEApplicationContainer.activate(J2EEApplicationContainer.java:2169) at weblogic.management.deploy.slave.SlaveDeployer$Application.setActivation(SlaveDeployer.java:3111) at weblogic.management.deploy.slave.SlaveDeployer.setActivationStateForAllApplications(SlaveDeployer.java:1769) at weblogic.management.deploy.slave.SlaveDeployer.resume(SlaveDeployer.java:352) at weblogic.management.deploy.DeploymentManagerServerLifeCycleImpl.resume(DeploymentManagerServerLifeCycleImpl.java:229) at weblogic.t3.srvr.SubsystemManager.resume(SubsystemManager.java:136) at weblogic.t3.srvr.T3Srvr.resume(T3Srvr.java:965) at weblogic.t3.srvr.T3Srvr.run(T3Srvr.java:360) at weblogic.Server.main(Server.java:32) - Building a website is a piece of cake. Yahoo! Small Business gives you all the tools to get online. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
HELP! Could not open connection with host: jakarta.apache.org and port: 80??
Hello kind person, I have a struts application that was working fine, but when I tried to move it to another server it started throwing the below error messages. Why is it trying to pull the DTD remotely? How can I fix? Thanks for any and all help Ed struts-config_1_2.dtd Aug 30, 2007 2:47:03 PM EDT Warning Net BEA-000905 Could not open connection with host: jakarta.apache.org and port: 80. Aug 30, 2007 2:47:03 PM EDT Error HTTP BEA-101216 Servlet: action failed to preload on startup in Web application: NCNR-IMS. javax.servlet.UnavailableException: Cannot load a validator resource from '/WEB-INF/validator-rules.xml,/WEB-INF/validator-rules-extra.xml,/WEB-INF/validation.xml' at org.apache.struts.validator.ValidatorPlugIn.init(ValidatorPlugIn.java:172) at org.apache.struts.action.ActionServlet.initModulePlugIns(ActionServlet.java:869) at org.apache.struts.action.ActionServlet.init(ActionServlet.java:336) at javax.servlet.GenericServlet.init(GenericServlet.java:258) at weblogic.servlet.internal.ServletStubImpl$ServletInitAction.run(ServletStubImpl.java:1099) at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321) at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121) at weblogic.servlet.internal.ServletStubImpl.createServlet(ServletStubImpl.java:975) at weblogic.servlet.internal.ServletStubImpl.createInstances(ServletStubImpl.java:954) at weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubImpl.java:893) at weblogic.servlet.internal.WebAppServletContext.preloadServlet(WebAppServletContext.java:3456) at weblogic.servlet.internal.WebAppServletContext.preloadServlets(WebAppServletContext.java:3413) at weblogic.servlet.internal.WebAppServletContext.preloadServlets(WebAppServletContext.java:3399) at weblogic.servlet.internal.WebAppServletContext.preloadResources(WebAppServletContext.java:3382) at weblogic.servlet.internal.WebAppServletContext.setStarted(WebAppServletContext.java:6262) at weblogic.servlet.internal.WebAppModule.start(WebAppModule.java:892) at weblogic.j2ee.J2EEApplicationContainer.start(J2EEApplicationContainer.java:2181) at weblogic.j2ee.J2EEApplicationContainer.activate(J2EEApplicationContainer.java:) at weblogic.j2ee.J2EEApplicationContainer.activate(J2EEApplicationContainer.java:2169) at weblogic.management.deploy.slave.SlaveDeployer$Application.setActivation(SlaveDeployer.java:3111) at weblogic.management.deploy.slave.SlaveDeployer.setActivationStateForAllApplications(SlaveDeployer.java:1769) at weblogic.management.deploy.slave.SlaveDeployer.resume(SlaveDeployer.java:352) at weblogic.management.deploy.DeploymentManagerServerLifeCycleImpl.resume(DeploymentManagerServerLifeCycleImpl.java:229) at weblogic.t3.srvr.SubsystemManager.resume(SubsystemManager.java:136) at weblogic.t3.srvr.T3Srvr.resume(T3Srvr.java:965) at weblogic.t3.srvr.T3Srvr.run(T3Srvr.java:360) at weblogic.Server.main(Server.java:32) - Building a website is a piece of cake. Yahoo! Small Business gives you all the tools to get online.
Re: Connection Pooling How To ?
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Jasdeep, jasdeep wrote: Yes this is peek load actually .. The requests are through SMS's which is forwarded by kannel server to my application . actually we are in development phase and we are testing it as per client specifications. So this was the load client specified ... i had set the max limit of my pool to 100 ... that may be the problem . i will go and increase it now... If you need to serve 200 requests per second, ten you need to evaluate what percentage of requests result in DB connection use, and then estimate the number of those that are simple SELECTs versus more complex queries. I'll bet that many of your requests use connections for a very short amount of time, while others take more time. You need to either estimate or observe that pattern (and you can only estimate right now, since you're only in the dev phase) and then plan the size of your connection pool based upon that. This is crude capacity planning. If each connection lasts 1 second (a long time) and uses a DB connection through the entire request-response cycle, then you'll need exactly 200 connections in your connection pool (plus a few extra for good measure). 200 connections to your database might get very heavy, especially for Oracle (which at least /used/ to be known for very very heavy server-side connection memory requirements -- the db server, not the app server). Hope that helps, - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.7 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFGVDV19CaO5/Lv0PARAkEPAJ9UlPFD76jlZcTwEUr4Hf4jQXQj0gCfUzM3 ZE3Nb1DdqEh44WPc5l4EoZ8= =60Zz -END PGP SIGNATURE- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT] Connection Pooling
Thanks for helping. Sure, here are all my settings. I use MySQL 5.0.37, Tomcat 5.5.17 and Windows XP SP2 and MySQL Connector/J 5.0.5. The name of the database that I'd like to connect to is called akr_db and the name of my web-application is called SZTGKR. 1) I have a context.xml file in my web/Meta-INF directory with the following contents: - CONTEXT.XML ?xml version=1.0 encoding=UTF-8? Context crossContext=true debug=5 docBase=SZTGKR path=/SZTGKR reloadable=true Logger className=org.apache.catalina.logger.FileLogger prefix=localhost_akr_db_log. suffix=.txt timestamp=true/ Resource auth=Container name=jdbc/akr_db type=javax.sql.DataSource/ ResourceParams name=jdbc/akr_db parameter namefactory/name valueorg.apache.commons.dbcp.BasicDataSourceFactory/value /parameter parameter nameremoveAbandoned/name valuetrue/value /parameter parameter nameremoveAbandonedTimeout/name value60/value /parameter parameter namelogAbandoned/name valuetrue/value /parameter !-- Maximum number of dB connections in pool. Make sure you configure your mysqld max_connections large enough to handle all of your db connections. Set to 0 for no limit. -- parameter namemaxActive/name value100/value /parameter !-- Maximum number of idle dB connections to retain in pool. Set to 0 for no limit. -- parameter namemaxIdle/name value30/value /parameter !-- Maximum time to wait for a dB connection to become available in ms, in this example 10 seconds. An Exception is thrown if this timeout is exceeded. Set to -1 to wait indefinitely. -- parameter namemaxWait/name value1/value /parameter !-- MySQL dB username and password for dB connections -- parameter nameusername/name valuebalazs/value /parameter parameter namepassword/name value12345/value /parameter !-- Class name for mm.mysql JDBC driver -- parameter namedriverClassName/name valuecom.mysql.jdbc.Driver/value /parameter !-- The JDBC connection url for connecting to your MySQL dB. The autoReconnect=true argument to the url makes sure that the mm.mysql JDBC Driver will automatically reconnect if mysqld closed the connection. mysqld by default closes idle connections after 8 hours. -- parameter nameurl/name valuejdbc:mysql://localhost:3306/value /parameter /ResourceParams /Context -END OF CONTEXT.XML I have a java class, that (presumably) creates (or returns...?) my connection pool: - DBTEST.JAVA package db_helpers; import javax.naming.*; import javax.sql.*; import java.sql.*; public class DBTest { String foo = Not Connected; String bar = Empty; public void init() { try{ Context ctx = new InitialContext(); if(ctx == null ) throw new Exception(Boom - No Context); Context envCtx = (Context) ctx.lookup(java:comp/env); DataSource ds = (DataSource) envCtx.lookup(jdbc/akr_db); if (ds != null) { Connection conn = ds.getConnection(); if(conn != null) { foo = Got Connection +conn.toString(); Statement stmt = conn.createStatement(); ResultSet rst = stmt.executeQuery( select ID_paciens, vezeteknev, keresztnev from torzs_paciens); if(rst.next()) { foo=rst.getString(2); bar=rst.getString(3); } conn.close(); } } }catch(Exception e) { e.printStackTrace(); } } public String getFoo() { return foo; } public String getBar() { return bar;} } - END OF DBTEST.JAVA Here, my Connection conn = ds.getConnection(); statement fails. And finally I have a JSP, in which I'd like to use my connection pool: -- DBTEST.JSP ... % db_helpers.DBTest tst = new db_helpers.DBTest(); tst.init(); % h2Results/h2 Foo %= tst.getFoo() %br/ Bar %= tst.getBar() % ... -- END OF DBTEST.JSP Do I have anything else to connect to my db using connection pooling? So again, it's the Connection conn = ds.getConnection();, where my program fails, it says org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null' And yes, after the following statement, the url, driverclass and some other properties of my ds is null: DataSource ds = (DataSource
Re: [OT] Connection Pooling
hi, i just had a look, i think your url is wrong. where is the DB name? eg:- you have it like jdbc:mysql://localhost:3306 but should be like: jdbc:mysql://localhost:3306/akr_db Thanks, Nuwan - Original Message - From: Balazs Michnay [EMAIL PROTECTED] To: Struts Users Mailing List user@struts.apache.org Sent: Tuesday, May 22, 2007 6:39 AM Subject: Re: [OT] Connection Pooling Thanks for helping. Sure, here are all my settings. I use MySQL 5.0.37, Tomcat 5.5.17 and Windows XP SP2 and MySQL Connector/J 5.0.5. The name of the database that I'd like to connect to is called akr_db and the name of my web-application is called SZTGKR. 1) I have a context.xml file in my web/Meta-INF directory with the following contents: - CONTEXT.XML ?xml version=1.0 encoding=UTF-8? Context crossContext=true debug=5 docBase=SZTGKR path=/SZTGKR reloadable=true Logger className=org.apache.catalina.logger.FileLogger prefix=localhost_akr_db_log. suffix=.txt timestamp=true/ Resource auth=Container name=jdbc/akr_db type=javax.sql.DataSource/ ResourceParams name=jdbc/akr_db parameter namefactory/name valueorg.apache.commons.dbcp.BasicDataSourceFactory/value /parameter parameter nameremoveAbandoned/name valuetrue/value /parameter parameter nameremoveAbandonedTimeout/name value60/value /parameter parameter namelogAbandoned/name valuetrue/value /parameter !-- Maximum number of dB connections in pool. Make sure you configure your mysqld max_connections large enough to handle all of your db connections. Set to 0 for no limit. -- parameter namemaxActive/name value100/value /parameter !-- Maximum number of idle dB connections to retain in pool. Set to 0 for no limit. -- parameter namemaxIdle/name value30/value /parameter !-- Maximum time to wait for a dB connection to become available in ms, in this example 10 seconds. An Exception is thrown if this timeout is exceeded. Set to -1 to wait indefinitely. -- parameter namemaxWait/name value1/value /parameter !-- MySQL dB username and password for dB connections -- parameter nameusername/name valuebalazs/value /parameter parameter namepassword/name value12345/value /parameter !-- Class name for mm.mysql JDBC driver -- parameter namedriverClassName/name valuecom.mysql.jdbc.Driver/value /parameter !-- The JDBC connection url for connecting to your MySQL dB. The autoReconnect=true argument to the url makes sure that the mm.mysql JDBC Driver will automatically reconnect if mysqld closed the connection. mysqld by default closes idle connections after 8 hours. -- parameter nameurl/name valuejdbc:mysql://localhost:3306/value /parameter /ResourceParams /Context -END OF CONTEXT.XML I have a java class, that (presumably) creates (or returns...?) my connection pool: - DBTEST.JAVA package db_helpers; import javax.naming.*; import javax.sql.*; import java.sql.*; public class DBTest { String foo = Not Connected; String bar = Empty; public void init() { try{ Context ctx = new InitialContext(); if(ctx == null ) throw new Exception(Boom - No Context); Context envCtx = (Context) ctx.lookup(java:comp/env); DataSource ds = (DataSource) envCtx.lookup(jdbc/akr_db); if (ds != null) { Connection conn = ds.getConnection(); if(conn != null) { foo = Got Connection +conn.toString(); Statement stmt = conn.createStatement(); ResultSet rst = stmt.executeQuery( select ID_paciens, vezeteknev, keresztnev from torzs_paciens); if(rst.next()) { foo=rst.getString(2); bar=rst.getString(3); } conn.close(); } } }catch(Exception e) { e.printStackTrace(); } } public String getFoo() { return foo; } public String getBar() { return bar;} } - END OF DBTEST.JAVA Here, my Connection conn = ds.getConnection(); statement fails. And finally I have a JSP, in which I'd like to use my connection pool: -- DBTEST.JSP ... % db_helpers.DBTest tst = new db_helpers.DBTest(); tst.init(); % h2Results/h2 Foo %= tst.getFoo() %br/ Bar %= tst.getBar() % ... -- END OF DBTEST.JSP Do I have anything else to connect to my db using connection pooling? So again, it's the Connection conn = ds.getConnection();, where my program fails, it says
Re: [OT] Connection Pooling
Still the same error message and the same symptoms: the url and the driverclass properties are still null: :-(( org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null' ohhh... what am I missing ??!! - Original Message From: Nuwan Chandrasoma [EMAIL PROTECTED] To: Struts Users Mailing List user@struts.apache.org Sent: Tuesday, May 22, 2007 2:33:34 PM Subject: Re: [OT] Connection Pooling hi, i just had a look, i think your url is wrong. where is the DB name? eg:- you have it like jdbc:mysql://localhost:3306 but should be like: jdbc:mysql://localhost:3306/akr_db Thanks, Nuwan - Original Message - From: Balazs Michnay [EMAIL PROTECTED] To: Struts Users Mailing List user@struts.apache.org Sent: Tuesday, May 22, 2007 6:39 AM Subject: Re: [OT] Connection Pooling Thanks for helping. Sure, here are all my settings. I use MySQL 5.0.37, Tomcat 5.5.17 and Windows XP SP2 and MySQL Connector/J 5.0.5. The name of the database that I'd like to connect to is called akr_db and the name of my web-application is called SZTGKR. 1) I have a context.xml file in my web/Meta-INF directory with the following contents: - CONTEXT.XML ?xml version=1.0 encoding=UTF-8? Context crossContext=true debug=5 docBase=SZTGKR path=/SZTGKR reloadable=true Logger className=org.apache.catalina.logger.FileLogger prefix=localhost_akr_db_log. suffix=.txt timestamp=true/ Resource auth=Container name=jdbc/akr_db type=javax.sql.DataSource/ ResourceParams name=jdbc/akr_db parameter namefactory/name valueorg.apache.commons.dbcp.BasicDataSourceFactory/value /parameter parameter nameremoveAbandoned/name valuetrue/value /parameter parameter nameremoveAbandonedTimeout/name value60/value /parameter parameter namelogAbandoned/name valuetrue/value /parameter !-- Maximum number of dB connections in pool. Make sure you configure your mysqld max_connections large enough to handle all of your db connections. Set to 0 for no limit. -- parameter namemaxActive/name value100/value /parameter !-- Maximum number of idle dB connections to retain in pool. Set to 0 for no limit. -- parameter namemaxIdle/name value30/value /parameter !-- Maximum time to wait for a dB connection to become available in ms, in this example 10 seconds. An Exception is thrown if this timeout is exceeded. Set to -1 to wait indefinitely. -- parameter namemaxWait/name value1/value /parameter !-- MySQL dB username and password for dB connections -- parameter nameusername/name valuebalazs/value /parameter parameter namepassword/name value12345/value /parameter !-- Class name for mm.mysql JDBC driver -- parameter namedriverClassName/name valuecom.mysql.jdbc.Driver/value /parameter !-- The JDBC connection url for connecting to your MySQL dB. The autoReconnect=true argument to the url makes sure that the mm.mysql JDBC Driver will automatically reconnect if mysqld closed the connection. mysqld by default closes idle connections after 8 hours. -- parameter nameurl/name valuejdbc:mysql://localhost:3306/value /parameter /ResourceParams /Context -END OF CONTEXT.XML I have a java class, that (presumably) creates (or returns...?) my connection pool: - DBTEST.JAVA package db_helpers; import javax.naming.*; import javax.sql.*; import java.sql.*; public class DBTest { String foo = Not Connected; String bar = Empty; public void init() { try{ Context ctx = new InitialContext(); if(ctx == null ) throw new Exception(Boom - No Context); Context envCtx = (Context) ctx.lookup(java:comp/env); DataSource ds = (DataSource) envCtx.lookup(jdbc/akr_db); if (ds != null) { Connection conn = ds.getConnection(); if(conn != null) { foo = Got Connection +conn.toString(); Statement stmt = conn.createStatement(); ResultSet rst = stmt.executeQuery( select ID_paciens, vezeteknev, keresztnev from torzs_paciens); if(rst.next()) { foo=rst.getString(2); bar=rst.getString(3); } conn.close(); } } }catch(Exception e) { e.printStackTrace(); } } public String getFoo() { return foo; } public String getBar() { return bar;} } - END OF DBTEST.JAVA Here, my
Re: [OT] Connection Pooling
I forgot that I also have a resource-ref entry in my web.xml file... just in case it counts... resource-ref descriptionDB Connection/description res-ref-namejdbc/akr_db/res-ref-name res-typejavax.sql.DataSource/res-type res-authContainer/res-auth /resource-ref But still nothing :( Thanks, BM - Original Message From: Nuwan Chandrasoma [EMAIL PROTECTED] To: Struts Users Mailing List user@struts.apache.org Sent: Tuesday, May 22, 2007 2:33:34 PM Subject: Re: [OT] Connection Pooling hi, i just had a look, i think your url is wrong. where is the DB name? eg:- you have it like jdbc:mysql://localhost:3306 but should be like: jdbc:mysql://localhost:3306/akr_db Thanks, Nuwan - Original Message - From: Balazs Michnay [EMAIL PROTECTED] To: Struts Users Mailing List user@struts.apache.org Sent: Tuesday, May 22, 2007 6:39 AM Subject: Re: [OT] Connection Pooling Thanks for helping. Sure, here are all my settings. I use MySQL 5.0.37, Tomcat 5.5.17 and Windows XP SP2 and MySQL Connector/J 5.0.5. The name of the database that I'd like to connect to is called akr_db and the name of my web-application is called SZTGKR. 1) I have a context.xml file in my web/Meta-INF directory with the following contents: - CONTEXT.XML ?xml version=1.0 encoding=UTF-8? Context crossContext=true debug=5 docBase=SZTGKR path=/SZTGKR reloadable=true Logger className=org.apache.catalina.logger.FileLogger prefix=localhost_akr_db_log. suffix=.txt timestamp=true/ Resource auth=Container name=jdbc/akr_db type=javax.sql.DataSource/ ResourceParams name=jdbc/akr_db parameter namefactory/name valueorg.apache.commons.dbcp.BasicDataSourceFactory/value /parameter parameter nameremoveAbandoned/name valuetrue/value /parameter parameter nameremoveAbandonedTimeout/name value60/value /parameter parameter namelogAbandoned/name valuetrue/value /parameter !-- Maximum number of dB connections in pool. Make sure you configure your mysqld max_connections large enough to handle all of your db connections. Set to 0 for no limit. -- parameter namemaxActive/name value100/value /parameter !-- Maximum number of idle dB connections to retain in pool. Set to 0 for no limit. -- parameter namemaxIdle/name value30/value /parameter !-- Maximum time to wait for a dB connection to become available in ms, in this example 10 seconds. An Exception is thrown if this timeout is exceeded. Set to -1 to wait indefinitely. -- parameter namemaxWait/name value1/value /parameter !-- MySQL dB username and password for dB connections -- parameter nameusername/name valuebalazs/value /parameter parameter namepassword/name value12345/value /parameter !-- Class name for mm.mysql JDBC driver -- parameter namedriverClassName/name valuecom.mysql.jdbc.Driver/value /parameter !-- The JDBC connection url for connecting to your MySQL dB. The autoReconnect=true argument to the url makes sure that the mm.mysql JDBC Driver will automatically reconnect if mysqld closed the connection. mysqld by default closes idle connections after 8 hours. -- parameter nameurl/name valuejdbc:mysql://localhost:3306/value /parameter /ResourceParams /Context -END OF CONTEXT.XML I have a java class, that (presumably) creates (or returns...?) my connection pool: - DBTEST.JAVA package db_helpers; import javax.naming.*; import javax.sql.*; import java.sql.*; public class DBTest { String foo = Not Connected; String bar = Empty; public void init() { try{ Context ctx = new InitialContext(); if(ctx == null ) throw new Exception(Boom - No Context); Context envCtx = (Context) ctx.lookup(java:comp/env); DataSource ds = (DataSource) envCtx.lookup(jdbc/akr_db); if (ds != null) { Connection conn = ds.getConnection(); if(conn != null) { foo = Got Connection +conn.toString(); Statement stmt = conn.createStatement(); ResultSet rst = stmt.executeQuery( select ID_paciens, vezeteknev, keresztnev from torzs_paciens); if(rst.next()) { foo=rst.getString(2); bar=rst.getString(3); } conn.close(); } } }catch(Exception e) { e.printStackTrace(); } } public String getFoo() { return foo; } public String getBar() { return
Re: [OT] Connection Pooling
Hi, Sorry mate, i think you should ask this from another group like tomcat.., hope this link would give you some help http://tomcat.apache.org/tomcat-5.0-doc/jndi-datasource-examples-howto.html Thanks, Nuwan - Original Message - From: Balazs Michnay [EMAIL PROTECTED] To: Struts Users Mailing List user@struts.apache.org Sent: Tuesday, May 22, 2007 7:34 AM Subject: Re: [OT] Connection Pooling I forgot that I also have a resource-ref entry in my web.xml file... just in case it counts... resource-ref descriptionDB Connection/description res-ref-namejdbc/akr_db/res-ref-name res-typejavax.sql.DataSource/res-type res-authContainer/res-auth /resource-ref But still nothing :( Thanks, BM - Original Message From: Nuwan Chandrasoma [EMAIL PROTECTED] To: Struts Users Mailing List user@struts.apache.org Sent: Tuesday, May 22, 2007 2:33:34 PM Subject: Re: [OT] Connection Pooling hi, i just had a look, i think your url is wrong. where is the DB name? eg:- you have it like jdbc:mysql://localhost:3306 but should be like: jdbc:mysql://localhost:3306/akr_db Thanks, Nuwan - Original Message - From: Balazs Michnay [EMAIL PROTECTED] To: Struts Users Mailing List user@struts.apache.org Sent: Tuesday, May 22, 2007 6:39 AM Subject: Re: [OT] Connection Pooling Thanks for helping. Sure, here are all my settings. I use MySQL 5.0.37, Tomcat 5.5.17 and Windows XP SP2 and MySQL Connector/J 5.0.5. The name of the database that I'd like to connect to is called akr_db and the name of my web-application is called SZTGKR. 1) I have a context.xml file in my web/Meta-INF directory with the following contents: - CONTEXT.XML ?xml version=1.0 encoding=UTF-8? Context crossContext=true debug=5 docBase=SZTGKR path=/SZTGKR reloadable=true Logger className=org.apache.catalina.logger.FileLogger prefix=localhost_akr_db_log. suffix=.txt timestamp=true/ Resource auth=Container name=jdbc/akr_db type=javax.sql.DataSource/ ResourceParams name=jdbc/akr_db parameter namefactory/name valueorg.apache.commons.dbcp.BasicDataSourceFactory/value /parameter parameter nameremoveAbandoned/name valuetrue/value /parameter parameter nameremoveAbandonedTimeout/name value60/value /parameter parameter namelogAbandoned/name valuetrue/value /parameter !-- Maximum number of dB connections in pool. Make sure you configure your mysqld max_connections large enough to handle all of your db connections. Set to 0 for no limit. -- parameter namemaxActive/name value100/value /parameter !-- Maximum number of idle dB connections to retain in pool. Set to 0 for no limit. -- parameter namemaxIdle/name value30/value /parameter !-- Maximum time to wait for a dB connection to become available in ms, in this example 10 seconds. An Exception is thrown if this timeout is exceeded. Set to -1 to wait indefinitely. -- parameter namemaxWait/name value1/value /parameter !-- MySQL dB username and password for dB connections -- parameter nameusername/name valuebalazs/value /parameter parameter namepassword/name value12345/value /parameter !-- Class name for mm.mysql JDBC driver -- parameter namedriverClassName/name valuecom.mysql.jdbc.Driver/value /parameter !-- The JDBC connection url for connecting to your MySQL dB. The autoReconnect=true argument to the url makes sure that the mm.mysql JDBC Driver will automatically reconnect if mysqld closed the connection. mysqld by default closes idle connections after 8 hours. -- parameter nameurl/name valuejdbc:mysql://localhost:3306/value /parameter /ResourceParams /Context -END OF CONTEXT.XML I have a java class, that (presumably) creates (or returns...?) my connection pool: - DBTEST.JAVA package db_helpers; import javax.naming.*; import javax.sql.*; import java.sql.*; public class DBTest { String foo = Not Connected; String bar = Empty; public void init() { try{ Context ctx = new InitialContext(); if(ctx == null ) throw new Exception(Boom - No Context); Context envCtx = (Context) ctx.lookup(java:comp/env); DataSource ds = (DataSource) envCtx.lookup(jdbc/akr_db); if (ds != null) { Connection conn = ds.getConnection(); if(conn != null) { foo = Got Connection +conn.toString(); Statement stmt = conn.createStatement(); ResultSet rst = stmt.executeQuery( select ID_paciens, vezeteknev, keresztnev from torzs_paciens); if(rst.next()) { foo
Connection Pooling in Struts
Hi To set up connection pooling in struts which is the recommended way whether and please explain the benifts 1) Configure through struts-config 2) Configure through Server (like in tomcat data-source configuration) Thanks Regards, Saravanan Vijayappan, +91 9448833571. Be a better Heartthrob. Get better relationship answers from someone who knows. Yahoo! Answers - Check it out. http://answers.yahoo.com/dir/?link=listsid=396545433
RE: Connection Pooling in Struts
Hi, Struts way (not good) Connection pooling is not available in latest version of struts 1 and struts 2. So if you upgrade your application to latest struts then you will be in trouble. Server (JNDI) very good All application servers provide it now. All applications can share it and change is at one place. No need to change anything related to DB connection in your application when upgrading to new version of struts / or moving to Different MVC framework (spring)... Regards Guru -Original Message- From: Saravanan Vijayappan [mailto:[EMAIL PROTECTED] Sent: 22 May 2007 10:18 To: struts user Subject: Connection Pooling in Struts Hi To set up connection pooling in struts which is the recommended way whether and please explain the benifts 1) Configure through struts-config 2) Configure through Server (like in tomcat data-source configuration) Thanks Regards, Saravanan Vijayappan, +91 9448833571. Be a better Heartthrob. Get better relationship answers from someone who knows. Yahoo! Answers - Check it out. http://answers.yahoo.com/dir/?link=listsid=396545433 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT] Connection Pooling
Many thanks for your help, I managed to set connection pooling up (however, I don't know whether it uses conn. pooling or not...) To help others, here are all the configurations that need to be done: (This works with Tomcat 5.5, MySQL 5.0, Win XP SP2) 1) Place your database driver in your $CATALINA_HOME/common/lib directory along with the all the required jars (commons-dbcp, commons-pool, commons-collection) 2) open your server.xml and put the following lines between GlobalNamingResources/GlobalNamingResources tags (this is what I missed...) (Modify it properly...) Resource name=jdbc/akr_db auth=Container type=javax.sql.DataSource removeAbandoned=true removeAbandonedTimeout=30 maxActive=100 maxIdle=30 maxWait=1 username=balazs password=12345 driverClassName=com.mysql.jdbc.Driver url=jdbc:mysql://localhost:3306/akr_db/ 3) Create a context.xml file in your META-INF directory with the following contents: ?xml version=1.0 encoding=UTF-8? Context ResourceLink global=jdbc/akr_db name=jdbc/akr_db type=javax.sql.DataSource/ /Context (Modify it properly...) 4) Create a Java class with the following contents to get a connection from the pool: public class DBTest { String foo = Not Connected; String bar = Empty; public void init() { Connection conn = null; Statement stmt = null; // Or PreparedStatement if needed ResultSet rst = null; try{ Context ctx = new InitialContext(); if(ctx == null ) throw new Exception(Boom - No Context); Context envCtx = (Context) ctx.lookup(java:comp/env); DataSource ds = (DataSource) envCtx.lookup(jdbc/akr_db); if (ds != null) { conn = ds.getConnection(); if(conn != null) { foo = Got Connection +conn.toString(); stmt = conn.createStatement(); rst = stmt.executeQuery( select ID_paciens, vezeteknev, keresztnev from torzs_paciens); if(rst.next()) { foo=rst.getString(2); bar=rst.getString(3); } stmt.close(); stmt = null; conn.close(); conn = null; rst.close(); rst = null; } } }catch(Exception e) { e.printStackTrace(); } finally { // Always make sure result sets and statements are closed, // and the connection is returned to the pool if (rst != null) { try { rst.close(); } catch (SQLException e) { ; } rst = null; } if (stmt != null) { try { stmt.close(); } catch (SQLException e) { ; } stmt = null; } if (conn != null) { try { conn.close(); } catch (SQLException e) { ; } conn = null; } } } public String getFoo() { return foo; } public String getBar() { return bar;} } 5) Use the class from your JSP: % db_helpers.DBTest tst = new db_helpers.DBTest(); tst.init(); % h2Results/h2 Foo %= tst.getFoo() %br/ Bar %= tst.getBar() % -- - Original Message From: Nuwan Chandrasoma [EMAIL PROTECTED] To: Struts Users Mailing List user@struts.apache.org Sent: Tuesday, May 22, 2007 3:38:54 PM Subject: Re: [OT] Connection Pooling Hi, Sorry mate, i think you should ask this from another group like tomcat.., hope this link would give you some help http://tomcat.apache.org/tomcat-5.0-doc/jndi-datasource-examples-howto.html Thanks, Nuwan - Original Message - From: Balazs Michnay [EMAIL PROTECTED] To: Struts Users Mailing List user@struts.apache.org Sent: Tuesday, May 22, 2007 7:34 AM Subject: Re: [OT] Connection Pooling I forgot that I also have a resource-ref entry in my web.xml file... just in case it counts... resource-ref descriptionDB Connection/description res-ref-namejdbc/akr_db/res-ref-name res-typejavax.sql.DataSource/res-type res-authContainer/res-auth /resource-ref But still nothing :( Thanks, BM - Original Message From: Nuwan Chandrasoma [EMAIL PROTECTED] To: Struts Users Mailing List user@struts.apache.org Sent: Tuesday, May 22, 2007 2:33:34 PM Subject: Re: [OT] Connection Pooling hi, i just had a look, i think your url is wrong. where is the DB name? eg:- you have it like jdbc:mysql://localhost:3306 but should be like: jdbc:mysql://localhost:3306/akr_db Thanks
Re: [OT] Connection Pooling
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Balazs, Balazs Michnay wrote: Thanks for helping. Sure, here are all my settings. I think you have more configuration than you need. Here is exactly what I have for a similar setup (MySQL 5.x, Connector/J 5.x, Tomcat 5.5.x): Context reloadable=true Resource name=@DATASOURCE_REF@ auth=Container type=javax.sql.DataSource maxActive=1 maxIdle=1 maxWait=1 url=@DATABASE_URL@ username=@DATABASE_USERNAME@ password=@DATABASE_PASSWORD@ driverClassName=@DATABASE_DRIVER@ removeAbandoned=true removeAbandonedTimeout=30 logAbandoned=true / I checked, and all the values you are currently using for these settings look good. I'm not sure what the problem might be, but this configuration is /way/ easier to read. Perhaps ResourceParams is no longer used in TC 5.5... I used to use it in 4.1.x (with this configuration in server.xml), but when I upgraded, I started using this shorter syntax in the webapp's context.xml. The error message Cannot create JDBC driver of class '' for connect URL 'null' usually just means you are missing some tiny piece of configuration (or you have one tiny thing wrong). The devil is in the details... Hope that helps, - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.7 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFGUun79CaO5/Lv0PARAudkAJ9eQ9fxkuDJp+hF448KDpwPQJTzgACgnRWb 2SwXA4Jm75edJg28Nq5z/AE= =59qq -END PGP SIGNATURE- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT] Connection Pooling
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Balazs, Balazs Michnay wrote: 2) open your server.xml and put the following lines between GlobalNamingResources/GlobalNamingResources tags (this is what I missed...) (Modify it properly...) Although this is possible, most will recommend against it (including me). This will create a JNDI resource that is available to all webapps in your container. You probably only want it available to the webapp you are currently using. Resource name=jdbc/akr_db auth=Container type=javax.sql.DataSource removeAbandoned=true removeAbandonedTimeout=30 maxActive=100 maxIdle=30 maxWait=1 username=balazs password=12345 driverClassName=com.mysql.jdbc.Driver url=jdbc:mysql://localhost:3306/akr_db/ You should move this to your context.xml file, and remove the ResourceLink element from context.xml. Otherwise, keep these settings the same. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.7 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFGUusQ9CaO5/Lv0PARAmJlAKCMtg85QGBNtRsrKaBPcFoHeLxBlwCeL838 8cEGAm1lmvNQ6JidL65h5Cg= =1LZQ -END PGP SIGNATURE- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Connection Pooling How To ?
Hi All , i am developing a struts based web-application with JBoss 4.0.5 as Application Server and Oracle 10g Express edition . I am configuring my application for connection pooling . I have tried following methods : 1. Oracle Connection Pooling following thius link http://www.lc.leidenuniv.nl/awcourse/oracle/java.920/a96654/connpoca.htm 2. Configuring Jboss's Internal Container Level Connection pooling simply creating the datasources 3. JDBC level Connection Pooling but unluckily did not succeed in any of these method . The application works OK with Second method but When it is being hit with 200 request/second The pool gets exhaulsted . i am unable to decide which approach i should be using as my application can receive large no. of requests around 1000/sec ? Please help me out , Tell some useful link if possible .. Regards , Jasdeep -- View this message in context: http://www.nabble.com/Connection-Pooling--How-To---tf3796605.html#a10738742 Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]