Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Struts Artimus unable to change database name
I am in the process of learning STRUTS and as a starting point I am
using the book
"Struts In Action"

I have downloaded the source code for the main example in the book
which is called artimus
http://www.manning-source.com/books.../husted_src.zip

Having tweaked various files: built.xml, struts-config.xml and I have
successful got it working.

However, I want to adapt it and develop my own STRUTS application, so
as a first stage I want to change the name of the database that it is
using, currently "artimus" and this is where I am having great
problems.
The name of the database appears to be defined in lots of places:

./WEB-INF/poolman.xml:
./WEB-INF/src/conf/poolman.xml:
./WEB-INF/src/java/poolman.xml:

./WEB-INF/src/conf/web.xml:  -->  ./WEB-INF/web.xml:
./WEB-INF/src/conf/struts-config.xml:  -->
./WEB-INF/struts-config.xml:


By commenting out references to "artimus" in both "struts-config.xml"
I have worked out that it is not using this information to access the
database.

<!--
<data-sources>
<data-source>
<set-property property="maxCount"
value="4"/>
<set-property property="minCount"
value="2"/>
<set-property property="description"
value="Artimus:MySQL Data Source
Configuration"/>
<set-property property="driverClass"
value="org.gjt.mm.mysql.Driver"/>
<set-property property="url"
value="jdbc:mysql://localhost:3306/artimus"/>
<set-property property="autoCommit"
value="true"/>
<set-property property="user"
value="root"/>
<set-property property="password"
value=""/>
</data-source>
</data-sources>
-->


When I attempt to change the name of the database to "mydatabase" in
every XML file that I can find I always get the same error message:


INFO: Processing a 'POST' for path '/CreateResources'
Unable to open log file named "/var/applogs/poolman-artimus.log" using
System.out instead
January 28, 2004 8:54:01 PM GMT: PoolMan JDBCPool unable to locate a
default JNDI provider, jndi-artimus DataSource not bound to JNDI: null
January 28, 2004 8:54:01 PM GMT: PoolMan Local Pool Deployer: Created
JDBC XA Connection Pool named: jdbc-artimus
java.lang.NullPointerException
at org.apache.artimus.article.Access.index(Unknown Source)


It is still trying to access the original database, "artimus". If
anyone can give me any advice as to how and where it is accessing the
database it would be a great help.

The environments that I have been using are:

Windows XP Pro
Tomcat 4.1.29
apache-ant-1.6.0
artimus_1_1.war
Struts_1_1 (beta ?)

and also

MacOS X 10.2.8
Tomcat 4.1.29
apache-ant-1.6.0
artimus_1_1.war
Struts_1_1 (beta ?)

I would also like to know if there is a better or simpler example than
Artimus to start learning with.

Thanks
Steve

Report this thread to moderator Post Follow-up to this message
Old Post
Steve Greenwood
03-20-04 01:45 AM


Re: Struts Artimus unable to change database name
Wait.  You changed database name in "description"?
Or elsewhere?


>
> By commenting out references to "artimus" in both "struts-config.xml"
> I have worked out that it is not using this information to access the
> database.
>
> <!--
>   <data-sources>
>     <data-source>
>       <set-property property="maxCount"
>                        value="4"/>
>       <set-property property="minCount"
>                        value="2"/>
>       <set-property property="description"
>                        value="Artimus:MySQL Data Source
> Configuration"/>
>       <set-property property="driverClass"
>                        value="org.gjt.mm.mysql.Driver"/>
>       <set-property property="url"
>                        value="jdbc:mysql://localhost:3306/artimus"/>
>       <set-property property="autoCommit"
>                        value="true"/>
>       <set-property property="user"
>                        value="root"/>
>       <set-property property="password"
>                        value=""/>
>     </data-source>
>   </data-sources>
> -->
>
>
> When I attempt to change the name of the database to "mydatabase" in
> every XML file that I can find I always get the same error message:
>
>
> INFO: Processing a 'POST' for path '/CreateResources'
> Unable to open log file named "/var/applogs/poolman-artimus.log" using
> System.out instead
> January 28, 2004 8:54:01 PM GMT: PoolMan JDBCPool unable to locate a
> default JNDI provider, jndi-artimus DataSource not bound to JNDI: null
> January 28, 2004 8:54:01 PM GMT: PoolMan Local Pool Deployer: Created
> JDBC XA Connection Pool named: jdbc-artimus
> java.lang.NullPointerException
> 	at org.apache.artimus.article.Access.index(Unknown Source)
>
>
> It is still trying to access the original database, "artimus". If
> anyone can give me any advice as to how and where it is accessing the
> database it would be a great help.
>
> The environments that I have been using are:
>
> 	Windows XP Pro
> 	Tomcat 4.1.29
> 	apache-ant-1.6.0
> 	artimus_1_1.war
> 		Struts_1_1 (beta ?)
>
> and also
>
> 	MacOS X 10.2.8
> 	Tomcat 4.1.29
> 	apache-ant-1.6.0
> 	artimus_1_1.war
> 		Struts_1_1 (beta ?)
>
> I would also like to know if there is a better or simpler example than
> Artimus to start learning with.
>
> Thanks
>     Steve

Report this thread to moderator Post Follow-up to this message
Old Post
Rick Osborn
03-20-04 01:45 AM


Re: Struts Artimus unable to change database name
I have eventually solved the problem:

I discovered that there is another copy of "poolman.xml" within the
library:

lib/commons-scaffold.jar

I had to extract this one edit it and then replace it, now it uses a
different database name. None of the other copies of "poolman.xml" are
relevant.

I also had to change the reference to it in web.xml :

<init-param>
<param-name>adaptor.key</param-name>
<param-value>jdbc-artimus</param-value>
</init-param>

changes to:

<init-param>
<param-name>adaptor.key</param-name>
<param-value>jdbc-mydatabase</param-value>
</init-param>


Thanks,
Steve

Report this thread to moderator Post Follow-up to this message
Old Post
Steve Greenwood
03-20-04 01:45 AM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

Java Beans archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 11:40 AM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.