Win a copy of TDD for a Shopping Website LiveProject this week in the Testing forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

populating a combo box

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
My name is tayo a java/struts programmer. I having problems with populating a combobox with stored procedures from MS SQL Server 2005 using the MVC model.
Please i need a materials and sample materials for how to solve this problem,
Thanks Tayo

===========================================================================

below is the error encountered

SEVERE: Error starting static Resources
java.lang.IllegalArgumentException: Document base C:\apache-tomcat-6.0.13\webapps\bralimited05 does not exist or is not a readable directory
at org.apache.naming.resources.FileDirContext.setDocBase(FileDirContext.java:141)
at org.apache.catalina.core.StandardContext.resourcesStart(StandardContext.java:3941)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4110)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
at org.apache.catalina.core.StandardService.start(StandardService.java:516)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
at org.apache.catalina.startup.Catalina.start(Catalina.java:566)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
Nov 24, 2008 10:35:26 AM org.apache.catalina.core.StandardContext start
SEVERE: Error in resourceStart()
Nov 24, 2008 10:35:26 AM org.apache.catalina.core.StandardContext start
SEVERE: Error getConfigured
Nov 24, 2008 10:35:26 AM org.apache.catalina.core.StandardContext start
SEVERE: Context [/bralimited05] startup failed due to previous errors
Nov 24, 2008 10:35:26 AM org.apache.catalina.core.StandardContext stop
INFO: Container org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/bralimited05] has not been started
Loading...Price Comp Session Data..........
AbandonedObjectPool is used (org.apache.tomcat.dbcp.dbcp.AbandonedObjectPool@609959)
LogAbandoned: false
RemoveAbandoned: true
RemoveAbandonedTimeout: 30
Nov 24, 2008 10:35:30 AM com.bralimited.jidetaiwo.ref.utility.Env getConnectionToBraProps
SEVERE: Sql error while trying to connect to db: Cannot create PoolableConnectionFactory (Login failed for user 'tbalogun'.)
java.lang.NullPointerException
at com.bralimited.jidetaiwo.utility.SessionListener.loadAllUserTypes(SessionListener.java:314)
at com.bralimited.jidetaiwo.utility.SessionListener.loadStartupValues(SessionListener.java:163)
at com.bralimited.jidetaiwo.utility.SessionListener.<init>(SessionListener.java:69)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at java.lang.Class.newInstance0(Class.java:355)
at java.lang.Class.newInstance(Class.java:308)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3771)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4334)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
at org.apache.catalina.core.StandardService.start(StandardService.java:516)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
at org.apache.catalina.startup.Catalina.start(Catalina.java:566)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
AbandonedObjectPool is used (org.apache.tomcat.dbcp.dbcp.AbandonedObjectPool@1d6a56e)
LogAbandoned: false
RemoveAbandoned: true
RemoveAbandonedTimeout: 30
Nov 24, 2008 10:35:30 AM com.bralimited.jidetaiwo.ref.utility.Env getConnectionToBraProps
SEVERE: Sql error while trying to connect to db: Cannot create PoolableConnectionFactory (Login failed for user 'tbalogun'.)
java.lang.NullPointerException
at com.bralimited.jidetaiwo.utility.SessionListener.loadAllStates(SessionListener.java:185)
at com.bralimited.jidetaiwo.utility.SessionListener.<init>(SessionListener.java:71)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at java.lang.Class.newInstance0(Class.java:355)
at java.lang.Class.newInstance(Class.java:308)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3771)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4334)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
at org.apache.catalina.core.StandardService.start(StandardService.java:516)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
at org.apache.catalina.startup.Catalina.start(Catalina.java:566)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
AbandonedObjectPool is used (org.apache.tomcat.dbcp.dbcp.AbandonedObjectPool@1b06041)
LogAbandoned: false
RemoveAbandoned: true
RemoveAbandonedTimeout: 30
Nov 24, 2008 10:35:30 AM com.bralimited.jidetaiwo.ref.utility.Env getConnectionToBraProps
SEVERE: Sql error while trying to connect to db: Cannot create PoolableConnectionFactory (Login failed for user 'tbalogun'.)
java.lang.NullPointerException
at com.bralimited.jidetaiwo.utility.SessionListener.loadAllTown(SessionListener.java:281)
at com.bralimited.jidetaiwo.utility.SessionListener.<init>(SessionListener.java:72)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at java.lang.Class.newInstance0(Class.java:355)
at java.lang.Class.newInstance(Class.java:308)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3771)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4334)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
at org.apache.catalina.core.StandardService.start(StandardService.java:516)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
at org.apache.catalina.startup.Catalina.start(Catalina.java:566)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
AbandonedObjectPool is used (org.apache.tomcat.dbcp.dbcp.AbandonedObjectPool@7f5580)
LogAbandoned: false
RemoveAbandoned: true
RemoveAbandonedTimeout: 30
Nov 24, 2008 10:35:30 AM com.bralimited.jidetaiwo.ref.utility.Env getConnectionToBraProps
SEVERE: Sql error while trying to connect to db: Cannot create PoolableConnectionFactory (Login failed for user 'tbalogun'.)
java.lang.NullPointerException
at com.bralimited.jidetaiwo.utility.SessionListener.loadAllLocalGovt(SessionListener.java:249)
at com.bralimited.jidetaiwo.utility.SessionListener.<init>(SessionListener.java:74)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at java.lang.Class.newInstance0(Class.java:355)
at java.lang.Class.newInstance(Class.java:308)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3771)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4334)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
at org.apache.catalina.core.StandardService.start(StandardService.java:516)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
at org.apache.catalina.startup.Catalina.start(Catalina.java:566)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
AbandonedObjectPool is used (org.apache.tomcat.dbcp.dbcp.AbandonedObjectPool@1c6572b)
LogAbandoned: false
RemoveAbandoned: true
RemoveAbandonedTimeout: 30
Nov 24, 2008 10:35:30 AM com.bralimited.jidetaiwo.ref.utility.Env getConnectionToBraProps
SEVERE: Sql error while trying to connect to db: Cannot create PoolableConnectionFactory (Login failed for user 'tbalogun'.)
java.lang.NullPointerException
at com.bralimited.jidetaiwo.utility.SessionListener.loadAllTranTypes(SessionListener.java:346)
at com.bralimited.jidetaiwo.utility.SessionListener.<init>(SessionListener.java:75)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at java.lang.Class.newInstance0(Class.java:355)
at java.lang.Class.newInstance(Class.java:308)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3771)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4334)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
at org.apache.catalina.core.StandardService.start(StandardService.java:516)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
at org.apache.catalina.startup.Catalina.start(Catalina.java:566)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
AbandonedObjectPool is used (org.apache.tomcat.dbcp.dbcp.AbandonedObjectPool@84cc09)
LogAbandoned: false
RemoveAbandoned: true
RemoveAbandonedTimeout: 30
Nov 24, 2008 10:35:30 AM com.bralimited.jidetaiwo.ref.utility.Env getConnectionToBraProps
SEVERE: Sql error while trying to connect to db: Cannot create PoolableConnectionFactory (Login failed for user 'tbalogun'.)
java.lang.NullPointerException
at com.bralimited.jidetaiwo.utility.SessionListener.loadAllPropertyTypes(SessionListener.java:374)
at com.bralimited.jidetaiwo.utility.SessionListener.<init>(SessionListener.java:76)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at java.lang.Class.newInstance0(Class.java:355)
at java.lang.Class.newInstance(Class.java:308)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3771)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4334)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
at org.apache.catalina.core.StandardService.start(StandardService.java:516)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
at org.apache.catalina.startup.Catalina.start(Catalina.java:566)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
AbandonedObjectPool is used (org.apache.tomcat.dbcp.dbcp.AbandonedObjectPool@6f9b8e)
LogAbandoned: false
RemoveAbandoned: true
RemoveAbandonedTimeout: 30
Nov 24, 2008 10:35:30 AM com.bralimited.jidetaiwo.ref.utility.Env getConnectionToBraProps
SEVERE: Sql error while trying to connect to db: Cannot create PoolableConnectionFactory (Login failed for user 'tbalogun'.)
java.lang.NullPointerException
at com.bralimited.jidetaiwo.utility.SessionListener.loadAllCurrency(SessionListener.java:460)
at com.bralimited.jidetaiwo.utility.SessionListener.<init>(SessionListener.java:77)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at java.lang.Class.newInstance0(Class.java:355)
at java.lang.Class.newInstance(Class.java:308)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3771)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4334)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
at org.apache.catalina.core.StandardService.start(StandardService.java:516)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
at org.apache.catalina.startup.Catalina.start(Catalina.java:566)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
Done
Nov 24, 2008 10:35:30 AM org.apache.catalina.core.ApplicationContext log
INFO: No Configuration for this context. Initializing.
Nov 24, 2008 10:35:30 AM org.apache.catalina.core.ApplicationContext log
INFO: configuring cewolf app..
Nov 24, 2008 10:35:30 AM org.apache.catalina.core.ApplicationContext log
INFO: using storage class de.laures.cewolf.storage.TransientSessionStorage
Nov 24, 2008 10:35:30 AM org.apache.catalina.core.ApplicationContext log
INFO: using overlibURL etc/overlib.js
Nov 24, 2008 10:35:30 AM org.apache.catalina.core.ApplicationContext log
INFO: debugging is turned on
Nov 24, 2008 10:35:30 AM org.apache.catalina.core.ApplicationContext log
INFO: ...done.
Nov 24, 2008 10:35:31 AM org.apache.catalina.core.ApplicationContext log
INFO: ContextListener: contextInitialized()
Nov 24, 2008 10:35:31 AM org.apache.catalina.core.ApplicationContext log
INFO: SessionListener: contextInitialized()
Nov 24, 2008 10:35:31 AM org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on http-8080
Nov 24, 2008 10:35:32 AM org.apache.jk.common.ChannelSocket init
INFO: JK: ajp13 listening on /0.0.0.0:8008
Nov 24, 2008 10:35:32 AM org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/61 config=null
Nov 24, 2008 10:35:32 AM org.apache.catalina.startup.Catalina start
INFO: Server startup in 13284 ms
Nov 24, 2008 1:00:23 PM org.apache.catalina.core.StandardContext reload
INFO: Reloading this Context has started
Nov 24, 2008 1:00:36 PM org.apache.catalina.core.ApplicationContext log
INFO: No Configuration for this context. Initializing.
Nov 24, 2008 1:00:36 PM org.apache.catalina.core.ApplicationContext log
INFO: configuring cewolf app..
Nov 24, 2008 1:00:36 PM org.apache.catalina.core.ApplicationContext log
INFO: using storage class de.laures.cewolf.storage.TransientSessionStorage
Nov 24, 2008 1:00:36 PM org.apache.catalina.core.ApplicationContext log
INFO: using overlibURL pages/scripts/overlib.js
Nov 24, 2008 1:00:36 PM org.apache.catalina.core.ApplicationContext log
INFO: debugging is turned off
Nov 24, 2008 1:00:36 PM org.apache.catalina.core.ApplicationContext log
INFO: ...done.
AbandonedObjectPool is used (org.apache.tomcat.dbcp.dbcp.AbandonedObjectPool@15e538e)
LogAbandoned: false
RemoveAbandoned: true
RemoveAbandonedTimeout: 30
Error retrieving the data source from the context...
org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Login failed for user 'tbalogun'.)
at org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1225)
at org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:880)
at com.bralimited.common.utility.Env.getConnectionBraRating(Env.java:75)
at com.bralimited.brarating.model.RatioService.connectToDb(RatioService.java:57)
at com.bralimited.brarating.model.RatioService.getAllSectors(RatioService.java:258)
at org.apache.jsp.CalculateRatios_jsp._jspService(CalculateRatios_jsp.java:318)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:393)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:261)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:581)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.sql.SQLException: Login failed for user 'tbalogun'.
at net.sourceforge.jtds.jdbc.SQLDiagnostic.addDiagnostic(SQLDiagnostic.java:365)
at net.sourceforge.jtds.jdbc.TdsCore.tdsErrorToken(TdsCore.java:2781)
at net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.java:2224)
at net.sourceforge.jtds.jdbc.TdsCore.login(TdsCore.java:599)
at net.sourceforge.jtds.jdbc.ConnectionJDBC2.<init>(ConnectionJDBC2.java:331)
at net.sourceforge.jtds.jdbc.ConnectionJDBC3.<init>(ConnectionJDBC3.java:50)
at net.sourceforge.jtds.jdbc.Driver.connect(Driver.java:178)
at org.apache.tomcat.dbcp.dbcp.DriverConnectionFactory.createConnection(DriverConnectionFactory.java:38)
at org.apache.tomcat.dbcp.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:294)
at org.apache.tomcat.dbcp.dbcp.BasicDataSource.validateConnectionFactory(BasicDataSource.java:1247)
at org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1221)
... 23 more
AbandonedObjectPool is used (org.apache.tomcat.dbcp.dbcp.AbandonedObjectPool@1bfa3d3)
LogAbandoned: false
RemoveAbandoned: true
RemoveAbandonedTimeout: 30
Error retrieving the data source from the context...
org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Login failed for user 'tbalogun'.)
at org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1225)
at org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:880)
at com.bralimited.common.utility.Env.reconnectBraRating(Env.java:94)
at com.bralimited.common.utility.Env.getConnectionBraRating(Env.java:84)
at com.bralimited.brarating.model.RatioService.connectToDb(RatioService.java:57)
at com.bralimited.brarating.model.RatioService.getAllSectors(RatioService.java:258)
at org.apache.jsp.CalculateRatios_jsp._jspService(CalculateRatios_jsp.java:318)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:393)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:261)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:581)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.sql.SQLException: Login failed for user 'tbalogun'.
at net.sourceforge.jtds.jdbc.SQLDiagnostic.addDiagnostic(SQLDiagnostic.java:365)
at net.sourceforge.jtds.jdbc.TdsCore.tdsErrorToken(TdsCore.java:2781)
at net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.java:2224)
at net.sourceforge.jtds.jdbc.TdsCore.login(TdsCore.java:599)
at net.sourceforge.jtds.jdbc.ConnectionJDBC2.<init>(ConnectionJDBC2.java:331)
at net.sourceforge.jtds.jdbc.ConnectionJDBC3.<init>(ConnectionJDBC3.java:50)
at net.sourceforge.jtds.jdbc.Driver.connect(Driver.java:178)
at org.apache.tomcat.dbcp.dbcp.DriverConnectionFactory.createConnection(DriverConnectionFactory.java:38)
at org.apache.tomcat.dbcp.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:294)
at org.apache.tomcat.dbcp.dbcp.BasicDataSource.validateConnectionFactory(BasicDataSource.java:1247)
at org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1221)
... 24 more
java.lang.NullPointerException
at com.bralimited.brarating.model.RatioService.connectToDb(RatioService.java:59)
at com.bralimited.brarating.model.RatioService.getAllSectors(RatioService.java:258)
at org.apache.jsp.CalculateRatios_jsp._jspService(CalculateRatios_jsp.java:318)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:393)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:261)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:581)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:619)
AbandonedObjectPool is used (org.apache.tomcat.dbcp.dbcp.AbandonedObjectPool@d8ca48)
LogAbandoned: false
RemoveAbandoned: true
RemoveAbandonedTimeout: 30
Error retrieving the data source from the context...
org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Login failed for user 'tbalogun'.)
at org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1225)
at org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:880)
at com.bralimited.common.utility.Env.getConnectionBraRating(Env.java:75)
at com.bralimited.brarating.model.RatioService.connectToDb(RatioService.java:57)
at com.bralimited.brarating.model.RatioService.getCompanyBySector(RatioService.java:286)
at org.apache.jsp.CalculateRatios_jsp._jspService(CalculateRatios_jsp.java:523)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:393)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:261)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:581)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.sql.SQLException: Login failed for user 'tbalogun'.
at net.sourceforge.jtds.jdbc.SQLDiagnostic.addDiagnostic(SQLDiagnostic.java:365)
at net.sourceforge.jtds.jdbc.TdsCore.tdsErrorToken(TdsCore.java:2781)
at net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.java:2224)
at net.sourceforge.jtds.jdbc.TdsCore.login(TdsCore.java:599)
at net.sourceforge.jtds.jdbc.ConnectionJDBC2.<init>(ConnectionJDBC2.java:331)
at net.sourceforge.jtds.jdbc.ConnectionJDBC3.<init>(ConnectionJDBC3.java:50)
at net.sourceforge.jtds.jdbc.Driver.connect(Driver.java:178)
at org.apache.tomcat.dbcp.dbcp.DriverConnectionFactory.createConnection(DriverConnectionFactory.java:38)
at org.apache.tomcat.dbcp.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:294)
at org.apache.tomcat.dbcp.dbcp.BasicDataSource.validateConnectionFactory(BasicDataSource.java:1247)
at org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1221)
... 23 more
AbandonedObjectPool is used (org.apache.tomcat.dbcp.dbcp.AbandonedObjectPool@caf0ed)
LogAbandoned: false
RemoveAbandoned: true
RemoveAbandonedTimeout: 30
Error retrieving the data source from the context...
org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Login failed for user 'tbalogun'.)
at org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1225)
at org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:880)
at com.bralimited.common.utility.Env.reconnectBraRating(Env.java:94)
at com.bralimited.common.utility.Env.getConnectionBraRating(Env.java:84)
at com.bralimited.brarating.model.RatioService.connectToDb(RatioService.java:57)
at com.bralimited.brarating.model.RatioService.getCompanyBySector(RatioService.java:286)
at org.apache.jsp.CalculateRatios_jsp._jspService(CalculateRatios_jsp.java:523)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:393)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:261)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:581)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.sql.SQLException: Login failed for user 'tbalogun'.
at net.sourceforge.jtds.jdbc.SQLDiagnostic.addDiagnostic(SQLDiagnostic.java:365)
at net.sourceforge.jtds.jdbc.TdsCore.tdsErrorToken(TdsCore.java:2781)
at net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.java:2224)
at net.sourceforge.jtds.jdbc.TdsCore.login(TdsCore.java:599)
at net.sourceforge.jtds.jdbc.ConnectionJDBC2.<init>(ConnectionJDBC2.java:331)
at net.sourceforge.jtds.jdbc.ConnectionJDBC3.<init>(ConnectionJDBC3.java:50)
at net.sourceforge.jtds.jdbc.Driver.connect(Driver.java:178)
at org.apache.tomcat.dbcp.dbcp.DriverConnectionFactory.createConnection(DriverConnectionFactory.java:38)
at org.apache.tomcat.dbcp.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:294)
at org.apache.tomcat.dbcp.dbcp.BasicDataSource.validateConnectionFactory(BasicDataSource.java:1247)
at org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1221)
... 24 more
java.lang.NullPointerException
at com.bralimited.brarating.model.RatioService.connectToDb(RatioService.java:59)
at com.bralimited.brarating.model.RatioService.getCompanyBySector(RatioService.java:286)
at org.apache.jsp.CalculateRatios_jsp._jspService(CalculateRatios_jsp.java:523)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:393)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:261)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:581)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:619)
AbandonedObjectPool is used (org.apache.tomcat.dbcp.dbcp.AbandonedObjectPool@717d91)
LogAbandoned: false
RemoveAbandoned: true
RemoveAbandonedTimeout: 30
Error retrieving the data source from the context...
org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Login failed for user 'tbalogun'.)
at org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1225)
at org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:880)
at com.bralimited.common.utility.Env.getConnectionBraRating(Env.java:75)
at com.bralimited.brarating.model.RatioService.connectToDb(RatioService.java:57)
at com.bralimited.brarating.model.RatioService.getInsuranceType(RatioService.java:336)
at org.apache.jsp.CalculateRatios_jsp._jspService(CalculateRatios_jsp.java:734)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:393)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:261)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:581)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.sql.SQLException: Login failed for user 'tbalogun'.
at net.sourceforge.jtds.jdbc.SQLDiagnostic.addDiagnostic(SQLDiagnostic.java:365)
at net.sourceforge.jtds.jdbc.TdsCore.tdsErrorToken(TdsCore.java:2781)
at net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.java:2224)
at net.sourceforge.jtds.jdbc.TdsCore.login(TdsCore.java:599)
at net.sourceforge.jtds.jdbc.ConnectionJDBC2.<init>(ConnectionJDBC2.java:331)
at net.sourceforge.jtds.jdbc.ConnectionJDBC3.<init>(ConnectionJDBC3.java:50)
at net.sourceforge.jtds.jdbc.Driver.connect(Driver.java:178)
at org.apache.tomcat.dbcp.dbcp.DriverConnectionFactory.createConnection(DriverConnectionFactory.java:38)
at org.apache.tomcat.dbcp.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:294)
at org.apache.tomcat.dbcp.dbcp.BasicDataSource.validateConnectionFactory(BasicDataSource.java:1247)
at org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1221)
... 23 more
AbandonedObjectPool is used (org.apache.tomcat.dbcp.dbcp.AbandonedObjectPool@eafb71)
LogAbandoned: false
RemoveAbandoned: true
RemoveAbandonedTimeout: 30
Error retrieving the data source from the context...
org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Login failed for user 'tbalogun'.)
at org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1225)
at org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:880)
at com.bralimited.common.utility.Env.reconnectBraRating(Env.java:94)
at com.bralimited.common.utility.Env.getConnectionBraRating(Env.java:84)
at com.bralimited.brarating.model.RatioService.connectToDb(RatioService.java:57)
at com.bralimited.brarating.model.RatioService.getInsuranceType(RatioService.java:336)
at org.apache.jsp.CalculateRatios_jsp._jspService(CalculateRatios_jsp.java:734)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:393)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:261)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:581)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.sql.SQLException: Login failed for user 'tbalogun'.
at net.sourceforge.jtds.jdbc.SQLDiagnostic.addDiagnostic(SQLDiagnostic.java:365)
at net.sourceforge.jtds.jdbc.TdsCore.tdsErrorToken(TdsCore.java:2781)
at net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.java:2224)
at net.sourceforge.jtds.jdbc.TdsCore.login(TdsCore.java:599)
at net.sourceforge.jtds.jdbc.ConnectionJDBC2.<init>(ConnectionJDBC2.java:331)
at net.sourceforge.jtds.jdbc.ConnectionJDBC3.<init>(ConnectionJDBC3.java:50)
at net.sourceforge.jtds.jdbc.Driver.connect(Driver.java:178)
at org.apache.tomcat.dbcp.dbcp.DriverConnectionFactory.createConnection(DriverConnectionFactory.java:38)
at org.apache.tomcat.dbcp.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:294)
at org.apache.tomcat.dbcp.dbcp.BasicDataSource.validateConnectionFactory(BasicDataSource.java:1247)
at org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1221)
... 24 more
Error
java.lang.NullPointerException
at com.bralimited.brarating.model.RatioService.connectToDb(RatioService.java:59)
at com.bralimited.brarating.model.RatioService.getInsuranceType(RatioService.java:336)
at org.apache.jsp.CalculateRatios_jsp._jspService(CalculateRatios_jsp.java:734)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:393)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:261)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:581)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:619)

