So I've put in a data-sources section that does parse right, but I get
the following errors when tomcat starts up een though postgresql.jar is
in the apps WEB-INF/lib directory... Can anyone please help?
BTW: I can use regular (non-pool) JDBC as that is how I have the
application working.
New org.apache.struts.util.GenericDataSource
java.lang.NoClassDefFoundError: javax/sql/DataSource
at java.lang.ClassLoader.defineClass0(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:486)
at
org.apache.tomcat.loader.AdaptiveClassLoader12.doDefineClass(AdaptiveClassLoader12.java:93)
at
org.apache.tomcat.loader.AdaptiveClassLoader.loadClass(AdaptiveClassLoader.java:509)
at java.lang.ClassLoader.loadClass(ClassLoader.java:253)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:313)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:120)
at
org.apache.struts.digester.ObjectCreateRule.begin(ObjectCreateRule.java:152)
at org.apache.struts.digester.Digester.startElement(Digester.java:498)
at com.sun.xml.parser.Parser.maybeElement(Parser.java:1391)
at com.sun.xml.parser.Parser.content(Parser.java:1499)
at com.sun.xml.parser.Parser.maybeElement(Parser.java:1400)
at com.sun.xml.parser.Parser.content(Parser.java:1499)
at com.sun.xml.parser.Parser.maybeElement(Parser.java:1400)
at com.sun.xml.parser.Parser.parseInternal(Parser.java:492)
at com.sun.xml.parser.Parser.parse(Parser.java:284)
at javax.xml.parsers.SAXParser.parse(SAXParser.java:155)
at javax.xml.parsers.SAXParser.parse(SAXParser.java:77)
at org.apache.struts.digester.Digester.parse(Digester.java:716)
at
org.apache.struts.action.ActionServlet.initMapping(ActionServlet.java:1247)
at org.apache.struts.action.ActionServlet.init(ActionServlet.java:437)
at javax.servlet.GenericServlet.init(GenericServlet.java:258)
at
org.apache.tomcat.core.ServletWrapper.doInit(ServletWrapper.java:317)
at org.apache.tomcat.core.Handler.init(Handler.java:215)
at org.apache.tomcat.core.ServletWrapper.init(ServletWrapper.java:296)
at
org.apache.tomcat.context.LoadOnStartupInterceptor.contextInit(LoadOnStartupInterceptor.java:130)
at
org.apache.tomcat.core.ContextManager.initContext(ContextManager.java:491)
at org.apache.tomcat.core.ContextManager.init(ContextManager.java:453)
at org.apache.tomcat.startup.Tomcat.execute(Tomcat.java:195)
at org.apache.tomcat.startup.Tomcat.main(Tomcat.java:235)
Begin event threw exception
java.lang.ClassNotFoundException:
org/apache/struts/util/GenericDataSource
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:120)
at
org.apache.struts.digester.ObjectCreateRule.begin(ObjectCreateRule.java:152)
at org.apache.struts.digester.Digester.startElement(Digester.java:498)
at com.sun.xml.parser.Parser.maybeElement(Parser.java:1391)
at com.sun.xml.parser.Parser.content(Parser.java:1499)
at com.sun.xml.parser.Parser.maybeElement(Parser.java:1400)
at com.sun.xml.parser.Parser.content(Parser.java:1499)
at com.sun.xml.parser.Parser.maybeElement(Parser.java:1400)
at com.sun.xml.parser.Parser.parseInternal(Parser.java:492)
at com.sun.xml.parser.Parser.parse(Parser.java:284)
at javax.xml.parsers.SAXParser.parse(SAXParser.java:155)
at javax.xml.parsers.SAXParser.parse(SAXParser.java:77)
at org.apache.struts.digester.Digester.parse(Digester.java:716)
at
org.apache.struts.action.ActionServlet.initMapping(ActionServlet.java:1247)
at org.apache.struts.action.ActionServlet.init(ActionServlet.java:437)
at javax.servlet.GenericServlet.init(GenericServlet.java:258)
at
org.apache.tomcat.core.ServletWrapper.doInit(ServletWrapper.java:317)
at org.apache.tomcat.core.Handler.init(Handler.java:215)
at org.apache.tomcat.core.ServletWrapper.init(ServletWrapper.java:296)
at
org.apache.tomcat.context.LoadOnStartupInterceptor.contextInit(LoadOnStartupInterceptor.java:130)
at
org.apache.tomcat.core.ContextManager.initContext(ContextManager.java:491)
at org.apache.tomcat.core.ContextManager.init(ContextManager.java:453)
at org.apache.tomcat.startup.Tomcat.execute(Tomcat.java:195)
at org.apache.tomcat.startup.Tomcat.main(Tomcat.java:235)
On 25 Jul 2001 22:20:00 -0400, Edward Muller wrote:
> Okay. I figured out that <data-sources> needs to go at the tope and I
> removed the set-property tags and actually made the properties.
>
> I am using postgres 7.1 something.
>
> Now when I start my sample application I get a ClassNotFoundException.
> I've checked and postgresql.jar from my postgres install is in my apps
> WEF-INF/lib directory.
>
> I've got the application working by establishing my own connections and
> not using the pool, so I know I can talk to JDBC and it can load the
> driver.
>
> But I can't seem to get the strut-pool stuff to load it....
>
> Can anyone point out my stupid mistake?
>
> Here is my <data-sources> section:
>
> <data-sources>
> <data-source
> autoCommit="false"
> driverClass="org.postgresql.Driver"
> maxCount="4"
> minCount="2"
> password="whatever"
> url="jdbc:postgresql://localhost/LPC"
> user="edwardam" />
> </data-sources>
>
>
> On 25 Jul 2001 14:05:00 -0400, Edward Muller wrote:
> > I'm trying to configure a data-source in my struts-config.xml file and I
> > get the following error:
> >
> > Parse Error at line 71 column -1: Element "struts-config" allows no
> > further input; "data-sources" is not allowed.
> > ...(more traceback here)...
> >
> >
> > The snippet from my struts-config.xml file is as follows:
> > <data-sources>
> > <data-source>
> > <set-property property="autoCommit" value="false" />
> > <set-property property="description" value="Postgres Server"/>
> > <set-property property="driverClass"
> > value="org.postgresql.Driver"/>
> > <set-property property="maxCount" value="4"/>
> > <set-property property="minCount" value="2"/>
> > <set-property property="password" value="whatever"/>
> > <set-property property="url"
> > value="jdbc:postgresql://localhost/LPC"/>
> > <set-property property="user" value="edwardam"/>
> > </data-source>
> > </data-sources>
> >
> > What am I doing wrong?
> >
> > --
> > Edward Muller
> > Director of Information Services
> > LearningPatterns.com Inc.
> >
> > Direct: 212-487-9064 x 115
> > Fax: 212-202-3822
> > Email: [EMAIL PROTECTED]
> >
> > http://www.learningpatterns.com
> --
> Edward Muller
> Director of Information Services
> LearningPatterns.com Inc.
>
> Direct: 212-487-9064 x 115
> Fax: 212-202-3822
> Email: [EMAIL PROTECTED]
>
> http://www.learningpatterns.com
--
Edward Muller
Director of Information Services
LearningPatterns.com Inc.
Direct: 212-487-9064 x 115
Fax: 212-202-3822
Email: [EMAIL PROTECTED]
http://www.learningpatterns.com