-
1. Re: Restarting https connector in Jboss 7?
nickarls Dec 16, 2011 1:33 AM (in response to knightride12)1 of 1 people found this helpfulHaven't tried what it actually does but I noticed that if you use the CLI you can remove the connector and re-create this and the outcomes are "success" without "reload required" so perhaps it might to the job(?)
-
2. Re: Restarting https connector in Jboss 7?
knightride12 Dec 20, 2011 12:49 PM (in response to nickarls)Hi Nicklas,
Thanks for the reply. I have been playing around with the CLI to understand the possibilities and it seems like I would need to recreate the connector and all of its properties everytime I do a remove, is this correct? This would be tedious as I would have to re-specify the keystore, truststore, etc. everytime I do the create. I'm wondering if it's possible to just reload the connector? Also, I would like to do this programmatically if possible.
-
3. Re: Restarting https connector in Jboss 7?
rhusar Dec 22, 2011 7:43 AM (in response to knightride12)Yeah, looks like there is no reload only on the conenctor. I wonder if its typical usecase having to reload that data. If it is, it might be considered to add that functionality.
Actually, have you considered using :reload operation? I think thats would come in handy for you:
[standalone@localhost:9999 /] :read-operation-description(name=reload)
{
"outcome" => "success",
"result" => {
"operation-name" => "reload",
"description" => "Reloads the server by shutting down all its services and starting again. The JVM itself is not restarted.",
Otherwise, writing a script to remove and add again is not that bad, you can do a CLI batch and run it from shell (or use from Java or REST).
[standalone@localhost:9999 connector=http] :read-operation-names
{
"outcome" => "success",
"result" => [
"add",
"read-attribute",
"read-children-names",
"read-children-resources",
"read-children-types",
"read-operation-description",
"read-operation-names",
"read-resource",
"read-resource-description",
"remove",
"undefine-attribute",
"validate-address",
"write-attribute"
]
}
HTH,
Rado
-
4. Re: Restarting https connector in Jboss 7?
knightride12 Jan 10, 2012 8:26 PM (in response to rhusar)Hi Rado,
Thanks for the reply but I don't really want to do a reload operation as this will actually try to reload the whole JBoss AS. I was able to make some progress using the DMR ModelControllerClient to remove and re-add the connector but now I'm facing a different issue. Here's the sequence that I'm seeing:
1. Web client calls a certificate registration method to register a certificate into the truststore.
2. Web service registers the new certificate into truststore and then use ModelControllerClient to remove and re-add https connector. Control is then returned back to web client.
3. Web client goes on to call next request and this results in NPE thrown in Jboss. In the Jboss console log I get this:
16:46:24,079 ERROR [org.apache.catalina.connector.CoyoteAdapter] (http--0.0.0.0-8444-1) An exception or error occurred in the container during the request processing: java.lang.NullPointerException
at org.apache.catalina.connector.CoyoteAdapter.postParseRequest(CoyoteAdapter.java:524) [jbossweb-7.0.0.CR4.jar:7.0.0.Final]
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:359) [jbossweb-7.0.0.CR4.jar:7.0.0.Final]
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877) [jbossweb-7.0.0.CR4.jar:7.0.0.Final]
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:667) [jbossweb-7.0.0.CR4.jar:7.0.0.Final]
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:951) [jbossweb-7.0.0.CR4.jar:7.0.0.Final]
at java.lang.Thread.run(Thread.java:662) [:1.6.0_27]On the web service client side I get this:
javax.xml.ws.WebServiceException: No Content-type in the header!
at com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.process(HttpTransportPipe.java:172)
at com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.processRequest(HttpTransportPipe.java:83)
at com.sun.xml.internal.ws.transport.DeferredTransportPipe.processRequest(DeferredTransportPipe.java:78)
at com.sun.xml.internal.ws.api.pipe.Fiber.__doRun(Fiber.java:587)
at com.sun.xml.internal.ws.api.pipe.Fiber._doRun(Fiber.java:546)
at com.sun.xml.internal.ws.api.pipe.Fiber.doRun(Fiber.java:531)
at com.sun.xml.internal.ws.api.pipe.Fiber.runSync(Fiber.java:428)
at com.sun.xml.internal.ws.client.Stub.process(Stub.java:211)
at com.sun.xml.internal.ws.client.sei.SEIStub.doProcess(SEIStub.java:124)
at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:98)
at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:78)
at com.sun.xml.internal.ws.client.sei.SEIStub.invoke(SEIStub.java:107)
at $Proxy31.setContext(Unknown Source)Strange thing is, if I make my web client wait 5 seconds between the call to register the certificate and the next request then everything works fine. If the web client immediately calls a request after the registration then I get the exception above. Anyone have any idea what's going on here? Seems like removing and re-adding the connector had some impact on the web client. In a production environment we can not force the web client to wait some time between requests. While looking for alternative means to restart the connector I happen to see an Http11Connector object that has the start/stop methods. I'm wondering if anyone knows how to get a reference to the Http11Connector objects? Thanks for the help.
-
5. Re: Restarting https connector in Jboss 7?
knightride12 Jan 23, 2012 8:36 PM (in response to knightride12)Hi All,
Hope this is of some use. I actually found a way to tell Jboss 7.0.0 to register the connector MBeans so that you can reload the connectors. To enable the MBean registration you will need to include the system argument org.apache.tomcat.util.ENABLE_MODELER and set this to true when starting up Jboss. This can be done by adding the property "<property name="org.apache.tomcat.util.ENABLE_MODELER" value="true"/>" in the system-properties of the standalone.xml configuration file. After this is set the connector MBeans will be registered and you can use the MBeanServer to query for the appropriate connector and reload it. Not sure if this has changed in later Jboss versions.