Datasource problem

2004-01-07 Thread cnd
Hi,

I must be missing something here but for the life of me I cannot see what
it is. I've search the mail archives and can't find anything the same,
also I checked 3 different books and it looks like I have everything
configured correctly, I also tried two diffent MySQL drivers.

I have added a datasource to my struts-config and when I run the application I
can see it initializes ok:

Jan 7, 2004 10:09:48 PM org.apache.struts.legacy.GenericDataSource
createConnection
INFO:createConnection()
Jan 7, 2004 10:09:49 PM org.apache.struts.legacy.GenericDataSource
createConnection
INFO:createConnection()

If I mess up the password I get an access denied error on the db when this
runs so that tells me I am getting a connection.

But when I try to access the datasource inside my action using the
following code:

DataSource dataSource = getDataSource(req);

dataSource returns null which is where I'm stumped.

Anyone get any idea what this might be? I'm using struts 1.1 and tried JDK
1.4 and 1.3.

Here's my struts-config:

data-sources
  data-source key=dataSource
set-property property=driverClass value=com.mysql.jdbc.Driver/
set-property property=url value=jdbc:mysql://127.0.0.1:3306/ash/
set-property property=user value=myusername /
set-property property=password value=mypassword /
set-property property=minCount value=2 /
set-property property=maxCount value=4 /
  /data-source
/data-sources


The exception is java.lang.NullPointerException which results from trying
to use the null dataSource.

There is one other compiler error I am getting when I build the project
which I still trying to track down:

Jan 7, 2004 10:09:48 PM org.apache.commons.digester.Digester error
SEVERE: Parse Error at line 19 column -1: Attribute value for path is
#REQUIRED.
org.xml.sax.SAXParseException: Attribute value for path is #REQUIRED.
at org.apache.crimson.parser.Parser2.error(Parser2.java:3317)
at
org.apache.crimson.parser.Parser2.defaultAttributes(Parser2.java:1889)
at
org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1600)
at org.apache.crimson.parser.Parser2.content(Parser2.java:1926)
at
org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1654)
at org.apache.crimson.parser.Parser2.content(Parser2.java:1926)
at
org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1654)
at
org.apache.crimson.parser.Parser2.parseInternal(Parser2.java:634)
at org.apache.crimson.parser.Parser2.parse(Parser2.java:333)
at
org.apache.crimson.parser.XMLReaderImpl.parse(XMLReaderImpl.java:448)
at org.apache.commons.digester.Digester.parse(Digester.java:1548)
at
org.apache.struts.action.ActionServlet.parseModuleConfigFile(ActionServlet.java:1006)
at
org.apache.struts.action.ActionServlet.initModuleConfig(ActionServlet.java:955)
at
org.apache.struts.action.ActionServlet.init(ActionServlet.java:470)
at javax.servlet.GenericServlet.init(GenericServlet.java:256)
at
org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:918)
at
org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:810)
at
org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3279)
at
org.apache.catalina.core.StandardContext.start(StandardContext.java:3421)
at
org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1123)
at
org.apache.catalina.core.StandardHost.start(StandardHost.java:638)
at
org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1123)
at
org.apache.catalina.core.StandardEngine.start(StandardEngine.java:343)
at
org.apache.catalina.core.StandardService.start(StandardService.java:388)
at
org.apache.catalina.core.StandardServer.start(StandardServer.java:506)
at org.apache.catalina.startup.Catalina.start(Catalina.java:781)
at org.apache.catalina.startup.Catalina.execute(Catalina.java:681)
at org.apache.catalina.startup.Catalina.process(Catalina.java:179)
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:324)


Thanks for any advice.


Chris


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



RE: Datasource problem

2004-01-07 Thread Matthias Wessendorf
hi chris,

have you tried:

getDataSource(req,dataSource);


greetings



-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, January 07, 2004 10:25 AM
To: [EMAIL PROTECTED]
Subject: Datasource problem


Hi,

I must be missing something here but for the life of me I cannot see
what it is. I've search the mail archives and can't find anything the
same, also I checked 3 different books and it looks like I have
everything configured correctly, I also tried two diffent MySQL drivers.

I have added a datasource to my struts-config and when I run the
application I can see it initializes ok:

Jan 7, 2004 10:09:48 PM org.apache.struts.legacy.GenericDataSource
createConnection
INFO:createConnection()
Jan 7, 2004 10:09:49 PM org.apache.struts.legacy.GenericDataSource
createConnection
INFO:createConnection()

If I mess up the password I get an access denied error on the db when
this runs so that tells me I am getting a connection.

But when I try to access the datasource inside my action using the
following code:

DataSource dataSource = getDataSource(req);

dataSource returns null which is where I'm stumped.

Anyone get any idea what this might be? I'm using struts 1.1 and tried
JDK 1.4 and 1.3.

Here's my struts-config:

data-sources
  data-source key=dataSource
set-property property=driverClass value=com.mysql.jdbc.Driver/
set-property property=url
value=jdbc:mysql://127.0.0.1:3306/ash/
set-property property=user value=myusername /
set-property property=password value=mypassword /
set-property property=minCount value=2 /
set-property property=maxCount value=4 /
  /data-source
/data-sources


The exception is java.lang.NullPointerException which results from
trying to use the null dataSource.

There is one other compiler error I am getting when I build the project
which I still trying to track down:

Jan 7, 2004 10:09:48 PM org.apache.commons.digester.Digester error
SEVERE: Parse Error at line 19 column -1: Attribute value for path is
#REQUIRED.
org.xml.sax.SAXParseException: Attribute value for path is #REQUIRED.
at org.apache.crimson.parser.Parser2.error(Parser2.java:3317)
at
org.apache.crimson.parser.Parser2.defaultAttributes(Parser2.java:1889)
at
org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1600)
at org.apache.crimson.parser.Parser2.content(Parser2.java:1926)
at
org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1654)
at org.apache.crimson.parser.Parser2.content(Parser2.java:1926)
at
org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1654)
at
org.apache.crimson.parser.Parser2.parseInternal(Parser2.java:634)
at org.apache.crimson.parser.Parser2.parse(Parser2.java:333)
at
org.apache.crimson.parser.XMLReaderImpl.parse(XMLReaderImpl.java:448)
at
org.apache.commons.digester.Digester.parse(Digester.java:1548)
at
org.apache.struts.action.ActionServlet.parseModuleConfigFile(ActionServl
et.java:1006)
at
org.apache.struts.action.ActionServlet.initModuleConfig(ActionServlet.ja
va:955)
at
org.apache.struts.action.ActionServlet.init(ActionServlet.java:470)
at javax.servlet.GenericServlet.init(GenericServlet.java:256)
at
org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.jav
a:918)
at
org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:810)
at
org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.j
ava:3279)
at
org.apache.catalina.core.StandardContext.start(StandardContext.java:3421
)
at
org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1123)
at
org.apache.catalina.core.StandardHost.start(StandardHost.java:638)
at
org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1123)
at
org.apache.catalina.core.StandardEngine.start(StandardEngine.java:343)
at
org.apache.catalina.core.StandardService.start(StandardService.java:388)
at
org.apache.catalina.core.StandardServer.start(StandardServer.java:506)
at org.apache.catalina.startup.Catalina.start(Catalina.java:781)
at
org.apache.catalina.startup.Catalina.execute(Catalina.java:681)
at
org.apache.catalina.startup.Catalina.process(Catalina.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav
a:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
Impl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)


Thanks for any advice.


Chris


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


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

RE: Datasource problem

2004-01-07 Thread cnd
Thanks Mathias, just after I sent the email I got it working using the key
as you suggested.  I tried using the key earlier today and it didn't work,
probably I had some other problem which I accidentally fixed and now I've
confused myself.

Shouldn't it work without the key since I only have the one datasource
and all the docs I've seen don't require the key. My understanding is that
the key is only required when there is more than one datasource. No?

Thanks for your help.

Chris


On Wed, 7 Jan 2004, Matthias Wessendorf wrote:

 hi chris,

 have you tried:

 getDataSource(req,dataSource);


 greetings



 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, January 07, 2004 10:25 AM
 To: [EMAIL PROTECTED]
 Subject: Datasource problem


 Hi,

 I must be missing something here but for the life of me I cannot see
 what it is. I've search the mail archives and can't find anything the
 same, also I checked 3 different books and it looks like I have
 everything configured correctly, I also tried two diffent MySQL drivers.

 I have added a datasource to my struts-config and when I run the
 application I can see it initializes ok:

 Jan 7, 2004 10:09:48 PM org.apache.struts.legacy.GenericDataSource
 createConnection
 INFO:createConnection()
 Jan 7, 2004 10:09:49 PM org.apache.struts.legacy.GenericDataSource
 createConnection
 INFO:createConnection()

 If I mess up the password I get an access denied error on the db when
 this runs so that tells me I am getting a connection.

 But when I try to access the datasource inside my action using the
 following code:

 DataSource dataSource = getDataSource(req);

 dataSource returns null which is where I'm stumped.

 Anyone get any idea what this might be? I'm using struts 1.1 and tried
 JDK 1.4 and 1.3.

 Here's my struts-config:

 data-sources
   data-source key=dataSource
 set-property property=driverClass value=com.mysql.jdbc.Driver/
 set-property property=url
 value=jdbc:mysql://127.0.0.1:3306/ash/
 set-property property=user value=myusername /
 set-property property=password value=mypassword /
 set-property property=minCount value=2 /
 set-property property=maxCount value=4 /
   /data-source
 /data-sources


 The exception is java.lang.NullPointerException which results from
 trying to use the null dataSource.

 There is one other compiler error I am getting when I build the project
 which I still trying to track down:

 Jan 7, 2004 10:09:48 PM org.apache.commons.digester.Digester error
 SEVERE: Parse Error at line 19 column -1: Attribute value for path is
 #REQUIRED.
 org.xml.sax.SAXParseException: Attribute value for path is #REQUIRED.
   at org.apache.crimson.parser.Parser2.error(Parser2.java:3317)
   at
 org.apache.crimson.parser.Parser2.defaultAttributes(Parser2.java:1889)
   at
 org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1600)
   at org.apache.crimson.parser.Parser2.content(Parser2.java:1926)
   at
 org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1654)
   at org.apache.crimson.parser.Parser2.content(Parser2.java:1926)
   at
 org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1654)
   at
 org.apache.crimson.parser.Parser2.parseInternal(Parser2.java:634)
   at org.apache.crimson.parser.Parser2.parse(Parser2.java:333)
   at
 org.apache.crimson.parser.XMLReaderImpl.parse(XMLReaderImpl.java:448)
   at
 org.apache.commons.digester.Digester.parse(Digester.java:1548)
   at
 org.apache.struts.action.ActionServlet.parseModuleConfigFile(ActionServl
 et.java:1006)
   at
 org.apache.struts.action.ActionServlet.initModuleConfig(ActionServlet.ja
 va:955)
   at
 org.apache.struts.action.ActionServlet.init(ActionServlet.java:470)
   at javax.servlet.GenericServlet.init(GenericServlet.java:256)
   at
 org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.jav
 a:918)
   at
 org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:810)
   at
 org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.j
 ava:3279)
   at
 org.apache.catalina.core.StandardContext.start(StandardContext.java:3421
 )
   at
 org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1123)
   at
 org.apache.catalina.core.StandardHost.start(StandardHost.java:638)
   at
 org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1123)
   at
 org.apache.catalina.core.StandardEngine.start(StandardEngine.java:343)
   at
 org.apache.catalina.core.StandardService.start(StandardService.java:388)
   at
 org.apache.catalina.core.StandardServer.start(StandardServer.java:506)
   at org.apache.catalina.startup.Catalina.start(Catalina.java:781)
   at
 org.apache.catalina.startup.Catalina.execute(Catalina.java:681)
   at
 org.apache.catalina.startup.Catalina.process(Catalina.java:179)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native

