project在local weblogic運作正常
deploy到linux上的weblogic cluster上後,則出現奇怪錯誤
server: weblogic cluster
datasource: 使用一XA type multi datasource 載入兩個data sources
project:多個project,包含nas and sem
web project呼叫nas時,出現
Failed to load class org.apache.openjpa.persistence.ArgumentException
詳細錯誤訊息如下
javax.ejb.EJBException: nested exception is: java.lang.ClassNotFoundException: Failed to load class org.apache.openjpa.persistence.ArgumentException
java.lang.ClassNotFoundException: Failed to load class org.apache.openjpa.persistence.ArgumentException
at weblogic.rmi.utils.WLRMIClassLoaderDelegate.loadClass(WLRMIClassLoaderDelegate.java:203)
at weblogic.rmi.utils.WLRMIClassLoaderDelegate.loadClass(WLRMIClassLoaderDelegate.java:128)
at weblogic.rmi.utils.Utilities.loadClass(Utilities.java:308)
at weblogic.rjvm.MsgAbbrevInputStream.resolveClass(MsgAbbrevInputStream.java:400)
at weblogic.utils.io.
ChunkedObjectInputStream$NestedObjectInputStream.resolveClass(ChunkedObjectInputStream.java:255)
...
at weblogic.ejb.container.internal.RemoteBusinessIntfProxy.invoke(RemoteBusinessIntfProxy.java:63)
at $Proxy0.getRndNumbers(Unknown Source)
at com.pchome.nas.app.biz.adapter.NumberAdapter.getRndNumbers(NumberAdapter.java:30)
at test.client.NumberClient.main(NumberClient.java:59)
javax.ejb.EJBException: nested exception is: java.lang.ClassNotFoundException: Failed to load class org.apache.openjpa.persistence.ArgumentException
at weblogic.ejb.container.internal.RemoteBusinessIntfProxy.invoke(RemoteBusinessIntfProxy.java:78)
at $Proxy0.getRndNumbers(Unknown Source)
at com.pchome.nas.app.biz.adapter.NumberAdapter.getRndNumbers(NumberAdapter.java:30)
at test.client.NumberClient.main(NumberClient.java:59)
Exception in thread "main" java.lang.NullPointerException
at test.client.NumberClient.printNumber(NumberClient.java:33)
at test.client.NumberClient.main(NumberClient.java:132)
result code=20000
result msg=nested exception is: java.lang.ClassNotFoundException: Failed to load class org.apache.openjpa.persistence.ArgumentException
一開始一度以為是XA datasource的問題
經嚴格測試後,發現XA or non-XA都可
由於錯誤訊息提供的資訊有限
因此去下載了openjpa-1.0.1.jar回來
錯誤訊息有因此變的詳細一點點點
======= 找到原因 =========
後來發現,sem (本身也是個ejb project)
將 nas_client.jar 也deploy到server上
(可能是在deployments裡面install,也可能是丟到domain裡的lib)
總之因此造成
nas_client.jar 裡的 session bean interface
以及用來傳遞資訊用的vo
跟deploy 到server上nas project裡的
interface,以及vo 有衝突
(因為這樣在server上就變有兩份同樣的資料)
======= 解決方式 =========
後來,都採用ear檔方式deploy
要載入的library都放在
*.ear/APP-INF/lib/nas_client.jar
就解決以上問題
不過,關於deployment應該要再好好研究
擇日再紀錄
- Jan 15 Tue 2008 18:36
Failed to load class
close
全站熱搜
留言列表