You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Jacob Kjome <ho...@visi.com> on 2004/11/27 06:53:05 UTC

issue with differences between 5.0.xx and 5.5.x

I created a custom resource factory for Tomcat which works great in 
5.0.xx.  However, I'm having an issue with the new configuration 5.5.x 
where all config is done via attributes rather than as nested <parameter> 
elements.  Basically, I've got a parameter of which the value needs to 
include newlines as it is really a set of properties to be loaded into a 
java.util.Properties object and this simply doesn't work if the config is 
provided as an attribute.  I didn't expect this to work, but I made an 
attempt and verified that it didn't.  Here it is....

<Resource name="jdo/kodoJDO" auth="Container" 
type="javax.resource.cci.ConnectionFactory"
               factory="com.mycompany.container.jdo.JDOHelperWrapperJNDIFactory"
               config="kodo.LicenseKey: [some license key]
                       javax.jdo.PersistenceManagerFactoryClass: 
kodo.jdbc.runtime.JDBCPersistenceManagerFactory
                       javax.jdo.option.ConnectionURL: 
jdbc:oracle:thin:@somedomain.com:1521:somedb
                       javax.jdo.option.ConnectionDriverName: 
oracle.jdbc.driver.OracleDriver
                       javax.jdo.option.ConnectionUserName: username
                       javax.jdo.option.ConnectionPassword: password
                       javax.jdo.option.Optimistic: true
                       javax.jdo.option.RetainValues: true
                       javax.jdo.option.NontransactionalRead: true
                       kodo.jdbc.Schemas: SOMESCHEMA"/>

This is supposed to configure a Kodo JDO connection factory to be accessed 
via JNDI (mimicking more standard mechanisms in full J2EE 
servers).  However, using this config in Tomcat-5.5.4 results in Kodo 
saying that the property "javax.jdo.PersistenceManagerFactoryClass" is 
missing and must be specified.  Well, I've obviously attempted to specify 
it above (along with many others).  It just can't deal with the newlines in 
the attribute.  How do I get around this?  Is there an option for nested 
parameters defined by XML elements rather than attributes like in 
Tomcat-5.0.xx?  Here's the equivalent config that works perfectly well 
under Tomcat-5.0.xx....

<Resource name="jdo/nbsJDO" auth="Container"
	          type="javax.resource.cci.ConnectionFactory"/>
     <ResourceParams name="jdo/nbsJDO">
         <parameter>
             <name>factory</name>
             <value>com.mycompany.container.jdo.JDOHelperWrapperJNDIFactory</value>
         </parameter>
         <parameter>
             <name>config</name>
             <value>
             kodo.LicenseKey: [some license key]
             javax.jdo.PersistenceManagerFactoryClass: 
kodo.jdbc.runtime.JDBCPersistenceManagerFactory
             javax.jdo.option.ConnectionURL: 
jdbc:oracle:thin:@somedomain.com:1521:somedb
             javax.jdo.option.ConnectionDriverName: 
oracle.jdbc.driver.OracleDriver
             javax.jdo.option.ConnectionUserName: username
             javax.jdo.option.ConnectionPassword: password
             javax.jdo.option.Optimistic: true
             javax.jdo.option.RetainValues: true
             javax.jdo.option.NontransactionalRead: true
             kodo.jdbc.Schemas: SOMESCHEMA
             </value>
         </parameter>
     </ResourceParams>

Please don't tell me to implement each of these properties as config 
attributes of the <Resource> element.  The properties are free-form and 
there are many more possible, quite a few of them kodo-specific that I 
would like to be able to add without having to modify the custom resource 
factory constantly.  It is vastly simpler to be able to load all this stuff 
up in a Properties object which is what Kodo expects anyway for 
configuration.

I can understand why the whole <Resource> + <ResourceParams> + <parameter> 
was eschewed in favor of less verbose attributes, but attributes don't 
offer all the functionality of the nested elements.  Can nested <parameter> 
elements be an option for Tomcat-5.5.x's <Resource> config?

thanks,


Jake


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


error in tomcat

Posted by akki <ak...@bhelhwr.co.in>.
hi all....

i m getting these enteries in my tomcat log file
very frequently
INFO: server has been restarted or reset this connection
Nov 27, 2004 7:39:10 AM org.apache.jk.common.ChannelSocket processConnection
INFO: server has been restarted or reset this connection
Nov 27, 2004 7:39:41 AM org.apache.jk.common.ChannelSocket processConnection
INFO: server has been restarted or reset this connection
Nov 27, 2004 7:40:18 AM org.apache.jk.common.ChannelSocket processConnection
INFO: server has been restarted or reset this connection
Nov 27, 2004 7:40:22 AM org.apache.jk.common.ChannelSocket processConnection
INFO: server has been restarted or reset this connection
Nov 27, 2004 7:40:52 AM org.apache.jk.common.ChannelSocket processConnection
INFO: server has been restarted or reset this connection
Nov 27, 2004 7:40:53 AM org.apache.jk.common.ChannelSocket processConnection
INFO: server has been restarted or reset this connection
Nov 27, 2004 7:41:24 AM org.apache.jk.common.ChannelSocket processConnection

