JDiameter and SCTP throw SCTPManagement exception

381 views Asked by At

I am trying to build an application that provides an S6 endpoint over SCTP. I am currently using jDiameter 1.7.0-SNAPSHOT and SCTP 1.5.0, bundled in an EAR that gets deployed to wildfly 8. I already tried with 1.6.0.Final, but have the same effect.

If I include a jboss-beans.xml to initialize the SCTPManagement, I get an initialization error JBAS...: Null value

If I don't use the jboss-beans, I get a FileNotFound Exception and later on the error that it could not create a server socket. (But it looks like the real origin is the FileNotFound Exception for the SCTP Rule file).

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]).

As I have seen in the jss7 application, it looks like initialization via jboss-beans would be the preferred way, but this one does not work:

<?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>

It works neither with maxIOErrors and workerThreads nor without. Am I missing something ?

1

There are 1 answers

0
mbauer On

Just in case anyone runs into the same problem.

The reason is, that newer JBoss/Wildfly version can't access all JDK classes automatically.

If you want to access the com.sun.nio classes, you have to add a jboss-deployment-structure granting it to access the required packages.

This works although initializing via jboss-beans.xml still does not work. (I removed the file, so now the Stack starts up)