===========================================================================Below is the Model class written by me-
===========================================================================

package com.bralimited.brarating.model;

import java.sql.CallableStatement;
import java.sql.Connection;
import java.sql.ResultSet;
import java.util.ArrayList;

import com.bralimited.brarating.dto.common.Sector;
import com.bralimited.brarating.ref.dto.Reference;
import com.bralimited.common.utility.Env;

public class RatioService {

private CallableStatement calproc;
private CallableStatement cal_yrlycomp_grp;
private CallableStatement get_compbySector;
private CallableStatement cal_insuryearly_ratios;
private CallableStatement cal_manyearly_ratios;
private CallableStatement get_mainInsurTypes;
private CallableStatement get_mainSector;
private Connection con;
private ResultSet result;
public int output = -1, opcode;

private final boolean already_tried_reconnection = false;

/**
* This method is used to close all connection to the database.
*/
private void closeConnection() {
if (result != null) {
try {
result.close();
result = null;
} catch (Exception ignore) {
}
}
if (con != null) {
try {
con.close();
con = null;
} catch (Exception ignore) {
}
}

}// end of closeConnection() method.

/**
* This method is used to connect to the bra rating database, it calls a
* method in the Env class, which actually does the connection and returns a
* connection object.
*
* @throws Exception
*/
private void connectToDb() throws Exception {
closeConnection();
con = Env.getConnectionBraRating();

calproc = con.prepareCall("{call cal_yearly_ratios(?,?)}");
cal_yrlycomp_grp = con.prepareCall("{call cal_yrlycomp_grp_sp(?.?)}");
get_compbySector = con.prepareCall("call get_compbySector_sp(?)");
cal_insuryearly_ratios = con
.prepareCall("{call cal_insuryearly_ratios_sp(?,?,?,?)}");
cal_manyearly_ratios = con
.prepareCall("{call cal_manyearly_ratios_sp(?,?,?)}");
get_mainInsurTypes = con
.prepareCall("{call get_mainInsurTypes_sp(?,?)}");
get_mainSector = con.prepareCall("{call get_mainSector_sp(?,?)}");

}

// end of connetToDb() method.

/*
* This method is used to calculate yearly ratio
*/
public String calculateYearlyRatio(String year) {

try {
output = -1;

connectToDb();
calproc.setInt(1, Integer.parseInt(year));
calproc.setInt(2, output);
calproc.registerOutParameter(2, java.sql.Types.INTEGER);
calproc.execute();

while (calproc.getMoreResults()) {
result = calproc.getResultSet();
}
try {
output = calproc.getInt(2);
}

catch (Exception ex) {
output = 0;
}
if (output == 1) {
con.commit();
return "Manufacturing Ratio successfully calculated";
} else if (output == 2) {
con.commit();
return "Insurance Ratio successfully calculated";
} else {
con.rollback();
closeConnection();
return "An unrecognized return code was sent from the database, please consult your programmer. Code: "
+ output;

}
} catch (Exception e) {

e.printStackTrace();
closeConnection();
return "Calculation error";

} finally {
closeConnection();
}
}

public String calcYearlyCompanyGroup(String fin_dt) {
String str = "";
try {
output = 0;
connectToDb();
cal_yrlycomp_grp.setString(1, (fin_dt));
cal_yrlycomp_grp.setInt(2, output);
cal_yrlycomp_grp.registerOutParameter(2, java.sql.Types.INTEGER);
cal_yrlycomp_grp.execute();

while (cal_yrlycomp_grp.getMoreResults()) {
result = cal_yrlycomp_grp.getResultSet();
}
try {
output = cal_yrlycomp_grp.getInt(2);
} catch (Exception ex) {
output = 0;
}
if (output == 0) {
con.commit();
return "Ratio successfully calculated";
}
if (output == 1) {
con.commit();
return "Error in calculation";
} else if (output == 2) {
con.rollback();
closeConnection();
return "";
}
} catch (Exception e) {

e.printStackTrace();
closeConnection();
return "Calculation error";

} finally {
closeConnection();
}
return str;
}

public String calcInsuranceYearlyRatio(String fin_dt, String comp_cd,
String insur_business_id) {
String str = "";

try {
output = 0;
connectToDb();
cal_insuryearly_ratios.setString(1, fin_dt);
cal_insuryearly_ratios.setString(2, comp_cd);
cal_insuryearly_ratios.setString(3, insur_business_id);
cal_insuryearly_ratios.setInt(4, output);
cal_insuryearly_ratios.registerOutParameter(4,
java.sql.Types.INTEGER);
cal_insuryearly_ratios.execute();
while (cal_insuryearly_ratios.getMoreResults()) {
result = cal_insuryearly_ratios.getResultSet();
}
try {
output = cal_insuryearly_ratios.getInt(4);
} catch (Exception ex) {
output = 0;
}
if (output == 5 || output == 7) {
con.commit();
return "Ratio successfully calculated";
}
if (output == 6) {
con.commit();
return "Life insurance successfuly calculated";
} else if (output == 8) {
con.rollback();
closeConnection();
return "error";
}
} catch (Exception e) {

e.printStackTrace();
closeConnection();
return "Calculation error";

} finally {
closeConnection();
}
return str;
}

public String calcManufacturingYearlyRatio(String fin_dt, String comp_cd) {
String str = "";

try {
output = 0;
connectToDb();
cal_manyearly_ratios.setString(1, fin_dt);
cal_manyearly_ratios.setString(2, comp_cd);
// cal_insuryearly_ratios.setString(3, insur_business_id);
cal_manyearly_ratios.setInt(3, output);
cal_manyearly_ratios
.registerOutParameter(3, java.sql.Types.INTEGER);
cal_manyearly_ratios.execute();
while (cal_manyearly_ratios.getMoreResults()) {
result = cal_manyearly_ratios.getResultSet();
}
try {
output = cal_manyearly_ratios.getInt(3);
} catch (Exception ex) {
output = 0;
}
if (output == 1) {
con.commit();
return "Ratio successfully calculated";
}
if (output == 2) {
con.commit();
return "Life insurance successfuly calculated";
} else if (output == 3) {
con.rollback();
closeConnection();
return "error";
}
} catch (Exception e) {

e.printStackTrace();
closeConnection();
return "Calculation error";

} finally {
closeConnection();
}
return str;
}

public ArrayList<Sector> getAllSectors(String main_sector_id) {
ArrayList<Sector> list = new ArrayList<Sector>();
try {
connectToDb();
// String sec = null;
get_mainSector.setInt(1, 0);
// get_mainSector.setString(2, null);
result = get_mainSector.executeQuery();
while (result.next()) {
try {
Sector sctr = new Sector(result.getString(1).trim(), result
.getString(2).trim());
list.add(sctr);
} catch (Exception itx) {
itx.printStackTrace();
}
}
closeConnection();

} catch (Exception ex) {
ex.printStackTrace();
closeConnection();
} finally {
closeConnection();
}
return list;
}

public ArrayList<Reference> getCompanyBySector(String comp_cd) {
ArrayList<Reference> list = new ArrayList<Reference>();
try {
connectToDb();
String comp = "";
get_compbySector.setString(1, comp);
result = get_compbySector.executeQuery();
while (result.next()) {
try {
Reference ref = new Reference(result.getString(1).trim(),
result.getString(2).trim());
list.add(ref);
} catch (Exception itx) {
itx.printStackTrace();
}
}
closeConnection();

} catch (Exception ex) {
ex.printStackTrace();
closeConnection();
} finally {
closeConnection();
}
return list;
}

public String getSectorName(String main_sector_id) {
try {
connectToDb();

get_compbySector.setInt(1, Integer.parseInt(main_sector_id));
result = get_compbySector.executeQuery();
if (result.next()) {
String nm = result.getString("main_sector_nm");
closeConnection();
return nm;
} else {
closeConnection();
return "UNKNOWN";
}
} catch (Exception e) {
closeConnection();
return "UNKNOWN";
} finally {
closeConnection();
}
}

public ArrayList<Reference> getInsuranceType(String insur_business_id) {
ArrayList<Reference> list = new ArrayList<Reference>();
try {
String str = "";
connectToDb();
get_mainInsurTypes.setString(1, str);
// get_mainInsurTypes.setString(2, business_type);
result = get_mainInsurTypes.executeQuery();
while (result.next()) {
try {
Reference ref = new Reference(result.getString(1).trim(),
result.getString(2).trim());
list.add(ref);
} catch (Exception itx) {
itx.printStackTrace();
}
}
closeConnection();

} catch (Exception e) {
System.out.println("Error");
e.printStackTrace();
} finally {
closeConnection();
}
return list;
}

/**
* @return Returns the already_tried_reconnection.
*/
public boolean isAlready_tried_reconnection() {
return already_tried_reconnection;
}

}
===========================================================================
Below is the Action class-
===========================================================================
package com.bralimited.brarating.action;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.actions.MappingDispatchAction;