RE: Datasource problem

2004-01-07 Thread Matthias Wessendorf
hi Chris!

only one can be defined without a key 

it is stored under default:
Globals.DATA_SOURCE_KEY

and of cource
in struts 1.2 you must!!! specify a type

in 1.1 it is a legacy-class
GenericDataSource (by default)
this is to remove...

you must say then type=org.apache.commons.dbcp.BasicDataSource

for that you must
add two jars
-the DBCP-commons from http://jakarta.apache.org/commons/dbcp/
-the pool-jar from: http://jakarta.apache.org/commons/pool/

for more read:
http://jakarta.apache.org/struts/faqs/database.html

regards,



-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, January 07, 2004 10:44 AM
To: Struts Users Mailing List
Subject: RE: Datasource problem


Thanks Mathias, just after I sent the email I got it working using the
key as you suggested.  I tried using the key earlier today and it didn't
work, probably I had some other problem which I accidentally fixed and
now I've confused myself.

Shouldn't it work without the key since I only have the one datasource
and all the docs I've seen don't require the key. My understanding is
that the key is only required when there is more than one datasource.
No?

Thanks for your help.

Chris


On Wed, 7 Jan 2004, Matthias Wessendorf wrote:

 hi chris,

 have you tried:

 getDataSource(req,dataSource);


 greetings



 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, January 07, 2004 10:25 AM
 To: [EMAIL PROTECTED]
 Subject: Datasource problem


 Hi,

 I must be missing something here but for the life of me I cannot see 
 what it is. I've search the mail archives and can't find anything the 
 same, also I checked 3 different books and it looks like I have 
 everything configured correctly, I also tried two diffent MySQL 
 drivers.

 I have added a datasource to my struts-config and when I run the 
 application I can see it initializes ok:

 Jan 7, 2004 10:09:48 PM org.apache.struts.legacy.GenericDataSource
 createConnection
 INFO:createConnection()
 Jan 7, 2004 10:09:49 PM org.apache.struts.legacy.GenericDataSource
 createConnection
 INFO:createConnection()

 If I mess up the password I get an access denied error on the db when 
 this runs so that tells me I am getting a connection.

 But when I try to access the datasource inside my action using the 
 following code:

 DataSource dataSource = getDataSource(req);

 dataSource returns null which is where I'm stumped.

 Anyone get any idea what this might be? I'm using struts 1.1 and tried

 JDK 1.4 and 1.3.

 Here's my struts-config:

 data-sources
   data-source key=dataSource
 set-property property=driverClass
value=com.mysql.jdbc.Driver/
 set-property property=url 
 value=jdbc:mysql://127.0.0.1:3306/ash/
 set-property property=user value=myusername /
 set-property property=password value=mypassword /
 set-property property=minCount value=2 /
 set-property property=maxCount value=4 /
   /data-source
 /data-sources


 The exception is java.lang.NullPointerException which results from 
 trying to use the null dataSource.

 There is one other compiler error I am getting when I build the 
 project which I still trying to track down:

 Jan 7, 2004 10:09:48 PM org.apache.commons.digester.Digester error
 SEVERE: Parse Error at line 19 column -1: Attribute value for path 
 is #REQUIRED.
 org.xml.sax.SAXParseException: Attribute value for path is
#REQUIRED.
   at org.apache.crimson.parser.Parser2.error(Parser2.java:3317)
   at
 org.apache.crimson.parser.Parser2.defaultAttributes(Parser2.java:1889)
   at
 org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1600)
   at org.apache.crimson.parser.Parser2.content(Parser2.java:1926)
   at
 org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1654)
   at org.apache.crimson.parser.Parser2.content(Parser2.java:1926)
   at
 org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1654)
   at
 org.apache.crimson.parser.Parser2.parseInternal(Parser2.java:634)
   at org.apache.crimson.parser.Parser2.parse(Parser2.java:333)
   at
 org.apache.crimson.parser.XMLReaderImpl.parse(XMLReaderImpl.java:448)
   at
 org.apache.commons.digester.Digester.parse(Digester.java:1548)
   at 
 org.apache.struts.action.ActionServlet.parseModuleConfigFile(ActionSer
 vl
 et.java:1006)
   at

org.apache.struts.action.ActionServlet.initModuleConfig(ActionServlet.ja
 va:955)
   at
 org.apache.struts.action.ActionServlet.init(ActionServlet.java:470)
   at javax.servlet.GenericServlet.init(GenericServlet.java:256)
   at

org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.jav
 a:918)
   at

org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:810)
   at

org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.j
 ava:3279)
   at