what may be cause of this logging....
any info

tia



Regards

Akki
Engineer
ITX
BHEL,HARDWAR
Available at 5405,4553
"The greatest mistake you can make in life is to be continually fearing you
will make one"



-----Original Message-----
From: Jacob Kjome [mailto:hoju@visi.com]
Sent: Saturday, November 27, 2004 11:23 AM
To: tomcat-user@jakarta.apache.org
Subject: issue with <Resource> differences between 5.0.xx and 5.5.x



I created a custom resource factory for Tomcat which works great in
5.0.xx.  However, I'm having an issue with the new configuration 5.5.x
where all config is done via attributes rather than as nested <parameter>
elements.  Basically, I've got a parameter of which the value needs to
include newlines as it is really a set of properties to be loaded into a
java.util.Properties object and this simply doesn't work if the config is
provided as an attribute.  I didn't expect this to work, but I made an
attempt and verified that it didn't.  Here it is....

<Resource name="jdo/kodoJDO" auth="Container"
type="javax.resource.cci.ConnectionFactory"
               factory="com.mycompany.container.jdo.JDOHelperWrapperJNDIFact
ory"
               config="kodo.LicenseKey: [some license key]
                       javax.jdo.PersistenceManagerFactoryClass:
kodo.jdbc.runtime.JDBCPersistenceManagerFactory
                       javax.jdo.option.ConnectionURL:
jdbc:oracle:thin:@somedomain.com:1521:somedb
                       javax.jdo.option.ConnectionDriverName:
oracle.jdbc.driver.OracleDriver
                       javax.jdo.option.ConnectionUserName: username
                       javax.jdo.option.ConnectionPassword: password
                       javax.jdo.option.Optimistic: true
                       javax.jdo.option.RetainValues: true
                       javax.jdo.option.NontransactionalRead: true
                       kodo.jdbc.Schemas: SOMESCHEMA"/>

This is supposed to configure a Kodo JDO connection factory to be accessed
via JNDI (mimicking more standard mechanisms in full J2EE
servers).  However, using this config in Tomcat-5.5.4 results in Kodo
saying that the property "javax.jdo.PersistenceManagerFactoryClass" is
missing and must be specified.  Well, I've obviously attempted to specify
it above (along with many others).  It just can't deal with the newlines in
the attribute.  How do I get around this?  Is there an option for nested
parameters defined by XML elements rather than attributes like in
Tomcat-5.0.xx?  Here's the equivalent config that works perfectly well
under Tomcat-5.0.xx....

<Resource name="jdo/nbsJDO" auth="Container"
	          type="javax.resource.cci.ConnectionFactory"/>
     <ResourceParams name="jdo/nbsJDO">
         <parameter>
             <name>factory</name>
             <value>com.mycompany.container.jdo.JDOHelperWrapperJNDIFactory<
/value>
         </parameter>
         <parameter>
             <name>config</name>
             <value>
             kodo.LicenseKey: [some license key]
             javax.jdo.PersistenceManagerFactoryClass:
kodo.jdbc.runtime.JDBCPersistenceManagerFactory
             javax.jdo.option.ConnectionURL:
jdbc:oracle:thin:@somedomain.com:1521:somedb
             javax.jdo.option.ConnectionDriverName:
oracle.jdbc.driver.OracleDriver
             javax.jdo.option.ConnectionUserName: username
             javax.jdo.option.ConnectionPassword: password
             javax.jdo.option.Optimistic: true
             javax.jdo.option.RetainValues: true
             javax.jdo.option.NontransactionalRead: true
             kodo.jdbc.Schemas: SOMESCHEMA
             </value>
         </parameter>
     </ResourceParams>

Please don't tell me to implement each of these properties as config
attributes of the <Resource> element.  The properties are free-form and
there are many more possible, quite a few of them kodo-specific that I
would like to be able to add without having to modify the custom resource
factory constantly.  It is vastly simpler to be able to load all this stuff
up in a Properties object which is what Kodo expects anyway for
configuration.

I can understand why the whole <Resource> + <ResourceParams> + <parameter>
was eschewed in favor of less verbose attributes, but attributes don't
offer all the functionality of the nested elements.  Can nested <parameter>
elements be an option for Tomcat-5.5.x's <Resource> config?

thanks,


Jake


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org