import com.bralimited.brarating.formbean.RatioForm;
import com.bralimited.brarating.model.RatioService;

public class RatioAction extends MappingDispatchAction {
public ActionForward calculateRatio(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws Exception {
RatioService rservice = new RatioService();
RatioForm ratioForm = (RatioForm) form;
String year = ratioForm.getFin_dt();
System.out.println("getOperationtype ()method");
String ratio = rservice.calculateYearlyRatio(year);
ratioForm.setMessage(ratio);

return mapping.getInputForward();

}

public ActionForward calYearlyGrpRatio(ActionMapping mapping,
ActionForm form, HttpServletRequest request,
HttpServletResponse response) throws Exception {
RatioService rservice = new RatioService();
RatioForm ratioForm = (RatioForm) form;
String fin_dt = ratioForm.getFin_dt();
String ratio = rservice.calcYearlyCompanyGroup(fin_dt);
ratioForm.setMessage(ratio);
return mapping.getInputForward();
}

/**
* public ActionForward getCompanyYrlyRatio(ActionMapping mapping,
* ActionForm form, HttpServletRequest request, HttpServletResponse
* response) throws Exception { RatioForm ratioForm = (RatioForm) form;
* RatioService rservice = new RatioService(); ` *String comp =
* ratioForm.getComp_cd(); ArrayList list =
* rservice.getCompanyBySector(comp); ratioForm.setMessage(list);
*
* return mapping.getInputForward();
*/

public ActionForward CalcalateRatio(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws Exception {
RatioForm ratioForm = (RatioForm) form;
RatioService rservice = new RatioService();
String fin_dt = ratioForm.getFin_dt();
String comp_cd = ratioForm.getComp_cd();
String insur_business_id = ratioForm.getInsur_business_id();
String sector = ratioForm.getMain_sector_id();
String sector_nm = ratioForm.getMain_sector_nm();
String msg = "";
if (sector.equals("Manufacturing")) {
msg = rservice.calcManufacturingYearlyRatio(fin_dt, comp_cd);
} else if (sector.equals("Insurance")) {
msg = rservice.calcInsuranceYearlyRatio(fin_dt, comp_cd,
insur_business_id);
}
ratioForm.setMessage(msg);
if (msg.indexOf("group") > 0) {
ratioForm.setFin_dt("");
ratioForm.setComp_cd("");
ratioForm.setMain_sector_id("");
ratioForm.setMain_sector_nm("");
ratioForm.doReset();
return mapping.getInputForward();

} else {
ratioForm.setMessage("Please choose the correct option");
}
return mapping.getInputForward();

}
}
===========================================================================
below is the jsp page with the combo box
===========================================================================
<%@ page language="java"%>
<%@ page import="java.util.ArrayList"%>

<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html"%>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic"%>
<%@ taglib uri="http://struts.apache.org/tags-tiles" prefix="tiles"%>
<%@page import="com.bralimited.brarating.model.RatioService"%>

<%@page import="com.bralimited.brarating.dto.common.Sector"%>

<html>
<% String selected_year="1970",selected_comp;%>
<% String selected_insurtype=""; %>
<% String sel_sector_det=""; %>
<% String sel_sector=""; %>
<jsp:useBean id="service"
class="com.bralimited.brarating.model.RatioService"></jsp:useBean>
<html:errors />

<body>
<html:form action="/calculateRatio">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="200" align="left"><font size="3" face="Narrow Arial">Year</font></td>
<td align="left"><html:select property="fin_dt">
<option value=""></option>
<logic resent name="ratioForm" property="fin_dt">
<bean efine id="r_year" name="ratioForm" property="fin_dt"
type="java.lang.String" />
<%selected_year= r_year; %>
</logic resent>

<%
for(int i=1980; i <= 2500; i++){
if(i==Integer.parseInt(selected_year)){
out.println("<option value=\"" + i + "\" selected>" + i+ "</option>");
}else{
out.println("<option value=\"" + i + "\">" + i+ "</option>");
}
}
%>
</html:select></td>

</tr>

<tr>
<td width="200" align="left"><font size="3" face="Narrow Arial">Sector
* :</font></td>
<td align="left"><html:select property="main_sector_id"
onchange="document.forms[0].comp_cd.value='';document.forms[0].operationtype.value='';document.forms[0].submit();">
<option value="0"></option>

<logic resent name="ratioForm" property="main_sector_id">
<bean efine id="sector_id" name="ratioForm"
property="main_sector_id" type="java.lang.String" />
<% sel_sector = sector_id; %>
</logic resent>

<%
java.util.List sectors = new RatioService().getAllSectors(sel_sector);
%>
<logic:iterate id="sector" collection="<%= sectors %>">
<logic:equal name="sector" property="main_sector_id"
value="<%= sel_sector %>">
<option value="<bean:write name="sector" property="main_sector_id"/>"selected>
<bean:write name="sector"property="main_sector_nm" /></option>
</logic:equal>
<logic:notEqual name="sector" property="main_sector_id"
value="<%= sel_sector %>">
<option
value='<bean:write name="sector" property="main_sector_id"/>'><bean:write
name="sector" property="main_sector_nm" /></option>
</logic:notEqual>
</logic:iterate>

</html:select></td>
</tr>
<tr>
<td width="200" align="left"><a name="edit"></a> <font
color="black" face="Narrow Arial" size="3">Sector Detail:</font></td>
<td align="left"><html:select property="comp_cd"
onchange="document.forms[0].insur_business_id.value='';document.forms[0].operationtype.value='';document.forms[0].submit();">

<option value="0"></option>


<logic resent name="ratioForm" property="comp_cd">
<bean efine id="sector_det_id" name="ratioForm" property="comp_cd"
type="java.lang.String" />
<% sel_sector_det = sector_det_id; %>
</logic resent>

<%
java.util.List sector_dets = new RatioService().getCompanyBySector(sel_sector);
%>
<logic:iterate id="sector_det" collection="<%= sector_dets %>">
<logic:equal name="sector_det" property="comp_cd"
value="<%= sel_sector_det %>">
<option value='<bean:write name="sector_det" property="comp_cd"/>'
selected><bean:write name="sector_det"
property="comp_nm" /></option>
</logic:equal>
<logic:notEqual name="sector_det" property="comp_cd"
value="<%= sel_sector_det %>">
<option value='<bean:write name="sector_det" property="comp_cd"/>'><bean:write
name="sector_det" property="comp_nm" /></option>
</logic:notEqual>
</logic:iterate>


</html:select></td>
</tr>
<tr>
<td width="100" align="left"><input type="radio"
name="insur_business_id"
<logic resent name="ratioForm" property="insur_business_id">
<logic:equal name="ratioForm" property="insur_business_id" value="group_no">
checked
</logic:equal>
</logic resent>
<logic:notPresent name="ratioForm" property="insur_business">
checked
</logic:notPresent>>Select
Insurance type :</td>
<td><html:select property="insur_business_id"
onchange="document.forms[0].operationtype.value='';document.forms[0].submit();">
<option value=""></option>

<logic resent name="ratioForm" property="insur_business_id">
<bean efine id="insur_id" name="ratioForm"
property="insur_business_id" type="java.lang.String" />
<% selected_insurtype = insur_id; %>
</logic resent>
<%
java.util.List insur_type = new RatioService().getInsuranceType(sel_sector);
%>
<logic:iterate id="insur_id" collection="<%= insur_type %>">
<logic:equal name="insur_id" property="insur_business_id"
value="<%= selected_insurtype %>">
<option
value='<bean:write name="insur_id" property="insur_business_id"/>'
selected><bean:write name="insur_id"
property="business_type" /></option>
</logic:equal>
<logic:notEqual name="insur_id" property="insur_business_id"
value="<%= selected_insurtype %>">
<option
value='<bean:write name="insur_id" property="insur_business_id"/>'><bean:write
name="insur_id" property="business_type" /></option>
</logic:notEqual>
</logic:iterate>
</html:select></td>
</tr>

<tr>
<td><html:hidden property="message" value="0" /> <input
type="submit" name="ratio" value="Calculate Ratio"><input
type="reset" value="Reset"></td>
<td></td>
</tr>
</table>
</html:form>
</body>
</html>

========================================================================
below is what i wrote in the server.xml file
========================================================================

<!-- Bra Rating -->
<Resource auth="Container" driverClassName="net.sourceforge.jtds.jdbc.Driver" maxActive="100" maxIdle="5" maxWait="-1" name="jdbc/braratingDB05" password="bumsco$123" removeAbandoned="true" removeAbandonedTimeout="30" type="javax.sql.DataSource" url="jdbc:jtds:sqlserver://qa-applications:1433/braRating;TDS=8.0;namedPipe=true;instance=SQLEXPRESS" username="tbalogun" />
=====================================================================
Please i need your help and assistance urgently.

Thanks
Tayo
 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Your DB login failed; this isn't really a Struts issue.
 
tayo balogun
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
Thanks for the solution i have corrected the DB login but i am having problems with get the right parameter to display the data from the stored procedures to the form elements(combo boxes).

==========================================================================
Below is the jsp page
=========================================================================

<%@ page language="java"%>
<%@ page import="java.util.ArrayList"%>

<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html"%>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic"%>
<%@ taglib uri="http://struts.apache.org/tags-tiles" prefix="tiles"%>
<%@page import="com.bralimited.brarating.model.RatioService"%>

<%@page import="com.bralimited.brarating.dto.common.Sector"%>

<html>
<% String selected_year="1970",selected_comp;%>
<% String selected_insurtype=""; %>
<% String sel_sector_det=""; %>
<% String sel_sector=""; %>
<jsp:useBean id="service"
class="com.bralimited.brarating.model.RatioService"></jsp:useBean>
<html:errors />

<body>
<html:form action="/calculateRatio">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="200" align="left"><font size="3" face="Narrow Arial">Year</font></td>
<td align="left"><html:select property="fin_dt">
<option value=""></option>
<logic resent name="ratioForm" property="fin_dt">
<bean efine id="r_year" name="ratioForm" property="fin_dt"
type="java.lang.String" />
<%selected_year= r_year; %>
</logic resent>

<%
for(int i=1980; i <= 2500; i++){
if(i==Integer.parseInt(selected_year)){
out.println("<option value=\"" + i + "\" selected>" + i+ "</option>");
}else{
out.println("<option value=\"" + i + "\">" + i+ "</option>");
}
}
%>
</html:select></td>

</tr>

<tr>
<td width="200" align="left"><font size="3" face="Narrow Arial">Sector
* :</font></td>
<td align="left"><html:select property="main_sector_id" onchange="document.forms[0].comp_cd.value='';document.forms[0].operationtype.value='';document.forms[0].submit();">
<option value="0"></option>

<logic resent name="ratioForm" property="main_sector_id">
<bean efine id="sector_id" name="ratioForm"
property="main_sector_id" type="java.lang.String" />
<% sel_sector = sector_id; %>
</logic resent>

<%
java.util.List sectors = new RatioService().getAllSectors();
%>
<logic:iterate id="sector" collection="<%= sectors %>">
<logic:equal name="sector" property="main_sector_id"
value="<%= sel_sector %>">
<option value="<bean:write name="sector" property="main_sector_id"/>"selected>
<bean:write name="sector"property="main_sector_nm" /></option>
</logic:equal>
<logic:notEqual name="sector" property="main_sector_id"
value="<%= sel_sector %>">
<option
value='<bean:write name="sector" property="main_sector_id"/>'><bean:write
name="sector" property="main_sector_nm" /></option>
</logic:notEqual>
</logic:iterate>

</html:select></td>
</tr>
<tr>
<td width="200" align="left"><a name="edit"></a> <font
color="black" face="Narrow Arial" size="3">Sector Detail:</font></td>
<td align="left"><html:select property="comp_cd"
onchange="document.forms[0].insur_business_id.value='';document.forms[0].operationtype.value='';document.forms[0].submit();">

<option value="0"></option>


<logic resent name="ratioForm" property="comp_cd">
<bean efine id="sector_det_id" name="ratioForm" property="comp_cd"
type="java.lang.String" />
<% sel_sector_det = sector_det_id; %>
</logic resent>

<%
java.util.List sector_dets = new RatioService().getCompanyBySector(sel_sector);
%>
<logic:iterate id="sector_det" collection="<%= sector_dets %>">
<logic:equal name="sector_det" property="comp_cd"
value="<%= sel_sector_det %>">
<option value='<bean:write name="sector_det" property="comp_cd"/>'
selected><bean:write name="sector_det"
property="comp_nm" /></option>
</logic:equal>
<logic:notEqual name="sector_det" property="comp_cd"
value="<%= sel_sector_det %>">
<option value='<bean:write name="sector_det" property="comp_cd"/>'><bean:write
name="sector_det" property="comp_nm" /></option>
</logic:notEqual>
</logic:iterate>


</html:select></td>
</tr>
<tr>
<td width="100" align="left"><input type="radio"
name="insur_business_id"
<logic resent name="ratioForm" property="insur_business_id">
<logic:equal name="ratioForm" property="insur_business_id" value="group_no">
checked
</logic:equal>
</logic resent>
<logic:notPresent name="ratioForm" property="insur_business">
checked
</logic:notPresent>>Select
Insurance type :</td>
<td><html:select property="insur_business_id"
onchange="document.forms[0].operationtype.value='';document.forms[0].submit();">
<option value=""></option>

<logic resent name="ratioForm" property="insur_business_id">
<bean efine id="insur_id" name="ratioForm"
property="insur_business_id" type="java.lang.String" />
<% selected_insurtype = insur_id; %>
</logic resent>
<%
java.util.List insur_type = new RatioService().getInsuranceType();
%>
<logic:iterate id="insur_id" collection="<%= insur_type %>">
<logic:equal name="insur_id" property="insur_business_id"
value="<%= selected_insurtype %>">
<option
value='<bean:write name="insur_id" property="insur_business_id"/>'
selected><bean:write name="insur_id"
property="business_type" /></option>
</logic:equal>
<logic:notEqual name="insur_id" property="insur_business_id"
value="<%= selected_insurtype %>">
<option
value='<bean:write name="insur_id" property="insur_business_id"/>'><bean:write
name="insur_id" property="business_type" /></option>
</logic:notEqual>
</logic:iterate>
</html:select></td>
</tr>

<tr>
<td><html:hidden property="message" value="0" /> <input
type="submit" name="ratio" value="Calculate Ratio"><input
type="reset" value="Reset"></td>
<td></td>
</tr>
</table>
</html:form>
</body>
</html>

==========================================================================
below is the model class -
==========================================================================

package com.bralimited.brarating.model;

import java.sql.CallableStatement;
import java.sql.Connection;
import java.sql.ResultSet;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.LinkedHashMap;

import com.bralimited.brarating.ref.dto.Reference;
import com.bralimited.common.utility.Env;

public class RatioService {

private CallableStatement calproc;
private CallableStatement cal_yrlycomp_grp;
private CallableStatement get_compbySector;
private CallableStatement cal_insuryearly_ratios;
private CallableStatement cal_manyearly_ratios;
private CallableStatement get_mainInsurTypes;
private CallableStatement get_mainSector;
private Connection con;
private ResultSet result;
public int output = -1, opcode;

private final boolean already_tried_reconnection = false;

/**
* This method is used to close all connection to the database.
*/
private void closeConnection() {
if (result != null) {
try {
result.close();
result = null;
} catch (Exception ignore) {
}
}
if (con != null) {
try {
con.close();
con = null;
} catch (Exception ignore) {
}
}

}// end of closeConnection() method.

/**
* This method is used to connect to the bra rating database, it calls a
* method in the Env class, which actually does the connection and returns a
* connection object.
*
* @throws Exception
*/
private void connectToDb() throws Exception {
closeConnection();
con = Env.getConnectionBraRating();

calproc = con.prepareCall("{call cal_yearly_ratios(?)}");
cal_yrlycomp_grp = con.prepareCall("{call cal_yrlycomp_grp_sp(?,?)}");
get_compbySector = con.prepareCall("call get_compbySector_sp(?)");
cal_insuryearly_ratios = con
.prepareCall("{call cal_insuryearly_ratios_sp(?,?,?,?)}");
cal_manyearly_ratios = con
.prepareCall("{call cal_manyearly_ratios_sp(?,?,?)}");
get_mainInsurTypes = con.prepareCall("{call get_mainInsurTypes_sp()}");
// get_mainSector = con.prepareCall("{call get_mainSector_sp(?,?)}");
get_mainSector = con.prepareCall("{call get_mainSector_sp()}");

}

// end of connetToDb() method.

/*
* This method is used to calculate yearly ratio
*/
public String calculateYearlyRatio(String year) {

try {
output = -1;

connectToDb();
calproc.setInt(1, Integer.parseInt(year));
calproc.setInt(2, output);
calproc.registerOutParameter(2, java.sql.Types.INTEGER);
calproc.execute();

while (calproc.getMoreResults()) {
result = calproc.getResultSet();
}
try {
output = calproc.getInt(2);
}

catch (Exception ex) {
output = 0;
}
if (output == 1) {
con.commit();
return "Manufacturing Ratio successfully calculated";
} else if (output == 2) {
con.commit();
return "Insurance Ratio successfully calculated";
} else {
con.rollback();
closeConnection();
return "An unrecognized return code was sent from the database, please consult your programmer. Code: "
+ output;

}
} catch (Exception e) {

e.printStackTrace();
closeConnection();
return "Calculation error";

} finally {
closeConnection();
}
}

public String calcYearlyCompanyGroup(String fin_dt) {
String str = "";
try {
output = 0;
connectToDb();
cal_yrlycomp_grp.setString(1, (fin_dt));
cal_yrlycomp_grp.setInt(2, output);
cal_yrlycomp_grp.registerOutParameter(2, java.sql.Types.INTEGER);
cal_yrlycomp_grp.execute();

while (cal_yrlycomp_grp.getMoreResults()) {
result = cal_yrlycomp_grp.getResultSet();
}
try {
output = cal_yrlycomp_grp.getInt(2);
} catch (Exception ex) {
output = 0;
}
if (output == 0) {
con.commit();
return "Ratio successfully calculated";
}
if (output == 1) {
con.commit();
return "Error in calculation";
} else if (output == 2) {
con.rollback();
closeConnection();
return "";
}
} catch (Exception e) {

e.printStackTrace();
closeConnection();
return "Calculation error";

} finally {
closeConnection();
}
return str;
}

public String calcInsuranceYearlyRatio(String fin_dt, String comp_cd,
String insur_business_id) {
String str = "";

try {
output = 0;
connectToDb();
cal_insuryearly_ratios.setString(1, fin_dt);
cal_insuryearly_ratios.setString(2, comp_cd);
cal_insuryearly_ratios.setString(3, insur_business_id);
cal_insuryearly_ratios.setInt(4, output);
cal_insuryearly_ratios.registerOutParameter(4,
java.sql.Types.INTEGER);
cal_insuryearly_ratios.execute();
while (cal_insuryearly_ratios.getMoreResults()) {
result = cal_insuryearly_ratios.getResultSet();
}
try {
output = cal_insuryearly_ratios.getInt(4);
} catch (Exception ex) {
output = 0;
}
if (output == 5 || output == 7) {
con.commit();
return "Ratio successfully calculated";
}
if (output == 6) {
con.commit();
return "Life insurance successfuly calculated";
} else if (output == 8) {
con.rollback();
closeConnection();
return "error";
}
} catch (Exception e) {

e.printStackTrace();
closeConnection();
return "Calculation error";

} finally {
closeConnection();
}
return str;
}

public String calcManufacturingYearlyRatio(String fin_dt, String comp_cd) {
String str = "";

try {
output = 0;
connectToDb();
cal_manyearly_ratios.setString(1, fin_dt);
cal_manyearly_ratios.setString(2, comp_cd);
// cal_insuryearly_ratios.setString(3, insur_business_id);
cal_manyearly_ratios.setInt(3, output);
cal_manyearly_ratios
.registerOutParameter(3, java.sql.Types.INTEGER);
cal_manyearly_ratios.execute();
while (cal_manyearly_ratios.getMoreResults()) {
result = cal_manyearly_ratios.getResultSet();
}
try {
output = cal_manyearly_ratios.getInt(3);
} catch (Exception ex) {
output = 0;
}
if (output == 1) {
con.commit();
return "Ratio successfully calculated";
}
if (output == 2) {
con.commit();
return "Life insurance successfuly calculated";
} else if (output == 3) {
con.rollback();
closeConnection();
return "error";
}
} catch (Exception e) {

e.printStackTrace();
closeConnection();
return "Calculation error";

} finally {
closeConnection();
}
return str;
}

public ArrayList getAllSectors() {
ArrayList list = new ArrayList();
try {
connectToDb();
// String sec = null;
// get_mainSector.setInt(1, Integer.parseInt());
LinkedHashMap<String, Reference> main_sector_tb = com.bralimited.brarating.utility.SessionListener
.getMain_sector_tb();
if (main_sector_tb != null) {
Iterator<Reference> lists = main_sector_tb.values().iterator();
while (lists.hasNext()) {
list.add(lists.next());
}
}

} catch (Exception itx) {
itx.printStackTrace();
} finally {
}
return list;
}

public ArrayList<Reference> getCompanyBySector(String main_sector_id) {
ArrayList arr = new ArrayList();
try {
connectToDb();

get_compbySector.setInt(1, Integer.parseInt(main_sector_id));
result = get_compbySector.executeQuery();
while (result.next()) {
try {
Reference ref = new Reference(result.getObject(1)
.toString().trim(), result.getObject(2).toString()
.trim());
arr.add(ref);

} catch (Exception itx) {
itx.printStackTrace();
}
}
closeConnection();

} catch (Exception ex) {
ex.printStackTrace();
closeConnection();
} finally {
closeConnection();
}
return arr;

}

public String getSectorName(String main_sector_id) {
try {
connectToDb();

get_compbySector.setInt(1, Integer.parseInt(main_sector_id));
result = get_compbySector.executeQuery();
if (result.next()) {
String nm = result.getString("main_sector_nm");
closeConnection();
return nm;
} else {
closeConnection();
return "UNKNOWN";
}
} catch (Exception e) {
closeConnection();
return "UNKNOWN";
} finally {
closeConnection();
}

}

public ArrayList getInsuranceType() {
ArrayList<Reference> arr = new ArrayList<Reference>();
try {

connectToDb();
get_mainInsurTypes.setInt(1, 0);
// get_mainInsurTypes.setString(2, business_type);
result = get_mainInsurTypes.executeQuery();
while (result.next()) {
try {

Reference ref = new Reference(result.getObject(1)
.toString().trim(), result.getString(2).trim());
arr.add(ref);

} catch (Exception itx) {
itx.printStackTrace();
}
}
closeConnection();

} catch (Exception e) {
System.out.println("Error");
e.printStackTrace();
} finally {
closeConnection();
}
return arr;
}

/**
* @return Returns the already_tried_reconnection.
*/
public boolean isAlready_tried_reconnection() {
return already_tried_reconnection;
}

}
=========================================================================
Below is the error displayed at the console
=========================================================================

SEVERE: Servlet.service() for servlet jsp threw exception
org.apache.jasper.JasperException: Unable to compile class for JSP:

An error occurred at line: 135 in the jsp file: /CalculateRatios.jsp
The method getInsuranceType(String, String) in the type RatioService is not applicable for the arguments ()
132: <% selected_insurtype = insur_id; %>
133: </logic resent>
134: <%
135: java.util.List insur_type = new RatioService().getInsuranceType();
136: %>
137: <logic:iterate id="insur_id" collection="<%= insur_type %>">
138: <logic:equal name="insur_id" property="insur_business_id"


Stacktrace:
at org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:92)
at org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:330)
at org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:423)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:308)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:286)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:273)
at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:566)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:317)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:261)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:581)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:619)

===========================================================================
please i need your help on this application. To make the combo boxes display data from the database.
Thanks for usual support

Tayo
 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
According to this line:

An error occurred at line: 135 in the jsp file: /CalculateRatios.jsp
The method getInsuranceType(String, String) in the type RatioService is not applicable for the arguments ()

The RatioService method wants 2 strings passed in when called, and right now you're passing an empty argument list, ie: RatioService().getInsuranceType()

Provide it with the string variables it wants and see if that clears up the issue: RatioService().getInsuranceType("auto", "annual"), or whatever is applicable.
[ November 25, 2008: Message edited by: Ryan Peterson ]
 
Your mother was a hamster and your father was a tiny ad:
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic