RestComm / jss7

RestComm Java SS7 Stack and Services
http://www.restcomm.com/
GNU Affero General Public License v3.0
178 stars 218 forks source link

Fix jolokia java.lang.IllegalArgumentException #217

Closed romangb closed 7 years ago

romangb commented 7 years ago

Fix jolokia java.lang.IllegalArgumentException : Cannot convert string to appropiate object when from gui interface trying to configure jss7 stack

vetss commented 7 years ago

Hello @wrongt

1) can you please read THE TELESTAX OPEN SOURCE PLAYBOOK: https://telestax.com/open-source/#Contribute and sign Contributor License Agreement That is needed if you want to contribute JSS7 projects.

2) I see you want to change interfaces to "String" values. I made some GUI testing but current implemetation works for me. Can you please provide some test actin that fails so I can rechek at my side ?

romangb commented 7 years ago

Hello @vetss , i have configure jss7 stack on wildfly 10.1 app server, and when form web interface i try to add new SCTP server i get this response when click create button:

curl -s "http://127.0.0.1:8080/jolokia/exec/org.mobicents.ss7%3Alayer%3DSCTP%2Ctype%3DManagement%2Cname%3DSCTPManagement/addSctpServer/server2/127.0.0.1/4010/TCP/false/0/%22%22"

{"request":{"mbean":"org.mobicents.ss7:layer=SCTP,name=SCTPManagement,type=Management","arguments":["server2","127.0.0.1","4010","TCP","false","0",""],"type":"exec","operation":"addSctpServer"},"stacktrace":"java.lang.IllegalArgumentException: Cannot convert string TCP to type org.mobicents.protocols.api.IpChannelType because no converter could be found\n\tat org.jolokia.converter.object.StringToObjectConverter.convertFromString(StringToObjectConverter.java:223)\n\tat org.jolokia.converter.object.StringToObjectConverter.prepareValue(StringToObjectConverter.java:114)\n\tat org.jolokia.handler.ExecHandler.doHandleRequest(ExecHandler.java:93)\n\tat org.jolokia.handler.ExecHandler.doHandleRequest(ExecHandler.java:40)\n\tat org.jolokia.handler.JsonRequestHandler.handleRequest(JsonRequestHandler.java:89)\n\tat org.jolokia.backend.MBeanServerExecutorLocal.handleRequest(MBeanServerExecutorLocal.java:109)\n\tat org.jolokia.backend.MBeanServerHandler.dispatchRequest(MBeanServerHandler.java:159)\n\tat org.jolokia.backend.LocalRequestDispatcher.dispatchRequest(LocalRequestDispatcher.java:99)\n\tat org.jolokia.backend.BackendManager.callRequestDispatcher(BackendManager.java:413)\n\tat org.jolokia.backend.BackendManager.handleRequest(BackendManager.java:158)\n\tat org.jolokia.http.HttpRequestHandler.executeRequest(HttpRequestHandler.java:197)\n\tat org.jolokia.http.HttpRequestHandler.handleGetRequest(HttpRequestHandler.java:86)\n\tat org.jolokia.http.AgentServlet$4.handleRequest(AgentServlet.java:430)\n\tat org.jolokia.http.AgentServlet.handleSecurely(AgentServlet.java:301)\n\tat org.jolokia.http.AgentServlet.handle(AgentServlet.java:277)\n\tat org.jolokia.http.AgentServlet.doGet(AgentServlet.java:237)\n\tat javax.servlet.http.HttpServlet.service(HttpServlet.java:687)\n\tat javax.servlet.http.HttpServlet.service(HttpServlet.java:790)\n\tat io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:85)\n\tat io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:62)\n\tat io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36)\n\tat org.wildfly.extension.undertow.security.SecurityContextAssociationHandler.handleRequest(SecurityContextAssociationHandler.java:78)\n\tat io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)\n\tat io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:131)\n\tat io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:57)\n\tat io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)\n\tat io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:46)\n\tat io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:64)\n\tat io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:60)\n\tat io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:77)\n\tat io.undertow.security.handlers.NotificationReceiverHandler.handleRequest(NotificationReceiverHandler.java:50)\n\tat io.undertow.security.handlers.AbstractSecurityContextAssociationHandler.handleRequest(AbstractSecurityContextAssociationHandler.java:43)\n\tat io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)\n\tat org.wildfly.extension.undertow.security.jacc.JACCContextIdHandler.handleRequest(JACCContextIdHandler.java:61)\n\tat io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)\n\tat io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)\n\tat io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:292)\n\tat io.undertow.servlet.handlers.ServletInitialHandler.access$100(ServletInitialHandler.java:81)\n\tat io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:138)\n\tat io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:135)\n\tat io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.java:48)\n\tat io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43)\n\tat io.undertow.servlet.api.LegacyThreadSetupActionWrapper$1.call(LegacyThreadSetupActionWrapper.java:44)\n\tat io.undertow.servlet.api.LegacyThreadSetupActionWrapper$1.call(LegacyThreadSetupActionWrapper.java:44)\n\tat io.undertow.servlet.api.LegacyThreadSetupActionWrapper$1.call(LegacyThreadSetupActionWrapper.java:44)\n\tat io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:272)\n\tat io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:81)\n\tat io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:104)\n\tat io.undertow.server.Connectors.executeRootHandler(Connectors.java:202)\n\tat io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:805)\n\tat java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)\n\tat java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)\n\tat java.lang.Thread.run(Thread.java:745)\n","error_type":"java.lang.IllegalArgumentException","error":"java.lang.IllegalArgumentException : Cannot convert string TCP to type org.mobicents.protocols.api.IpChannelType because no converter could be found","status":400} and to exclude the IllegalArgumentException one of the solution is to change interface method argument type to String.

vetss commented 7 years ago

Hello @wrongt

ok, this affects only for WilfFly server, thanks for bug report. For WildFly server we provided updates in https://github.com/RestComm/jss7/issues/210

Can you please sign Contributor License Agreement so we can accept a PR.

deruelle commented 7 years ago

@wrongt were you able to sign the Contributor License Agreement at https://telestax.com/open-source/#Contribute so we can accept the contribution ?

romangb commented 7 years ago

sure, already done.

vetss commented 7 years ago

Hello @wrongt

Thanks for your update. I have added your update into master and non-netty branches. This update will be available for work with WilfFly server when we merge jain-slee-3.x brances into master / non-netty branches.

This is a fix: https://github.com/RestComm/jss7/commit/b2439b26a28b319c7b524eb653a82df3ab767492