日期:2014-05-20  浏览次数:20751 次

急救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,你加我好吗。