<Fri Mar 07 14:04:01 CST 2014> <Info> <Store> <WL-280008> <Opening the persistent file store "SAFSTORE0V" for recovery: directory=D:\SAFCONFIG\stores\default requestedWritePolicy="Direct-Write" fileLockingEnabled=true driver="NIO".>
<Fri Mar 07 14:04:02 CST 2014> <Info> <Store> <WL-280009> <The persistent file store "SAFSTORE0V" (ed7f4264-19e9-4c39-94e9-e45e0870c1df) has been opened: blockSize=512 actualWritePolicy="Direct-Write(single-handle-buffered)" explicitIOEnforced=false records=12.>
<Fri Mar 07 14:04:02 CST 2014> <Info> <Messaging> <WL-282003> <The messaging kernel ClientSAFAgent0 will use up to 22,216,704 bytes of memory before paging begins>
<Fri Mar 07 14:04:02 CST 2014> <Info> <Messaging> <WL-282001> <The messaging kernel ClientSAFAgent0 is beginning recovery of its persistent state>
<Fri Mar 07 14:04:02 CST 2014> <Info> <Messaging> <WL-282002> <The messaging kernel ClientSAFAgent0 has recovered 1 persistent messages>
<Fri Mar 07 14:04:02 CST 2014> <Info> <Messaging> <WL-282003> <The messaging kernel ClientSAFAgent0 will use up to 22,216,704 bytes of memory before paging begins>
at weblogic.messaging.dispatcher.CrossDomainManager.ensureInitialized(CrossDomainManager.java:39)
at weblogic.messaging.dispatcher.CrossDomainManager.<clinit>(CrossDomainManager.java:17)
at weblogic.messaging.dispatcher.DispatcherManager.isLocal(DispatcherManager.java:123)
at weblogic.messaging.dispatcher.DispatcherManager.dispatcherAdd(DispatcherManager.java:219)
at weblogic.messaging.dispatcher.DispatcherManager.dispatcherCreate(DispatcherManager.java:212)
at weblogic.messaging.dispatcher.DispatcherManager.dispatcherFindOrCreate(DispatcherManager.java:68)
at weblogic.jms.dispatcher.JMSDispatcherManager.dispatcherFindOrCreate(JMSDispatcherManager.java:208)
at weblogic.jms.common.CDSLocalProxy.getRemoteDispatcher(CDSLocalProxy.java:277)
at weblogic.jms.common.CDSLocalProxy.access$100(CDSLocalProxy.java:32)
at weblogic.jms.common.CDSLocalProxy$2.run(CDSLocalProxy.java:158)
at weblogic.security.subject.SubjectProxy.doAs(SubjectProxy.java:89)
复制代码
看了weblogic报错地方的源码 ,将报错地方用到的类加载器和得到的类打印出来,发现类加载器是同一个,但是在tomcat跑起来是就提示找不到类,相当无语。。 下面是单独运行程序时的结果: Usage: java examples.jms.queue.SAFQueueSend <Fri Mar 07 14:11:39 CST 2014> <Info> <Store> <WL-280008> <Opening the persistent file store "SAFSTORE0V" for recovery: directory=D:\SAFCONFIG\stores\default requestedWritePolicy="Direct-Write" fileLockingEnabled=true driver="NIO".> <Fri Mar 07 14:11:39 CST 2014> <Info> <Store> <WL-280009> <The persistent file store "SAFSTORE0V" (ed7f4264-19e9-4c39-94e9-e45e0870c1df) has been opened: blockSize=512 actualWritePolicy="Direct-Write(single-handle-buffered)" explicitIOEnforced=false records=12.> <Fri Mar 07 14:11:39 CST 2014> <Info> <Messaging> <WL-282003> <The messaging kernel ClientSAFAgent0 will use up to 22,216,704 bytes of memory before paging begins> <Fri Mar 07 14:11:39 CST 2014> <Info> <Messaging> <WL-282001> <The messaging kernel ClientSAFAgent0 is beginning recovery of its persistent state> <Fri Mar 07 14:11:39 CST 2014> <Info> <Messaging> <WL-282002> <The messaging kernel ClientSAFAgent0 has recovered 1 persistent messages> <Fri Mar 07 14:11:39 CST 2014> <Info> <Messaging> <WL-282003> <The messaging kernel ClientSAFAgent0 will use up to 22,216,704 bytes of memory before paging begins> sun.misc.Launcher$AppClassLoader@1372a1a class weblogic.messaging.dispatcher.IIOPClientCrossDomainUtil
成功加载到该类,并成功与远程端点取得连接。
当考虑这个问题出在tomcat上,该用weblogic发布程序时,出现了另一个错误:
Usage: java examples.jms.queue.SAFQueueSend
javax.naming.NamingException: An attempt was made to create a SAF client on a WLS server [Root exception is javax.jms.JMSException: An attempt was made to create a SAF client on a WLS server]
at weblogic.jms.safclient.jndi.InitialContextFactoryImpl.getNamingException(InitialContextFactoryImpl.java:31)
at weblogic.jms.safclient.jndi.InitialContextFactoryImpl.getInitialContext(InitialContextFactoryImpl.java:126)
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:667)
复制代码
他说我试图在服务器上创建SAF客户端,看了一下报错的源码,有下面一段:
public static ClientSAF getClientSAF(File paramFile, InputStream paramInputStream)