以前在项目开发中没有用过jboss服务器,今天第一次用到,碰到许多问题,纠结一天,终于搞定,把问题记录一下。
1. 启动报错
DEPLOYMENTS IN ERROR: Deployment "AttachmentStore" is in error due to: java.lang.IllegalArgumentException: Wrong arguments. new for target java.lang.reflect.Constructor expected=[java.net.URI] actual=[java.io.File]
解决办法:
确定正在使用的要发布的服务器(server 目录下使用到的服务目录,如 all, default, minial, ...,这里我使用的是 default)。
进到类似目录 server/default/conf/bootstrap,打开文件 profile.xml
找到:
<bean name="AttachmentStore" class="org.jboss.system.server.profileservice.repository.AbstractAttachmentStore"> <constructor><parameter><inject bean="BootstrapProfileFactory" property="attachmentStoreRoot" /></parameter></constructor>
修改为:
<bean name="AttachmentStore" class="org.jboss.system.server.profileservice.repository.AbstractAttachmentStore"> <constructor><parameter class="java.io.File"><inject bean="BootstrapProfileFactory" property="attachmentStoreRoot" /></parameter></constructor>
重启 JBoss,问题解决。
2.WARN [JBossManagedConnectionPool] Throwable while attempting to get a new connection: null
org.jboss.resource.JBossResourceException: Could not create connection; - nested throwable: (org.jboss.resource.JBossResourceException: Apparently wrong driver class specified for URL: class: oracle.jdbc.driver.OracleDriver,
url: jdbc:oracle:thin:@192.168.2.219:1521:DEVELOP)
解决办法:D:\jboss\jboss-5.1.0.GA-jdk6\jboss-5.1.0.GA\server\web\lib 这是我发布项目的lib包,在这里面把mysql的驱动加进去就好了。