读书人

我在配置jotm+tomcat6.0时报如下的错误

发布时间: 2011-11-13 21:39:11 作者: rapoo

急救ow2-jotm-dist-2.1.4+tomcat6.0+jdk6.0
我在配置jotm+tomcat6.0时报如下的错误javax.naming.NamingException: Could not create resource factory instance [Root exception is java.lang.NoClassDefFoundError]

我使用的是ow2-jotm-dist2.1.4,我没有将解压后lib下所有的包都放到common/lib下,请问要放那些包?
tomacat6.0目录下没有$TOMCAT_HOME\common\classes这个文件夹,carol.properties文件该放到哪里?现在我把carol.properties放在$TOMCAT_HOME\conf和工程的classes里面。是不是因为jdk版本的问题?

web.xml配置如下:
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>

<resource-ref>
<description>jdbc/myDB</description>
<res-ref-name>jdbc/myDB</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
</web-app>

context.xml配置如下
<Resource
name="jdbc/myDB"
type="javax.sql.DataSource"
factory="org.objectweb.jotm.datasource.DataSourceFactory"
driverClassName="com.mysql.jdbc.Driver"
password="admin"
maxIdle="2"
maxWait="5000"
username="root"
url="jdbc:mysql://localhost:3306/tipa"
maxActive="4"/>

<Resource name="UserTransaction"
auth="Container"
type="javax.transaction.UserTransaction" />

<Transaction factory="org.objectweb.jotm.UserTransactionFactory"
jotm.timeout="60" />


carol.properties内容如下:
carol.protocols=jrmp
carol.jvm.rmi.local.call=true
carol.start.jndi=false
carol.start.ns=false
carol.jndi.java.naming.factory.url.pkgs=org.apache.naming

[解决办法]
tomacat6.0你把jar放到tomcat/lib目录下面吧。如果是 tomcat5.5,放到tomcat/shared/lib下面
[解决办法]
兄弟,我也想问这个问题,你解决没有呢?我的qq是289270137,你加我好吗。

读书人网 >J2EE开发

热点推荐