org.apache.catalina.core.StandardContext.start(StandardContext.java:3421

RE: Datasource problem

2004-01-07 Thread cnd
Hi Matthias,

Thanks for all the info.

As you said that only one can be defined without a key hence if I use
getDataSource(req);  then it should use the default datasource without
me having to specify the Globals.DATA_SOURCE_KEY as the second parameter.
So looking at my struts-config.xml there is only one datasource hence my
reading is that the second parameter is redundant. Also
Globals.DATA_SOURCE_KEY is showing as deprecated so I was avoiding using
it.

Looking at it further I see that part of my problem was that I am using
JBuilder X which adds a key by default, once that key is added
DATA_SOURCE_KEY doesn't work, so obviously the key is the
problem. Once I remove the key I can use the single parameter.

Thanks for your help!

Chris

On Wed, 7 Jan 2004, Matthias Wessendorf wrote:

 hi Chris!

 only one can be defined without a key

 it is stored under default:
 Globals.DATA_SOURCE_KEY

 and of cource
 in struts 1.2 you must!!! specify a type

 in 1.1 it is a legacy-class
 GenericDataSource (by default)
 this is to remove...A

 you must say then type=org.apache.commons.dbcp.BasicDataSource

 for that you must
 add two jars
 -the DBCP-commons from http://jakarta.apache.org/commons/dbcp/
 -the pool-jar from: http://jakarta.apache.org/commons/pool/

 for more read:
 http://jakarta.apache.org/struts/faqs/database.html

 regards,



 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, January 07, 2004 10:44 AM
 To: Struts Users Mailing List
 Subject: RE: Datasource problem


 Thanks Mathias, just after I sent the email I got it working using the
 key as you suggested.  I tried using the key earlier today and it didn't
 work, probably I had some other problem which I accidentally fixed and
 now I've confused myself.

 Shouldn't it work without the key since I only have the one datasource
 and all the docs I've seen don't require the key. My understanding is
 that the key is only required when there is more than one datasource.
 No?

 Thanks for your help.

 Chris


 On Wed, 7 Jan 2004, Matthias Wessendorf wrote:

  hi chris,
 
  have you tried:
 
  getDataSource(req,dataSource);
 
 
  greetings
 
 
 
  -Original Message-
  From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
  Sent: Wednesday, January 07, 2004 10:25 AM
  To: [EMAIL PROTECTED]
  Subject: Datasource problem
 
 
  Hi,
 
  I must be missing something here but for the life of me I cannot see
  what it is. I've search the mail archives and can't find anything the
  same, also I checked 3 different books and it looks like I have
  everything configured correctly, I also tried two diffent MySQL
  drivers.
 
  I have added a datasource to my struts-config and when I run the
  application I can see it initializes ok:
 
  Jan 7, 2004 10:09:48 PM org.apache.struts.legacy.GenericDataSource
  createConnection
  INFO:createConnection()
  Jan 7, 2004 10:09:49 PM org.apache.struts.legacy.GenericDataSource
  createConnection
  INFO:createConnection()
 
  If I mess up the password I get an access denied error on the db when
  this runs so that tells me I am getting a connection.
 
  But when I try to access the datasource inside my action using the
  following code:
 
  DataSource dataSource = getDataSource(req);
 
  dataSource returns null which is where I'm stumped.
 
  Anyone get any idea what this might be? I'm using struts 1.1 and tried

  JDK 1.4 and 1.3.
 
  Here's my struts-config:
 
  data-sources
data-source key=dataSource
  set-property property=driverClass
 value=com.mysql.jdbc.Driver/
  set-property property=url
  value=jdbc:mysql://127.0.0.1:3306/ash/
  set-property property=user value=myusername /
  set-property property=password value=mypassword /
  set-property property=minCount value=2 /
  set-property property=maxCount value=4 /
/data-source
  /data-sources
 
 
  The exception is java.lang.NullPointerException which results from
  trying to use the null dataSource.
 
  There is one other compiler error I am getting when I build the
  project which I still trying to track down:
 
  Jan 7, 2004 10:09:48 PM org.apache.commons.digester.Digester error
  SEVERE: Parse Error at line 19 column -1: Attribute value for path
  is #REQUIRED.
  org.xml.sax.SAXParseException: Attribute value for path is
 #REQUIRED.
  at org.apache.crimson.parser.Parser2.error(Parser2.java:3317)
  at
  org.apache.crimson.parser.Parser2.defaultAttributes(Parser2.java:1889)
  at
  org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1600)
  at org.apache.crimson.parser.Parser2.content(Parser2.java:1926)
  at
  org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1654)
  at org.apache.crimson.parser.Parser2.content(Parser2.java:1926)
  at
  org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1654)
  at
  org.apache.crimson.parser.Parser2.parseInternal(Parser2.java:634)
  at org.apache.crimson.parser.Parser2.parse(Parser2.java:333

Re: DataSource problem

2003-06-15 Thread Joe @ Team345
Just a guess on my part, but the connection is probably in the JNDI 
namespace, not the COMP namespace.  
To test this you can try either java:/env or just /env (sorry, can't 
recall which off the top of my head) where you have: java:comp/env

As a side point, you should probably put all such logic into a session 
bean(s) that your action classes can call.   Aside from this being a 
more 3-tier architecture it should allow you query your container (for 
instance, using the jmx-console in JBoss) to find out exactly what 
namespace(s) your beans are available in.

hth,

Joe

rainer juenger wrote:

Hi Maarten,

join the club! There are some more guys having exactliy the same problem as
you.
To me your configuration looks all right. I saw some samples :
parameter  namedriverName/name
valuejdbc:mysql://localhost/test/value /parameter
where the parameter name is not driverName but url. I tried both without
luck.
Are you using Tomcat 4.x without DBCP from the Jakarta Commons to get the
JNDI DB Connection?
Please follow the thread Connection pooling dowsn't work for me ... Help
!!
Hopefully there is someone arround giving us a tip how to get it run
Good luck to all of us ;)
Rainer
- Original Message -
From: Maarten Roosendaal [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, June 14, 2002 3:42 PM
Subject: DataSource problem
Hi,

I'm trying to create a simple DataBase app. using Struts. Right now i have a
problem with getting the DataSource out of the InitialContext and i'm not
sure what i'm doing wrong or maybe it has something to do with the Struts
Servlet.
In configured the server.xml as follows:
Resource name=test auth=CONTAINER
 type=javax.sql.DataSource/
ResourceParams name=test
  parameter  nameuser/name
valueroot/value  /parameter
  parameter  namepassword/namevalue/value
/parameter
  parameter  namedriverClassName/name
valueorg.gjt.mm.mysql.Driver/value /parameter
  parameter  namedriverName/name
valuejdbc:mysql://localhost/test/value /parameter
 /ResourceParams
and my web.xml includes the following:
   resource-ref
   res-ref-nametest/res-ref-name
   res-typejavax.sql.DataSource/res-type
   res-authCONTAINER/res-auth
   /resource-ref
In an Action-class i do this:
   Context env = (Context) new
InitialContext().lookup(java:comp/env);
   DataSource ds = (DataSource) env.lookup(test);
Here the DataSource keeps ending up as NULL. When i do this:
   Connection con = DriverManager.getConnection(Commands.DB_TEST_URL,
Commands.DB_TEST_USERNAME, );
   things are working fine but i have no idea where to look. The Context
does seem to have a reference to the 'test' reference but nothing more.
Does this have something to do with Struts or did i forget something? I
don't want to use the struts.xml for a database-connection. One of the
reasons is that i keep getting the message that it can't find the driver,
while it is included in the CLASSPATH.
Hope someone can help,
Maarten


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



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


Re: DataSource problem

2003-06-15 Thread Adam Hardy
Maarten,
do you declare the JNDI resource within the context tags for your webapp 
in server.xml, or within the global-naming-resources tags? I'm using the 
same setup  as you with my JNDI declared in the globalnamingresources 
and it wouldn't work until I put a resource-link tag in the context tags.

Adam

Joe @ Team345 wrote:
Just a guess on my part, but the connection is probably in the JNDI 
namespace, not the COMP namespace.  To test this you can try either 
java:/env or just /env (sorry, can't recall which off the top of my 
head) where you have: java:comp/env

As a side point, you should probably put all such logic into a session 
bean(s) that your action classes can call.   Aside from this being a 
more 3-tier architecture it should allow you query your container (for 
instance, using the jmx-console in JBoss) to find out exactly what 
namespace(s) your beans are available in.

hth,

Joe

rainer juenger wrote:

Hi Maarten,

join the club! There are some more guys having exactliy the same 
problem as
you.
To me your configuration looks all right. I saw some samples :

parameter  namedriverName/name
valuejdbc:mysql://localhost/test/value /parameter
where the parameter name is not driverName but url. I tried both without
luck.
Are you using Tomcat 4.x without DBCP from the Jakarta Commons to get the
JNDI DB Connection?
Please follow the thread Connection pooling dowsn't work for me ... Help
!!
Hopefully there is someone arround giving us a tip how to get it run
Good luck to all of us ;)
Rainer
- Original Message -
From: Maarten Roosendaal [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, June 14, 2002 3:42 PM
Subject: DataSource problem
Hi,

I'm trying to create a simple DataBase app. using Struts. Right now i 
have a
problem with getting the DataSource out of the InitialContext and i'm not
sure what i'm doing wrong or maybe it has something to do with the Struts
Servlet.

In configured the server.xml as follows:
Resource name=test auth=CONTAINER
 type=javax.sql.DataSource/
ResourceParams name=test
  parameter  nameuser/name
valueroot/value  /parameter
  parameter  namepassword/namevalue/value
/parameter
  parameter  namedriverClassName/name
valueorg.gjt.mm.mysql.Driver/value /parameter
  parameter  namedriverName/name
valuejdbc:mysql://localhost/test/value /parameter
 /ResourceParams
and my web.xml includes the following:
   resource-ref
   res-ref-nametest/res-ref-name
   res-typejavax.sql.DataSource/res-type
   res-authCONTAINER/res-auth
   /resource-ref
In an Action-class i do this:
   Context env = (Context) new
InitialContext().lookup(java:comp/env);
   DataSource ds = (DataSource) env.lookup(test);
Here the DataSource keeps ending up as NULL. When i do this:
   Connection con = DriverManager.getConnection(Commands.DB_TEST_URL,
Commands.DB_TEST_USERNAME, );
   things are working fine but i have no idea where to look. The Context
does seem to have a reference to the 'test' reference but nothing more.
Does this have something to do with Struts or did i forget something? I
don't want to use the struts.xml for a database-connection. One of the
reasons is that i keep getting the message that it can't find the driver,
while it is included in the CLASSPATH.
Hope someone can help,
Maarten


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

 



-
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: datasource problem

2003-01-02 Thread David M. Karr
 Steven == Steven Dahlin [EMAIL PROTECTED] writes:

Steven I am a little unclear what you mean by using modules?

If you don't know what they are, then you probably aren't using them :) .

It's a mechanism that allows you to subdivide your Struts application into
pieces, each with their own config file.

If you're not using modules, then I don't know what the problem could be.
Perhaps you could use your debugger to trace the loading of your
struts-config.xml file, especially when it stores the data-soure configuration?

David - Original Message -
David From: David M. Karr [EMAIL PROTECTED]

  Steven == Steven Dahlin [EMAIL PROTECTED] writes:
 
Steven When I try to get a datasource which has been defined in the
Steven struts-config.xml no matter what I do the datasource returns back null.  My
Steven struts-config.xml for data-sources is:
Steven data-sources
 
Steven data-source key= conPool
 
Steven set-property  property  = autoCommit
Steven value = false/
Steven set-property  property  = description
Steven value = database source/
Steven set-property  property  = driverClass
Steven value =
Steven oracle.jdbc.driver.OracleDriver/
Steven set-property  property  = user
Steven value = theuser/
Steven set-property  property  = password
Steven value = thepassword/
Steven set-property  property  = url
Steven value =
Steven jdbc:oracle:thin:@192.192.192.192:1675:inst/
Steven /data-source
 
Steven /data-sources
 
Steven In the section of code used for initialization of the
Steven datasource there is the following:
 
Steven ServletContext context =
Steven actSrv.getServletContext();
Steven dsSrc= ( DataSource ) context.getAttribute(
Steven ConPool );
 
Steven The context is captured but the datasource remains null.
 
 Are you using modules?  The data-source is put into the ServletContext
David with a
 key that is constructed by appending the module prefix to the given key.


-- 
===
David M. Karr  ; Java/J2EE/XML/Unix/C++
[EMAIL PROTECTED]   ; SCJP



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




datasource problem

2003-01-01 Thread Steven Dahlin
When I try to get a datasource which has been defined in the struts-config.xml no 
matter what I do the datasource returns back null.  My struts-config.xml for 
data-sources is:

data-sources

data-source key= conPool

set-property  property  = autoCommit
   value = false/
set-property  property  = description
   value = database source/
set-property  property  = driverClass
   value = oracle.jdbc.driver.OracleDriver/
set-property  property  = user
   value = theuser/
set-property  property  = password
   value = thepassword/
set-property  property  = url
   value = jdbc:oracle:thin:@192.192.192.192:1675:inst/
 /data-source

  /data-sources

In the section of code used for initialization of the datasource there is the 
following:

ServletContext context = actSrv.getServletContext();
dsSrc= ( DataSource ) context.getAttribute( ConPool );

The context is captured but the datasource remains null.

Any suggestions?

Thanks,
Steve





conPool -- ConPool / Re: datasource problem

2003-01-01 Thread Liu Jian
Will the data-source key case-sensitive? conPool -- ConPool

Try

dsSrc= ( DataSource ) context.getAttribute( conPool );

Good luck !



