Struts Artimus unable to change database name

S

Steve Greenwood

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/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
 
S

Steve Greenwood

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,077
Latest member
SangMoor21

Latest Threads

Top