我在配置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目录下没有$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
解决方案 »
- 做手机服务器端开发有前途吗?
- 求助,关于同时上传图片和插入信息
- struts2 多文件上传的问题。忘高手指点
- hibernate在更新CLOB字段的时候报错(不同版本的oracle不一样)
- hibernate映射文件中设置字段长度后,生成到oracle数据库中增加了一倍?请问怎样解决?谢谢。
- 用myeclipse开发struts,出现了错误,大家帮忙看看
- hibernate.cfg.xml的问题关于数据库用户跟数据库的关系(急)
- 关于client运行的问题
- 紧急求助;数字和大写数字的转换问题,各位大哥帮忙。
- JAVA类在C#中是否可以调用?
- struts2配置问题,看内容
- 我快疯了,帮我看看什么问题.谢谢啊
免费的javaEE服务器
你把jar放到
tomcat/lib
目录下面吧。如果是 tomcat5.5,放到
tomcat/shared/lib
下面