- Original Message -
From: Steven Dahlin [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, January 01, 2003 3:42 PM
Subject: datasource problem


When I try to get a datasource which has been defined in the
struts-config.xml no matter what I do the datasource returns back null.  My
struts-config.xml for data-sources is:

data-sources

data-source key= conPool

set-property  property  = autoCommit
   value = false/
set-property  property  = description
   value = database source/
set-property  property  = driverClass
   value = oracle.jdbc.driver.OracleDriver/
set-property  property  = user
   value = theuser/
set-property  property  = password
   value = thepassword/
set-property  property  = url
   value =
jdbc:oracle:thin:@192.192.192.192:1675:inst/
 /data-source

  /data-sources

In the section of code used for initialization of the datasource there is
the following:

ServletContext context = actSrv.getServletContext();
dsSrc= ( DataSource ) context.getAttribute( ConPool );

The context is captured but the datasource remains null.

Any suggestions?

Thanks,
Steve





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




Re: conPool -- ConPool / Re: datasource problem

2003-01-01 Thread Steven Dahlin
That was a misttype on my part.  In the code both have conPool.

- Original Message -
From: Liu Jian [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Wednesday, January 01, 2003 2:25 PM
Subject: conPool -- ConPool / Re: datasource problem


 Will the data-source key case-sensitive? conPool -- ConPool

 Try

 dsSrc= ( DataSource ) context.getAttribute( conPool );

 Good luck !



 - Original Message -
 From: Steven Dahlin [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Wednesday, January 01, 2003 3:42 PM
 Subject: datasource problem


 When I try to get a datasource which has been defined in the
 struts-config.xml no matter what I do the datasource returns back null.
My
 struts-config.xml for data-sources is:

 data-sources

 data-source key= conPool

 set-property  property  = autoCommit
value = false/
 set-property  property  = description
value = database source/
 set-property  property  = driverClass
value = oracle.jdbc.driver.OracleDriver/
 set-property  property  = user
value = theuser/
 set-property  property  = password
value = thepassword/
 set-property  property  = url
value =
 jdbc:oracle:thin:@192.192.192.192:1675:inst/
  /data-source

   /data-sources

 In the section of code used for initialization of the datasource there is
 the following:

 ServletContext context = actSrv.getServletContext();
 dsSrc= ( DataSource ) context.getAttribute( ConPool );

 The context is captured but the datasource remains null.

 Any suggestions?

 Thanks,
 Steve





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





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




Re: datasource problem

2003-01-01 Thread David M. Karr
 Steven == Steven Dahlin [EMAIL PROTECTED] writes:

Steven When I try to get a datasource which has been defined in the 
struts-config.xml no matter what I do the datasource returns back null.  My 
struts-config.xml for data-sources is:
Steven data-sources

Steven data-source key= conPool

Steven set-property  property  = autoCommit
Stevenvalue = false/
Steven set-property  property  = description
Stevenvalue = database source/
Steven set-property  property  = driverClass
Stevenvalue = oracle.jdbc.driver.OracleDriver/
Steven set-property  property  = user
Stevenvalue = theuser/
Steven set-property  property  = password
Stevenvalue = thepassword/
Steven set-property  property  = url
Stevenvalue = 
jdbc:oracle:thin:@192.192.192.192:1675:inst/
Steven  /data-source

Steven   /data-sources

Steven In the section of code used for initialization of the datasource there is 
the following:

Steven ServletContext context = actSrv.getServletContext();
Steven dsSrc= ( DataSource ) context.getAttribute( ConPool );

Steven The context is captured but the datasource remains null.

Are you using modules?  The data-source is put into the ServletContext with a
key that is constructed by appending the module prefix to the given key.

-- 
===
David M. Karr  ; Java/J2EE/XML/Unix/C++
[EMAIL PROTECTED]   ; SCJP



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




Re: datasource problem

2003-01-01 Thread Steven Dahlin
I am a little unclear what you mean by using modules?

Steve

- Original Message -
From: David M. Karr [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, January 01, 2003 3:45 PM
Subject: Re: datasource problem


  Steven == Steven Dahlin [EMAIL PROTECTED] writes:

 Steven When I try to get a datasource which has been defined in the
struts-config.xml no matter what I do the datasource returns back null.  My
struts-config.xml for data-sources is:
 Steven data-sources

 Steven data-source key= conPool

 Steven set-property  property  = autoCommit
 Stevenvalue = false/
 Steven set-property  property  = description
 Stevenvalue = database source/
 Steven set-property  property  = driverClass
 Stevenvalue =
oracle.jdbc.driver.OracleDriver/
 Steven set-property  property  = user
 Stevenvalue = theuser/
 Steven set-property  property  = password
 Stevenvalue = thepassword/
 Steven set-property  property  = url
 Stevenvalue =
jdbc:oracle:thin:@192.192.192.192:1675:inst/
 Steven  /data-source

 Steven   /data-sources

 Steven In the section of code used for initialization of the
datasource there is the following:

 Steven ServletContext context =
actSrv.getServletContext();
 Steven dsSrc= ( DataSource ) context.getAttribute(
ConPool );

 Steven The context is captured but the datasource remains null.

 Are you using modules?  The data-source is put into the ServletContext
with a
 key that is constructed by appending the module prefix to the given key.

 --
 ===
 David M. Karr  ; Java/J2EE/XML/Unix/C++
 [EMAIL PROTECTED]   ; SCJP



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





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




Re: Multiple DataSource Problem

2002-12-06 Thread tbachta

Ok , I thought I have already changed the key value's to MRA and
PHONE_DB in both of my data-sources, what I am having trouble with is how
do I refrence these values in the form and action classes?


Tim Bachta
Information Technology
MC 48


   

  David Graham   

  dgraham1980@hotmTo:   
[EMAIL PROTECTED]
  ail.com cc: 

   Subject:  Re: Multiple DataSource 
Problem   
  12/05/2002 04:09 

  PM   

  Please respond to

  Struts Users

  Mailing List

   

   





data-source key=org.apache.struts.action.DATA_SOURCE

That would store the DataSource under the Struts default value, which
obviously only allows for one DataSource.  Just change the key value to
something else to store multiple DataSources.

David






From: [EMAIL PROTECTED]
Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Subject: Re: Multiple DataSource Problem
Date: Thu, 5 Dec 2002 15:01:21 -0600


Can you show me a code snip of how to use this?


Tim Bachta
Information Technology
MC 48




   David Graham
   dgraham1980@hotmTo:
[EMAIL PROTECTED]
   ail.com cc:
Subject:  Re: Multiple
DataSource Problem
   12/05/2002 02:45
   PM
   Please respond to
   Struts Users
   Mailing List






Use the key attribute of the data-source element.

David






 From: [EMAIL PROTECTED]
 Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
 To: Struts Users Mailing List [EMAIL PROTECTED]
 Subject: Re: Multiple DataSource Problem
 Date: Thu, 5 Dec 2002 14:02:31 -0600
 
 
 Did I not give each data-source element its own key?
 
 Tim Bachta
 Information Technology
 MC 48
 
 
 
 
David Graham
dgraham1980@hotmTo:
 [EMAIL PROTECTED]
ail.com cc:
 Subject:  Re: Multiple
 DataSource Problem
12/05/2002 01:41
PM
Please respond to
Struts Users
Mailing List
 
 
 
 
 
 
 You need to give each data-source element its own key.  Struts stores
the
 DataSource under that key in the ServletContext.
 
 David
 
 
 
 
 
 
  From: [EMAIL PROTECTED]
  Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
  To: [EMAIL PROTECTED]
  Subject: Multiple DataSource Problem
  Date: Thu, 5 Dec 2002 13:20:01 -0600
  
  I am having trouble getting multiple datasources to work in my
 application.
  I have searched the archives and found inofrmation on how to do it but
 the
  solutions given are depricated.  Can anyone help me?
  
  
  data-sources
   data-source
 set-property property=key value=MRA/
 set-property property=driverClass value
  =oracle.jdbc.driver.OracleDriver/
 set-property property=url
value=jdbc:oracle:thin:
  @147.101.104.63:1524:common/
 set-property property=user value=MRA/
 set-property property=password value=mralog/
   /data-source
   data-source
 set-property property=key value=PHONE_DB/
 set-property property=driverClass value
  =oracle.jdbc.driver.OracleDriver/
 set-property property=url
value=jdbc:oracle:thin:
  @oid:1521:infoprd/
 set

Re: Multiple DataSource Problem

2002-12-06 Thread tbachta

Ok I have tried that and I am getting a null pointer exception caused by
the DataSource, here is my code

ServletContext context = servlet.getServletContext();
  DataSource dataSource = (DataSource) context.getAttribute(MRA);
  conn = dataSource.getConnection();
  stmt = conn.createStatement();
  rs = stmt.executeQuery(sql);


My struts.xml is this;

data-sources
data-source
  set-property property=key value=MRA/
  set-property property=driverClass value
=oracle.jdbc.driver.OracleDriver/
  set-property property=url value=jdbc:oracle:thin:
@147.101.104.63:1524:common/
  set-property property=user value=MRA/
  set-property property=password value=mralog/
/data-source
data-source
  set-property property=key value=PHONE_DB/
  set-property property=driverClass value
=oracle.jdbc.driver.OracleDriver/
  set-property property=url value=jdbc:oracle:thin:
@oid:1521:infoprd/
  set-property property=user value=info_user/
  set-property property=password value=info_user/
/data-source
  /data-sources

I dont see what I am doing wrong please help.  Thank you

Tim Bachta
Information Technology
MC 48



   

  David Graham   

  dgraham1980@hotmTo:   
[EMAIL PROTECTED]
  ail.com cc: 

   Subject:  Re: Multiple DataSource 
Problem   
  12/06/2002 12:45 

  PM   

  Please respond to

  Struts Users

  Mailing List

   

   





From action.execute()

DataSource ds1 =
(DataSource)this.getServlet().getServletContext().getAttribute
(YOUR_DS_KEY));

David






From: [EMAIL PROTECTED]
Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Subject: Re: Multiple DataSource Problem
Date: Fri, 6 Dec 2002 12:30:36 -0600


Ok , I thought I have already changed the key value's to MRA and
PHONE_DB in both of my data-sources, what I am having trouble with is
how
do I refrence these values in the form and action classes?


Tim Bachta
Information Technology
MC 48



   David Graham
   dgraham1980@hotmTo:
[EMAIL PROTECTED]
   ail.com cc:
Subject:  Re: Multiple
DataSource Problem
   12/05/2002 04:09
   PM
   Please respond to
   Struts Users
   Mailing List






data-source key=org.apache.struts.action.DATA_SOURCE

That would store the DataSource under the Struts default value, which
obviously only allows for one DataSource.  Just change the key value to
something else to store multiple DataSources.

David






 From: [EMAIL PROTECTED]
 Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
 To: Struts Users Mailing List [EMAIL PROTECTED]
 Subject: Re: Multiple DataSource Problem
 Date: Thu, 5 Dec 2002 15:01:21 -0600
 
 
 Can you show me a code snip of how to use this?
 
 
 Tim Bachta
 Information Technology
 MC 48
 
 
 
 
David Graham
dgraham1980@hotmTo:
 [EMAIL PROTECTED]
ail.com cc:
 Subject:  Re: Multiple
 DataSource Problem
12/05/2002 02:45
PM
Please respond to
Struts Users
Mailing List
 
 
 
 
 
 
 Use

Re: Multiple DataSource Problem

2002-12-06 Thread tbachta

That gives me a xml parse error:

-INF/struts-config.xmlLine 17, Column 34: XML-0138: (Error) REQUIRED
attribute 'property' is not
pecified. org.xml.sax.SAXParseException:
file:/C:/oracle/j2ee/home/applications/MRA/WEB-INF/struts
config.xmlLine 17, Column 34: XML-0138: (Error) REQUIRED attribute
'property' is not specified.
org.xml.sax.SAXParseException:
file:/C:/oracle/j2ee/home/applications/MRA/WEB-INF/struts-config.xml
Line 17, Column 34: XML-0138: (Error) REQUIRED attribute 'value' is not
specified.
at
oracle.xml.parser.v2.XMLError.flushErrorHandler(XMLError.java:231)
at oracle.xml.parser.v2.XMLError.flushErrors1(XMLError.java:156)
at
oracle.xml.parser.v2.NonValidatingParser.parseDocument(NonValidatingParser.java:268)
at oracle.xml.parser.v2.XMLParser.parse(XMLParser.java:145)
at org.apache.commons.digester.Digester.parse(Digester.java:1495)
at
org.apache.struts.action.ActionServlet.initApplicationConfig(ActionServlet.java:860)
at
org.apache.struts.action.ActionServlet.init(ActionServlet.java:455)
at javax.servlet.GenericServlet.init(GenericServlet.java:44)
at
com.evermind.server.http.HttpApplication.loadServlet(HttpApplication.java:1673)
at
com.evermind.server.http.HttpApplication.findServlet(HttpApplication.java:4006)
at
com.evermind.server.http.HttpApplication.initPreloadServlets(HttpApplication.java:4105)
at
com.evermind.server.http.HttpApplication.initDynamic(HttpApplication.java:579)
at
com.evermind.server.http.HttpApplication.init(HttpApplication.java:376)
at
com.evermind.server.Application.getHttpApplication(Application.java:657)
at
com.evermind.server.http.HttpServer.getHttpApplication(HttpServer.java:663)
at
com.evermind.server.http.HttpSite.getApplication(HttpSite.java:387)
at
com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:378)
at
com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:243)
at com.evermind.util.ThreadPoolThread.run(ThreadPoolThread.java:64)
[ERROR] Digester - -Parse Error at line 17 column 34:
file:/C:/oracle/j2ee/home/applications/MRA/WE
-INF/struts-config.xmlLine 17, Column 34: XML-0138: (Error) REQUIRED
attribute 'value' is not spe
ified. org.xml.sax.SAXParseException:
file:/C:/oracle/j2ee/home/applications/MRA/WEB-INF/struts-co
fig.xmlLine 17, Column 34: XML-0138: (Error) REQUIRED attribute 'value'
is not specified.
oracle.xml.parser.v2.XMLParseException: Attribute 'key' used but not
declared.
at oracle.xml.parser.v2.XMLError.flushErrors1(XMLError.java:208)
at
oracle.xml.parser.v2.NonValidatingParser.parseDocument(NonValidatingParser.java:268)
at oracle.xml.parser.v2.XMLParser.parse(XMLParser.java:145)
at org.apache.commons.digester.Digester.parse(Digester.java:1495)
at
org.apache.struts.action.ActionServlet.initApplicationConfig(ActionServlet.java:860)
at
org.apache.struts.action.ActionServlet.init(ActionServlet.java:455)
at javax.servlet.GenericServlet.init(GenericServlet.java:44)
at
com.evermind.server.http.HttpApplication.loadServlet(HttpApplication.java:1673)
at
com.evermind.server.http.HttpApplication.findServlet(HttpApplication.java:4006)
at
com.evermind.server.http.HttpApplication.initPreloadServlets(HttpApplication.java:4105)
at
com.evermind.server.http.HttpApplication.initDynamic(HttpApplication.java:579)
at
com.evermind.server.http.HttpApplication.init(HttpApplication.java:376)
at
com.evermind.server.Application.getHttpApplication(Application.java:657)
at
com.evermind.server.http.HttpServer.getHttpApplication(HttpServer.java:663)
at
com.evermind.server.http.HttpSite.getApplication(HttpSite.java:387)
at
com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:378)
at
com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:243)
at com.evermind.util.ThreadPoolThread.run(ThreadPoolThread.java:64)
[ERROR] ActionServlet - -Parsing error processing resource path
/WEB-INF/struts-config.xml oracle.
ml.parser.v2.XMLParseException: Attribute 'key' used but not declared.

