我正在尝试构建一个通过 SCTP 提供 S6 端点的应用程序。我目前正在使用 jDiameter 1.7.0-SNAPSHOT 和 SCTP 1.5.0,捆绑在部署到 Wildfly 8 的 EAR 中。我已经尝试过 1.6.0.Final,但效果相同。
如果我包含一个 jboss-beans.xml 来初始化 SCTPManagement,我会收到一个初始化错误 JBAS...: Null value
如果我不使用 jboss-beans,我会收到 FileNotFound 异常,然后会出现无法创建服务器套接字的错误。(但看起来真正的起源是 SCTP 规则文件的 FileNotFound 异常)。
Error while persisting the Rule state in file: java.io.FileNotFoundException: (No such file or directory)
at java.io.FileOutputStream.open0(Native Method) [rt.jar:1.8.0_45]
at java.io.FileOutputStream.open(FileOutputStream.java:270) [rt.jar:1.8.0_45]
at java.io.FileOutputStream.<init>(FileOutputStream.java:213) [rt.jar:1.8.0_45]
at java.io.FileOutputStream.<init>(FileOutputStream.java:101) [rt.jar:1.8.0_45]
at org.mobicents.protocols.sctp.ManagementImpl.store(ManagementImpl.java:431) [sctp-impl-1.5.0.FINAL.jar:1.5.0.FINAL]
at org.mobicents.protocols.sctp.ManagementImpl.setSingleThread(ManagementImpl.java:208) [sctp-impl-1.5.0.FINAL.jar:1.5.0.FINAL]
at org.jdiameter.server.impl.io.sctp.SCTPTransportServer.startServer(SCTPTransportServer.java:136) [jdiameter-impl-1.6.0.FINAL.jar:1.6.0.FINAL]
at org.jdiameter.server.impl.io.sctp.SCTPServerConnection.<init>(SCTPServerConnection.java:80) [jdiameter-impl-1.6.0.FINAL.jar:1.6.0.FINAL]
at org.jdiameter.server.impl.io.sctp.NetworkGuard.<init>(NetworkGuard.java:76) [jdiameter-impl-1.6.0.FINAL.jar:1.6.0.FINAL]
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) [rt.jar:1.8.0_45]
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) [rt.jar:1.8.0_45]
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) [rt.jar:1.8.0_45]
at java.lang.reflect.Constructor.newInstance(Constructor.java:422) [rt.jar:1.8.0_45]
at org.jdiameter.server.impl.io.TransportLayerFactory.createNetworkGuard(TransportLayerFactory.java:143) [jdiameter-impl-1.6.0.FINAL.jar:1.6.0.FINAL]
at org.jdiameter.server.impl.MutablePeerTableImpl.createNetworkGuard(MutablePeerTableImpl.java:397) [hss-ejb-DYNAMIC-SNAPSHOT.jar:]
at org.jdiameter.server.impl.MutablePeerTableImpl.start(MutablePeerTableImpl.java:352) [hss-ejb-DYNAMIC-SNAPSHOT.jar:]
at org.jdiameter.client.impl.StackImpl.startPeerManager(StackImpl.java:246) [jdiameter-impl-1.6.0.FINAL.jar:1.6.0.FINAL]
at org.jdiameter.client.impl.StackImpl.start(StackImpl.java:189) [jdiameter-impl-1.6.0.FINAL.jar:1.6.0.FINAL]
at com.nokia.whispernet.impl.S6aEndpointBean.init(S6aEndpointBean.java:70) [hss-ejb-DYNAMIC-SNAPSHOT.jar:]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.8.0_45]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) [rt.jar:1.8.0_45]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.8.0_45]
at java.lang.reflect.Method.invoke(Method.java:497) [rt.jar:1.8.0_45]
at org.jboss.as.ee.component.ManagedReferenceLifecycleMethodInterceptor.processInvocation(ManagedReferenceLifecycleMethodInterceptor.java:96)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
at org.jboss.invocation.WeavedInterceptor.processInvocation(WeavedInterceptor.java:53)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
at org.jboss.as.weld.ejb.Jsr299BindingsInterceptor.doLifecycleInterception(Jsr299BindingsInterceptor.java:114) [wildfly-weld-8.2.0.Final.jar:8.2.0.Final]
at org.jboss.as.weld.ejb.Jsr299BindingsInterceptor.processInvocation(Jsr299BindingsInterceptor.java:103) [wildfly-weld-8.2.0.Final.jar:8.2.0.Final]
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
at org.jboss.invocation.InterceptorContext$Invocation.proceed(InterceptorContext.java:407)
at org.jboss.weld.ejb.AbstractEJBRequestScopeActivationInterceptor.aroundInvoke(AbstractEJBRequestScopeActivationInterceptor.java:55) [weld-core-impl-2.2.6.Final.jar:2014-10-03 10:05]
at org.jboss.as.weld.ejb.EjbRequestScopeActivationInterceptor.processInvocation(EjbRequestScopeActivationInterceptor.java:83) [wildfly-weld-8.2.0.Final.jar:8.2.0.Final]
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
at org.jboss.as.weld.injection.WeldInjectionInterceptor.processInvocation(WeldInjectionInterceptor.java:53) [wildfly-weld-8.2.0.Final.jar:8.2.0.Final]
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
at org.jboss.as.ee.component.ManagedReferenceFieldInjectionInterceptorFactory$ManagedReferenceFieldInjectionInterceptor.processInvocation(ManagedReferenceFieldInjectionInterceptorFactory.java:109)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
at org.jboss.invocation.WeavedInterceptor.processInvocation(WeavedInterceptor.java:53)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
at org.jboss.as.ee.component.AroundConstructInterceptorFactory$1.processInvocation(AroundConstructInterceptorFactory.java:28)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
at org.jboss.as.weld.injection.WeldInterceptorInjectionInterceptor.processInvocation(WeldInterceptorInjectionInterceptor.java:56) [wildfly-weld-8.2.0.Final.jar:8.2.0.Final]
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
at org.jboss.as.weld.ejb.Jsr299BindingsCreateInterceptor.processInvocation(Jsr299BindingsCreateInterceptor.java:94) [wildfly-weld-8.2.0.Final.jar:8.2.0.Final]
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
at org.jboss.as.ee.component.NamespaceContextInterceptor.processInvocation(NamespaceContextInterceptor.java:50)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInOurTx(CMTTxInterceptor.java:273) [wildfly-ejb3-8.2.0.Final.jar:8.2.0.Final]
at org.jboss.as.ejb3.tx.CMTTxInterceptor.requiresNew(CMTTxInterceptor.java:369) [wildfly-ejb3-8.2.0.Final.jar:8.2.0.Final]
at org.jboss.as.ejb3.tx.LifecycleCMTTxInterceptor.processInvocation(LifecycleCMTTxInterceptor.java:66) [wildfly-ejb3-8.2.0.Final.jar:8.2.0.Final]
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
at org.jboss.as.weld.injection.WeldInjectionContextInterceptor.processInvocation(WeldInjectionContextInterceptor.java:43) [wildfly-weld-8.2.0.Final.jar:8.2.0.Final]
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
at org.jboss.as.ejb3.component.interceptors.CurrentInvocationContextInterceptor.processInvocation(CurrentInvocationContextInterceptor.java:41) [wildfly-ejb3-8.2.0.Final.jar:8.2.0.Final]
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
at org.jboss.as.ee.concurrent.ConcurrentContextInterceptor.processInvocation(ConcurrentContextInterceptor.java:45) [wildfly-ee-8.2.0.Final.jar:8.2.0.Final]
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
at org.jboss.invocation.ContextClassLoaderInterceptor.processInvocation(ContextClassLoaderInterceptor.java:64)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
at org.jboss.invocation.InterceptorContext.run(InterceptorContext.java:326)
at org.jboss.invocation.PrivilegedWithCombinerInterceptor.processInvocation(PrivilegedWithCombinerInterceptor.java:80)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)
at org.jboss.as.ee.component.BasicComponent.constructComponentInstance(BasicComponent.java:160)
at org.jboss.as.ee.component.BasicComponent.constructComponentInstance(BasicComponent.java:133)
at org.jboss.as.ee.component.BasicComponent.createInstance(BasicComponent.java:89)
at org.jboss.as.ejb3.component.singleton.SingletonComponent.getComponentInstance(SingletonComponent.java:122) [wildfly-ejb3-8.2.0.Final.jar:8.2.0.Final]
at org.jboss.as.ejb3.component.singleton.SingletonComponent.start(SingletonComponent.java:137) [wildfly-ejb3-8.2.0.Final.jar:8.2.0.Final]
at org.jboss.as.ee.component.ComponentStartService$1.run(ComponentStartService.java:54)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [rt.jar:1.8.0_45]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) [rt.jar:1.8.0_45]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [rt.jar:1.8.0_45]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [rt.jar:1.8.0_45]
at java.lang.Thread.run(Thread.java:745) [rt.jar:1.8.0_45]
at org.jboss.threads.JBossThread.run(JBossThread.java:122)
Unable to create server socket for LocalPeer 'hss.something.com' at 127.0.0.1:33000 (com.sun.nio.sctp.AssociationChangeNotification from [Module "deployment.hss-ear-DYNAMIC-SNAPSHOT.ear:main" from Service Module Loader]).
正如我在 jss7 应用程序中看到的那样,通过 jboss-beans 进行初始化似乎是首选方式,但这种方式不起作用:
<?xml version="1.0" encoding="UTF-8"?>
<bean name="SCTPManagement" class="org.mobicents.protocols.sctp.ManagementImpl">
<constructor>
<parameter>SCTPManagement</parameter>
</constructor>
<property name="persistDir">/tmp/</property>
<property name="singleThread">true</property>
<property name="connectDelay">30000</property>
<property name="workerThreads">10</property>
<property name="maxIOErrors">100</property>
</bean>
它既不适用于 maxIOErrors 和 workerThreads,也不适用于没有。我错过了什么吗?