Any other ideas? I am willing to try anything.

Tim Bachta
Information Technology
MC 48


   

  David Graham   

  dgraham1980@hotmTo:   
[EMAIL PROTECTED]
  ail.com cc: 

   Subject:  Re: Multiple DataSource 
Problem

Re: Multiple DataSource Problem

2002-12-06 Thread David Graham
Ok, post your entire data-sources section.

David







From: [EMAIL PROTECTED]
Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Subject: Re: Multiple DataSource Problem
Date: Fri, 6 Dec 2002 13:57:36 -0600


That gives me a xml parse error:

-INF/struts-config.xmlLine 17, Column 34: XML-0138: (Error) REQUIRED
attribute 'property' is not
pecified. org.xml.sax.SAXParseException:
file:/C:/oracle/j2ee/home/applications/MRA/WEB-INF/struts
config.xmlLine 17, Column 34: XML-0138: (Error) REQUIRED attribute
'property' is not specified.
org.xml.sax.SAXParseException:
file:/C:/oracle/j2ee/home/applications/MRA/WEB-INF/struts-config.xml
Line 17, Column 34: XML-0138: (Error) REQUIRED attribute 'value' is not
specified.
at
oracle.xml.parser.v2.XMLError.flushErrorHandler(XMLError.java:231)
at oracle.xml.parser.v2.XMLError.flushErrors1(XMLError.java:156)
at
oracle.xml.parser.v2.NonValidatingParser.parseDocument(NonValidatingParser.java:268)
at oracle.xml.parser.v2.XMLParser.parse(XMLParser.java:145)
at org.apache.commons.digester.Digester.parse(Digester.java:1495)
at
org.apache.struts.action.ActionServlet.initApplicationConfig(ActionServlet.java:860)
at
org.apache.struts.action.ActionServlet.init(ActionServlet.java:455)
at javax.servlet.GenericServlet.init(GenericServlet.java:44)
at
com.evermind.server.http.HttpApplication.loadServlet(HttpApplication.java:1673)
at
com.evermind.server.http.HttpApplication.findServlet(HttpApplication.java:4006)
at
com.evermind.server.http.HttpApplication.initPreloadServlets(HttpApplication.java:4105)
at
com.evermind.server.http.HttpApplication.initDynamic(HttpApplication.java:579)
at
com.evermind.server.http.HttpApplication.init(HttpApplication.java:376)
at
com.evermind.server.Application.getHttpApplication(Application.java:657)
at
com.evermind.server.http.HttpServer.getHttpApplication(HttpServer.java:663)
at
com.evermind.server.http.HttpSite.getApplication(HttpSite.java:387)
at
com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:378)
at
com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:243)
at 
com.evermind.util.ThreadPoolThread.run(ThreadPoolThread.java:64)
[ERROR] Digester - -Parse Error at line 17 column 34:
file:/C:/oracle/j2ee/home/applications/MRA/WE
-INF/struts-config.xmlLine 17, Column 34: XML-0138: (Error) REQUIRED
attribute 'value' is not spe
ified. org.xml.sax.SAXParseException:
file:/C:/oracle/j2ee/home/applications/MRA/WEB-INF/struts-co
fig.xmlLine 17, Column 34: XML-0138: (Error) REQUIRED attribute 'value'
is not specified.
oracle.xml.parser.v2.XMLParseException: Attribute 'key' used but not
declared.
at oracle.xml.parser.v2.XMLError.flushErrors1(XMLError.java:208)
at
oracle.xml.parser.v2.NonValidatingParser.parseDocument(NonValidatingParser.java:268)
at oracle.xml.parser.v2.XMLParser.parse(XMLParser.java:145)
at org.apache.commons.digester.Digester.parse(Digester.java:1495)
at
org.apache.struts.action.ActionServlet.initApplicationConfig(ActionServlet.java:860)
at
org.apache.struts.action.ActionServlet.init(ActionServlet.java:455)
at javax.servlet.GenericServlet.init(GenericServlet.java:44)
at
com.evermind.server.http.HttpApplication.loadServlet(HttpApplication.java:1673)
at
com.evermind.server.http.HttpApplication.findServlet(HttpApplication.java:4006)
at
com.evermind.server.http.HttpApplication.initPreloadServlets(HttpApplication.java:4105)
at
com.evermind.server.http.HttpApplication.initDynamic(HttpApplication.java:579)
at
com.evermind.server.http.HttpApplication.init(HttpApplication.java:376)
at
com.evermind.server.Application.getHttpApplication(Application.java:657)
at
com.evermind.server.http.HttpServer.getHttpApplication(HttpServer.java:663)
at
com.evermind.server.http.HttpSite.getApplication(HttpSite.java:387)
at
com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:378)
at
com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:243)
at 
com.evermind.util.ThreadPoolThread.run(ThreadPoolThread.java:64)
[ERROR] ActionServlet - -Parsing error processing resource path
/WEB-INF/struts-config.xml oracle.
ml.parser.v2.XMLParseException: Attribute 'key' used but not declared.

Any other ideas? I am willing to try anything.

Tim Bachta
Information Technology
MC 48



  David Graham
  dgraham1980@hotmTo:   
[EMAIL PROTECTED]
  ail.com cc:
   Subject:  Re: Multiple 
DataSource Problem
  12/06/2002 01:39
  PM
  Please respond

Re: Multiple DataSource Problem

2002-12-06 Thread tbachta

data-sources
data-source key=MRA
  set-property property=driverClass value
=oracle.jdbc.driver.OracleDriver/
  set-property property=url value=jdbc:oracle:thin:
@147.101.104.63:1524:common/
  set-property property=user value=MRA/
  set-property property=password value=mralog/
/data-source
data-source key=PHONE_DB
  set-property property=driverClass value
=oracle.jdbc.driver.OracleDriver/
  set-property property=url value=jdbc:oracle:thin:
@oid:1521:infoprd/
  set-property property=user value=info_user/
  set-property property=password value=info_user/
/data-source
  /data-sources

Tim Bachta
Information Technology
MC 48


   

  David Graham   

  dgraham1980@hotmTo:   
[EMAIL PROTECTED]
  ail.com cc: 

   Subject:  Re: Multiple DataSource 
Problem   
  12/06/2002 02:21 

  PM   

  Please respond to

  Struts Users

  Mailing List

   

   





Ok, post your entire data-sources section.

David






From: [EMAIL PROTECTED]
Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Subject: Re: Multiple DataSource Problem
Date: Fri, 6 Dec 2002 13:57:36 -0600


That gives me a xml parse error:

-INF/struts-config.xmlLine 17, Column 34: XML-0138: (Error) REQUIRED
attribute 'property' is not
pecified. org.xml.sax.SAXParseException:
file:/C:/oracle/j2ee/home/applications/MRA/WEB-INF/struts
config.xmlLine 17, Column 34: XML-0138: (Error) REQUIRED attribute
'property' is not specified.
org.xml.sax.SAXParseException:
file:/C:/oracle/j2ee/home/applications/MRA/WEB-INF/struts-config.xml
Line 17, Column 34: XML-0138: (Error) REQUIRED attribute 'value' is not
specified.
 at
oracle.xml.parser.v2.XMLError.flushErrorHandler(XMLError.java:231)
 at oracle.xml.parser.v2.XMLError.flushErrors1(XMLError.java:156)
 at
oracle.xml.parser.v2.NonValidatingParser.parseDocument(NonValidatingParser.java:268)

 at oracle.xml.parser.v2.XMLParser.parse(XMLParser.java:145)
 at org.apache.commons.digester.Digester.parse(Digester.java:1495)
 at
org.apache.struts.action.ActionServlet.initApplicationConfig(ActionServlet.java:860)

 at
org.apache.struts.action.ActionServlet.init(ActionServlet.java:455)
 at javax.servlet.GenericServlet.init(GenericServlet.java:44)
 at
com.evermind.server.http.HttpApplication.loadServlet(HttpApplication.java:1673)

 at
com.evermind.server.http.HttpApplication.findServlet(HttpApplication.java:4006)

 at
com.evermind.server.http.HttpApplication.initPreloadServlets(HttpApplication.java:4105)

 at
com.evermind.server.http.HttpApplication.initDynamic(HttpApplication.java:579)

 at
com.evermind.server.http.HttpApplication.init(HttpApplication.java:376)
 at
com.evermind.server.Application.getHttpApplication(Application.java:657)
 at
com.evermind.server.http.HttpServer.getHttpApplication(HttpServer.java:663)

 at
com.evermind.server.http.HttpSite.getApplication(HttpSite.java:387)
 at
com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:378)

 at
com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:243)

 at
com.evermind.util.ThreadPoolThread.run(ThreadPoolThread.java:64)
[ERROR] Digester - -Parse Error at line 17 column 34:
file:/C:/oracle/j2ee/home/applications/MRA/WE
-INF/struts-config.xmlLine 17, Column 34: XML-0138: (Error

Re: Multiple DataSource Problem

2002-12-06 Thread David Graham
Hmm, I don't see anything wrong with that.  What version of Struts are you 
using?  You should check the struts-config_1_1.dtd (or appropriate version 
number) for available elements and attributes.  The xml errors indicate you 
have an element missing the property attribute.

David






From: [EMAIL PROTECTED]
Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Subject: Re: Multiple DataSource Problem
Date: Fri, 6 Dec 2002 14:23:55 -0600


data-sources
data-source key=MRA
  set-property property=driverClass value
=oracle.jdbc.driver.OracleDriver/
  set-property property=url value=jdbc:oracle:thin:
@147.101.104.63:1524:common/
  set-property property=user value=MRA/
  set-property property=password value=mralog/
/data-source
data-source key=PHONE_DB
  set-property property=driverClass value
=oracle.jdbc.driver.OracleDriver/
  set-property property=url value=jdbc:oracle:thin:
@oid:1521:infoprd/
  set-property property=user value=info_user/
  set-property property=password value=info_user/
/data-source
  /data-sources

Tim Bachta
Information Technology
MC 48



  David Graham
  dgraham1980@hotmTo:   
[EMAIL PROTECTED]
  ail.com cc:
   Subject:  Re: Multiple 
DataSource Problem
  12/06/2002 02:21
  PM
  Please respond to
  Struts Users
  Mailing List






Ok, post your entire data-sources section.

David






From: [EMAIL PROTECTED]
Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Subject: Re: Multiple DataSource Problem
Date: Fri, 6 Dec 2002 13:57:36 -0600


That gives me a xml parse error:

-INF/struts-config.xmlLine 17, Column 34: XML-0138: (Error) REQUIRED
attribute 'property' is not
pecified. org.xml.sax.SAXParseException:
file:/C:/oracle/j2ee/home/applications/MRA/WEB-INF/struts
config.xmlLine 17, Column 34: XML-0138: (Error) REQUIRED attribute
'property' is not specified.
org.xml.sax.SAXParseException:
file:/C:/oracle/j2ee/home/applications/MRA/WEB-INF/struts-config.xml
Line 17, Column 34: XML-0138: (Error) REQUIRED attribute 'value' is not
specified.
 at
oracle.xml.parser.v2.XMLError.flushErrorHandler(XMLError.java:231)
 at oracle.xml.parser.v2.XMLError.flushErrors1(XMLError.java:156)
 at
oracle.xml.parser.v2.NonValidatingParser.parseDocument(NonValidatingParser.java:268)

 at oracle.xml.parser.v2.XMLParser.parse(XMLParser.java:145)
 at 
org.apache.commons.digester.Digester.parse(Digester.java:1495)
 at
org.apache.struts.action.ActionServlet.initApplicationConfig(ActionServlet.java:860)

 at
org.apache.struts.action.ActionServlet.init(ActionServlet.java:455)
 at javax.servlet.GenericServlet.init(GenericServlet.java:44)
 at
com.evermind.server.http.HttpApplication.loadServlet(HttpApplication.java:1673)

 at
com.evermind.server.http.HttpApplication.findServlet(HttpApplication.java:4006)

 at
com.evermind.server.http.HttpApplication.initPreloadServlets(HttpApplication.java:4105)

 at
com.evermind.server.http.HttpApplication.initDynamic(HttpApplication.java:579)

 at
com.evermind.server.http.HttpApplication.init(HttpApplication.java:376)
 at
com.evermind.server.Application.getHttpApplication(Application.java:657)
 at
com.evermind.server.http.HttpServer.getHttpApplication(HttpServer.java:663)

 at
com.evermind.server.http.HttpSite.getApplication(HttpSite.java:387)
 at
com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:378)

 at
com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:243)

 at
com.evermind.util.ThreadPoolThread.run(ThreadPoolThread.java:64)
[ERROR] Digester - -Parse Error at line 17 column 34:
file:/C:/oracle/j2ee/home/applications/MRA/WE
-INF/struts-config.xmlLine 17, Column 34: XML-0138: (Error) REQUIRED
attribute 'value' is not spe
ified. org.xml.sax.SAXParseException:
file:/C:/oracle/j2ee/home/applications/MRA/WEB-INF/struts-co
fig.xmlLine 17, Column 34: XML-0138: (Error) REQUIRED attribute 'value'
is not specified.
oracle.xml.parser.v2.XMLParseException: Attribute 'key' used but not
declared.
 at oracle.xml.parser.v2.XMLError.flushErrors1(XMLError.java:208)
 at
oracle.xml.parser.v2.NonValidatingParser.parseDocument(NonValidatingParser.java:268)

 at oracle.xml.parser.v2.XMLParser.parse(XMLParser.java:145)
 at 
org.apache.commons.digester.Digester.parse(Digester.java:1495)
 at
org.apache.struts.action.ActionServlet.initApplicationConfig

Multiple DataSource Problem

2002-12-05 Thread tbachta
I am having trouble getting multiple datasources to work in my application.
I have searched the archives and found inofrmation on how to do it but the
solutions given are depricated.  Can anyone help me?


data-sources
data-source
  set-property property=key value=MRA/
  set-property property=driverClass value
=oracle.jdbc.driver.OracleDriver/
  set-property property=url value=jdbc:oracle:thin:
@147.101.104.63:1524:common/
  set-property property=user value=MRA/
  set-property property=password value=mralog/
/data-source
data-source
  set-property property=key value=PHONE_DB/
  set-property property=driverClass value
=oracle.jdbc.driver.OracleDriver/
  set-property property=url value=jdbc:oracle:thin:
@oid:1521:infoprd/
  set-property property=user value=info_user/
  set-property property=password value=info_user/
/data-source
  /data-sources



try
{
  ServletContext context = servlet.getServletContext();
  DataSource dataSource = (DataSource)
context.getAttribute(Action.DATA_SOURCE_KEY);
  conn = dataSource.getConnection();
  stmt = conn.createStatement();
  rs = stmt.executeQuery(sql);

 Thank you for your help

Tim Bachta
Information Technology
MC 48




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




Re: Multiple DataSource Problem

2002-12-05 Thread David Graham
You need to give each data-source element its own key.  Struts stores the 
DataSource under that key in the ServletContext.

David






From: [EMAIL PROTECTED]
Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: Multiple DataSource Problem
Date: Thu, 5 Dec 2002 13:20:01 -0600

I am having trouble getting multiple datasources to work in my application.
I have searched the archives and found inofrmation on how to do it but the
solutions given are depricated.  Can anyone help me?


data-sources
data-source
  set-property property=key value=MRA/
  set-property property=driverClass value
=oracle.jdbc.driver.OracleDriver/
  set-property property=url value=jdbc:oracle:thin:
@147.101.104.63:1524:common/
  set-property property=user value=MRA/
  set-property property=password value=mralog/
/data-source
data-source
  set-property property=key value=PHONE_DB/
  set-property property=driverClass value
=oracle.jdbc.driver.OracleDriver/
  set-property property=url value=jdbc:oracle:thin:
@oid:1521:infoprd/
  set-property property=user value=info_user/
  set-property property=password value=info_user/
/data-source
  /data-sources



try
{
  ServletContext context = servlet.getServletContext();
  DataSource dataSource = (DataSource)
context.getAttribute(Action.DATA_SOURCE_KEY);
  conn = dataSource.getConnection();
  stmt = conn.createStatement();
  rs = stmt.executeQuery(sql);

 Thank you for your help

Tim Bachta
Information Technology
MC 48




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


_
MSN 8 with e-mail virus protection service: 2 months FREE* 
http://join.msn.com/?page=features/virus


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



Re: Multiple DataSource Problem

2002-12-05 Thread tbachta

Did I not give each data-source element its own key?

Tim Bachta
Information Technology
MC 48



   

  David Graham   

  dgraham1980@hotmTo:   
[EMAIL PROTECTED]
  ail.com cc: 

   Subject:  Re: Multiple DataSource 
Problem   
  12/05/2002 01:41 

  PM   

  Please respond to

  Struts Users

  Mailing List

   

   





You need to give each data-source element its own key.  Struts stores the
DataSource under that key in the ServletContext.

David






From: [EMAIL PROTECTED]
Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: Multiple DataSource Problem
Date: Thu, 5 Dec 2002 13:20:01 -0600

I am having trouble getting multiple datasources to work in my
application.
I have searched the archives and found inofrmation on how to do it but the
solutions given are depricated.  Can anyone help me?


data-sources
 data-source
   set-property property=key value=MRA/
   set-property property=driverClass value
=oracle.jdbc.driver.OracleDriver/
   set-property property=url value=jdbc:oracle:thin:
@147.101.104.63:1524:common/
   set-property property=user value=MRA/
   set-property property=password value=mralog/
 /data-source
 data-source
   set-property property=key value=PHONE_DB/
   set-property property=driverClass value
=oracle.jdbc.driver.OracleDriver/
   set-property property=url value=jdbc:oracle:thin:
@oid:1521:infoprd/
   set-property property=user value=info_user/
   set-property property=password value=info_user/
 /data-source
   /data-sources



try
 {
   ServletContext context = servlet.getServletContext();
   DataSource dataSource = (DataSource)
context.getAttribute(Action.DATA_SOURCE_KEY);
   conn = dataSource.getConnection();
   stmt = conn.createStatement();
   rs = stmt.executeQuery(sql);

  Thank you for your help

Tim Bachta
Information Technology
MC 48




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


_
MSN 8 with e-mail virus protection service: 2 months FREE*
http://join.msn.com/?page=features/virus


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







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




Re: Multiple DataSource Problem

2002-12-05 Thread David Graham
Use the key attribute of the data-source element.

David







From: [EMAIL PROTECTED]
Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Subject: Re: Multiple DataSource Problem
Date: Thu, 5 Dec 2002 14:02:31 -0600


Did I not give each data-source element its own key?

Tim Bachta
Information Technology
MC 48




  David Graham
  dgraham1980@hotmTo:   
[EMAIL PROTECTED]
  ail.com cc:
   Subject:  Re: Multiple 
DataSource Problem
  12/05/2002 01:41
  PM
  Please respond to
  Struts Users
  Mailing List






You need to give each data-source element its own key.  Struts stores the
DataSource under that key in the ServletContext.

David






From: [EMAIL PROTECTED]
Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: Multiple DataSource Problem
Date: Thu, 5 Dec 2002 13:20:01 -0600

I am having trouble getting multiple datasources to work in my
application.
I have searched the archives and found inofrmation on how to do it but 
the
solutions given are depricated.  Can anyone help me?


data-sources
 data-source
   set-property property=key value=MRA/
   set-property property=driverClass value
=oracle.jdbc.driver.OracleDriver/
   set-property property=url value=jdbc:oracle:thin:
@147.101.104.63:1524:common/
   set-property property=user value=MRA/
   set-property property=password value=mralog/
 /data-source
 data-source
   set-property property=key value=PHONE_DB/
   set-property property=driverClass value
=oracle.jdbc.driver.OracleDriver/
   set-property property=url value=jdbc:oracle:thin:
@oid:1521:infoprd/
   set-property property=user value=info_user/
   set-property property=password value=info_user/
 /data-source
   /data-sources



try
 {
   ServletContext context = servlet.getServletContext();
   DataSource dataSource = (DataSource)
context.getAttribute(Action.DATA_SOURCE_KEY);
   conn = dataSource.getConnection();
   stmt = conn.createStatement();
   rs = stmt.executeQuery(sql);

  Thank you for your help

Tim Bachta
Information Technology
MC 48




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


_
MSN 8 with e-mail virus protection service: 2 months FREE*
http://join.msn.com/?page=features/virus


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







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


_
The new MSN 8: advanced junk mail protection and 2 months FREE* 
http://join.msn.com/?page=features/junkmail


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



Re: Multiple DataSource Problem

2002-12-05 Thread tbachta

Can you show me a code snip of how to use this?


Tim Bachta
Information Technology
MC 48



   

  David Graham   

  dgraham1980@hotmTo:   
[EMAIL PROTECTED]
  ail.com cc: 

   Subject:  Re: Multiple DataSource 
Problem   
  12/05/2002 02:45 

  PM   

  Please respond to

  Struts Users

  Mailing List

   

   





Use the key attribute of the data-source element.

David






From: [EMAIL PROTECTED]
Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Subject: Re: Multiple DataSource Problem
Date: Thu, 5 Dec 2002 14:02:31 -0600


Did I not give each data-source element its own key?

Tim Bachta
Information Technology
MC 48




   David Graham
   dgraham1980@hotmTo:
[EMAIL PROTECTED]
   ail.com cc:
Subject:  Re: Multiple
DataSource Problem
   12/05/2002 01:41
   PM
   Please respond to
   Struts Users
   Mailing List






You need to give each data-source element its own key.  Struts stores the
DataSource under that key in the ServletContext.

David






 From: [EMAIL PROTECTED]
 Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Subject: Multiple DataSource Problem
 Date: Thu, 5 Dec 2002 13:20:01 -0600
 
 I am having trouble getting multiple datasources to work in my
application.
 I have searched the archives and found inofrmation on how to do it but
the
 solutions given are depricated.  Can anyone help me?
 
 
 data-sources
  data-source
set-property property=key value=MRA/
set-property property=driverClass value
 =oracle.jdbc.driver.OracleDriver/
set-property property=url value=jdbc:oracle:thin:
 @147.101.104.63:1524:common/
set-property property=user value=MRA/
set-property property=password value=mralog/
  /data-source
  data-source
set-property property=key value=PHONE_DB/
set-property property=driverClass value
 =oracle.jdbc.driver.OracleDriver/
set-property property=url value=jdbc:oracle:thin:
 @oid:1521:infoprd/
set-property property=user value=info_user/
set-property property=password value=info_user/
  /data-source
/data-sources
 
 
 
 try
  {
ServletContext context = servlet.getServletContext();
DataSource dataSource = (DataSource)
 context.getAttribute(Action.DATA_SOURCE_KEY);
conn = dataSource.getConnection();
stmt = conn.createStatement();
rs = stmt.executeQuery(sql);
 
   Thank you for your help
 
 Tim Bachta
 Information Technology
 MC 48
 
 
 
 
 --
 To unsubscribe, e-mail:
 mailto:[EMAIL PROTECTED]
 For additional commands, e-mail:
 mailto:[EMAIL PROTECTED]


_
MSN 8 with e-mail virus protection service: 2 months FREE*
http://join.msn.com/?page=features/virus


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







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


_
The new MSN 8: advanced junk mail protection and 2 months FREE*
http://join.msn.com/?page

Re: Multiple DataSource Problem

2002-12-05 Thread David Graham
data-source key=org.apache.struts.action.DATA_SOURCE

That would store the DataSource under the Struts default value, which 
obviously only allows for one DataSource.  Just change the key value to 
something else to store multiple DataSources.

David






From: [EMAIL PROTECTED]
Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Subject: Re: Multiple DataSource Problem
Date: Thu, 5 Dec 2002 15:01:21 -0600


Can you show me a code snip of how to use this?


Tim Bachta
Information Technology
MC 48




  David Graham
  dgraham1980@hotmTo:   
[EMAIL PROTECTED]
  ail.com cc:
   Subject:  Re: Multiple 
DataSource Problem
  12/05/2002 02:45
  PM
  Please respond to
  Struts Users
  Mailing List






Use the key attribute of the data-source element.

David






From: [EMAIL PROTECTED]
Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Subject: Re: Multiple DataSource Problem
Date: Thu, 5 Dec 2002 14:02:31 -0600


Did I not give each data-source element its own key?

Tim Bachta
Information Technology
MC 48




   David Graham
   dgraham1980@hotmTo:
[EMAIL PROTECTED]
   ail.com cc:
Subject:  Re: Multiple
DataSource Problem
   12/05/2002 01:41
   PM
   Please respond to
   Struts Users
   Mailing List






You need to give each data-source element its own key.  Struts stores the
DataSource under that key in the ServletContext.

David






 From: [EMAIL PROTECTED]
 Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Subject: Multiple DataSource Problem
 Date: Thu, 5 Dec 2002 13:20:01 -0600
 
 I am having trouble getting multiple datasources to work in my
application.
 I have searched the archives and found inofrmation on how to do it but
the
 solutions given are depricated.  Can anyone help me?
 
 
 data-sources
  data-source
set-property property=key value=MRA/
set-property property=driverClass value
 =oracle.jdbc.driver.OracleDriver/
set-property property=url 
value=jdbc:oracle:thin:
 @147.101.104.63:1524:common/
set-property property=user value=MRA/
set-property property=password value=mralog/
  /data-source
  data-source
set-property property=key value=PHONE_DB/
set-property property=driverClass value
 =oracle.jdbc.driver.OracleDriver/
set-property property=url 
value=jdbc:oracle:thin:
 @oid:1521:infoprd/
set-property property=user value=info_user/
set-property property=password 
value=info_user/
  /data-source
/data-sources
 
 
 
 try
  {
ServletContext context = servlet.getServletContext();
DataSource dataSource = (DataSource)
 context.getAttribute(Action.DATA_SOURCE_KEY);
conn = dataSource.getConnection();
stmt = conn.createStatement();
rs = stmt.executeQuery(sql);
 
   Thank you for your help
 
 Tim Bachta
 Information Technology
 MC 48
 
 
 
 
 --
 To unsubscribe, e-mail:
 mailto:[EMAIL PROTECTED]
 For additional commands, e-mail:
 mailto:[EMAIL PROTECTED]


_
MSN 8 with e-mail virus protection service: 2 months FREE*
http://join.msn.com/?page=features/virus


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







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


_
The new MSN 8: advanced junk mail protection and 2 months FREE*
http://join.msn.com/?page=features/junkmail


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







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


_
Add photos to your e-mail with MSN 8. Get 2 months FREE*. 
http://join.msn.com/?page=features/featuredemail


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



DataSource problem

2002-06-14 Thread Maarten Roosendaal

Hi,

I'm trying to create a simple DataBase app. using Struts. Right now i have a problem 
with getting the DataSource out of the InitialContext and i'm not sure what i'm doing 
wrong or maybe it has something to do with the Struts Servlet.

In configured the server.xml as follows:
 Resource name=test auth=CONTAINER
  type=javax.sql.DataSource/

 ResourceParams name=test
   parameter  nameuser/name   valueroot/value
  /parameter
   parameter  namepassword/namevalue/value   
/parameter
   parameter  namedriverClassName/name  
valueorg.gjt.mm.mysql.Driver/value /parameter
   parameter  namedriverName/name  
valuejdbc:mysql://localhost/test/value /parameter
  /ResourceParams

and my web.xml includes the following:
resource-ref
res-ref-nametest/res-ref-name
res-typejavax.sql.DataSource/res-type
res-authCONTAINER/res-auth
/resource-ref

In an Action-class i do this:
Context env = (Context) new InitialContext().lookup(java:comp/env);
DataSource ds = (DataSource) env.lookup(test);
Here the DataSource keeps ending up as NULL. When i do this:
Connection con = DriverManager.getConnection(Commands.DB_TEST_URL, 
Commands.DB_TEST_USERNAME, );
things are working fine but i have no idea where to look. The Context does seem to 
have a reference to the 'test' reference but nothing more.
Does this have something to do with Struts or did i forget something? I don't want to 
use the struts.xml for a database-connection. One of the reasons is that i keep 
getting the message that it can't find the driver, while it is included in the 
CLASSPATH.

Hope someone can help,
Maarten




Re: DataSource problem

2002-06-14 Thread rainer juenger

Hi Maarten,

join the club! There are some more guys having exactliy the same problem as
you.
To me your configuration looks all right. I saw some samples :

parameter  namedriverName/name
valuejdbc:mysql://localhost/test/value /parameter

where the parameter name is not driverName but url. I tried both without
luck.

Are you using Tomcat 4.x without DBCP from the Jakarta Commons to get the
JNDI DB Connection?

Please follow the thread Connection pooling dowsn't work for me ... Help
!!
Hopefully there is someone arround giving us a tip how to get it run

Good luck to all of us ;)
Rainer

- Original Message -
From: Maarten Roosendaal [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, June 14, 2002 3:42 PM
Subject: DataSource problem


Hi,

I'm trying to create a simple DataBase app. using Struts. Right now i have a
problem with getting the DataSource out of the InitialContext and i'm not
sure what i'm doing wrong or maybe it has something to do with the Struts
Servlet.

In configured the server.xml as follows:
 Resource name=test auth=CONTAINER
  type=javax.sql.DataSource/

 ResourceParams name=test
   parameter  nameuser/name
valueroot/value  /parameter
   parameter  namepassword/namevalue/value
/parameter
   parameter  namedriverClassName/name
valueorg.gjt.mm.mysql.Driver/value /parameter
   parameter  namedriverName/name
valuejdbc:mysql://localhost/test/value /parameter
  /ResourceParams

and my web.xml includes the following:
resource-ref
res-ref-nametest/res-ref-name
res-typejavax.sql.DataSource/res-type
res-authCONTAINER/res-auth
/resource-ref

In an Action-class i do this:
Context env = (Context) new
InitialContext().lookup(java:comp/env);
DataSource ds = (DataSource) env.lookup(test);
Here the DataSource keeps ending up as NULL. When i do this:
Connection con = DriverManager.getConnection(Commands.DB_TEST_URL,
Commands.DB_TEST_USERNAME, );
things are working fine but i have no idea where to look. The Context
does seem to have a reference to the 'test' reference but nothing more.
Does this have something to do with Struts or did i forget something? I
don't want to use the struts.xml for a database-connection. One of the
reasons is that i keep getting the message that it can't find the driver,
while it is included in the CLASSPATH.

Hope someone can help,
Maarten




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




DataSource problem with NIGHTLY-BUILD version- 20010911 of STRUTS

2001-09-26 Thread BinhMinh Nguyen


I have no problem using Datasource in STRUT version
1.0, but when I upgrade STRUTS to nightly version, I
have a problem using datasource. Here how it happens

I first replace the XML parser and JAXP so that it can
support Namespace. Then I follow the instruction in
the Nighlt Release and I restart the Tomcat server.

TOMCAT complain that It cannot locate the
GenericDataSource. Something like this:

New org.apache.struts.util.GenericDataSource
EM java.lang.NoClassDefFoundError:
org.apache.struts.util.GenericDataSource
 

I then followed some threads in the user-groups, they
said that I need to add jdbc2_0-stdext.jar to the
CLASSPATH or to the
WEB_INF/lib directory inside of your application. I
tried both ways. I still cannot sovled the problem . I
did open the the 'struts.jar' in the WEB-INF/lib to
make sure the GenericDataSource class is there.
Everything seems to be in the right place. but I
cannot get rid of the error. Please help me.

Thanks
Binh


__
Do You Yahoo!?
Get email alerts  NEW webcam video instant messaging with Yahoo! Messenger. 
http://im.yahoo.com



Struts Datasource problem

2001-06-13 Thread Bill Clinton

Hello,
 I am having a recurring problem with struts and jdbc.  The demo 
driver I am using, inet's Sprinta200, only allows 2 connections.  I have 
my data source max set to 1, but I still get errors from the driver:

java.sql.SQLException: [TDS Driver]Too many connections :3
at com.inet.tds.e.init(Unknown Source)
at com.inet.tds.TdsDriver.connect(Unknown Source)
at 
org.apache.struts.util.GenericDataSource.createConnection(GenericDataSource.java:731)
at org.apache.struts.util.GenericDataSource.open(GenericDataSource.java:668)
at 
org.apache.struts.action.ActionServlet.initDataSources(ActionServlet.java:1077)
at org.apache.struts.action.ActionServlet.init(ActionServlet.java:471)
at javax.servlet.GenericServlet.init(GenericServlet.java:52)
at com.caucho.server.http.Application.createServlet(Application.java:1741)
___

this is how I have it set up in my struts-config:

data-source
   set-property property=autoCommit value=false/
   set-property property=description value=I-Net Sprinta2000/
   set-property property=driverClass value=com.inet.tds.TdsDriver/
   set-property property=maxCount value=1/
   set-property property=minCount value=1/
   set-property property=password value=password/
   set-property property=urlvalue=jdbc:inetdae7a:192.168.0.20:1433/
   set-property property=user value=sa/
/data-source


I sometimes get this problem right after I stop and start resin and 
bring up a JSP that doesn't even use a connection.  Any ideas?

Bill




Re: Struts Datasource problem

2001-06-13 Thread Martin Cooper

Are you the only person connecting to the database with this driver? One of
the unusual things about the demo version of Sprinta is that the connection
limit is per database server, not per client. So if two other people already
have one connection each open to the same database, you will see this error
when you try to open your connection.

Hope this helps.

--
Martin Cooper


- Original Message -
From: Bill Clinton [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, June 13, 2001 1:47 PM
Subject: Struts Datasource problem


 Hello,
  I am having a recurring problem with struts and jdbc.  The demo
 driver I am using, inet's Sprinta200, only allows 2 connections.  I have
 my data source max set to 1, but I still get errors from the driver:

 java.sql.SQLException: [TDS Driver]Too many connections :3
 at com.inet.tds.e.init(Unknown Source)
 at com.inet.tds.TdsDriver.connect(Unknown Source)
 at

org.apache.struts.util.GenericDataSource.createConnection(GenericDataSource.
java:731)
 at
org.apache.struts.util.GenericDataSource.open(GenericDataSource.java:668)
 at

org.apache.struts.action.ActionServlet.initDataSources(ActionServlet.java:10
77)
 at org.apache.struts.action.ActionServlet.init(ActionServlet.java:471)
 at javax.servlet.GenericServlet.init(GenericServlet.java:52)
 at com.caucho.server.http.Application.createServlet(Application.java:1741)
 ___

 this is how I have it set up in my struts-config:

 data-source
set-property property=autoCommit value=false/
set-property property=description value=I-Net Sprinta2000/
set-property property=driverClass value=com.inet.tds.TdsDriver/
set-property property=maxCount value=1/
set-property property=minCount value=1/
set-property property=password value=password/
set-property property=urlvalue=jdbc:inetdae7a:192.168.0.20:1433/
set-property property=user value=sa/
 /data-source


 I sometimes get this problem right after I stop and start resin and
 bring up a JSP that doesn't even use a connection.  Any ideas?

 Bill