[Security & JAAS/JBoss] - HTTPS Client auth from within JBoss
by stone_42
Hello,
I need to call a https secured web application from within JBoss. Establishing a https connection is no problem, but the web application I call requires client authentication and I did not manage to specify a certificate.
My code is as follows SSLContext context;
| KeyStore keystore = KeyStore.getInstance(KeyStore.getDefaultType());
| KeyStore truststore = KeyStore.getInstance(KeyStore
| .getDefaultType());
| char[] password = "secret".toCharArray();
| String keyStoreLocation = "META-INF/keystore";
| String trustStoreLocation = "META-INF/truststore";
| InputStream is = getClass().getResourceAsStream(keyStoreLocation);
| keystore.load(is, password);
| is = getClass().getResourceAsStream(trustStoreLocation);
| truststore.load(is, password.toCharArray());
| KeyManagerFactory kmf = KeyManagerFactory.getInstance("SunX509");
| kmf.init(keystore, password);
| TrustManagerFactory tmf = TrustManagerFactory
| .getInstance("SunX509");
| tmf.init(truststore);
|
| context = SSLContext.getInstance("TLS");
| context.init(kmf.getKeyManagers(), tmf.getTrustManagers(),
| new SecureRandom());
| HttpsURLConnection.setDefaultSSLSocketFactory(context
| .getSocketFactory());
|
| HttpsURLConnection conn = (HttpsURLConnection) new URL("https://...").openConnection();
| conn.connect();
| Certificate[] clientCerts = conn.getLocalCertificates();
| [...]
If I understand things right, the clientCerts array in my code should contain at least one element, but it is always empty.
Can anybody help me how to configure the certificates correctly?
Regards,
Martin
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4008251#4008251
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4008251
19 years, 2 months
[JBoss jBPM] - Deploying and running Jbpm / Drools Process
by warmonga
Hello,
I have a problem running a deployed Jbpm process that fires some Drools rules in an ActionHandler. When testing the process through the Jbpm API, it runs perfectly fine, though.
Unfortunately I could not find a helping hint for this issue on this forum or google.
The part of the Jpdl processs where the ActionHandler is invoked looks as follows:
| <task-node name="Receive Return">
| <task name="Receive Item" swimlane="Shipping">
| <controller>
| <variable name="tracking number" access="read"></variable>
| <variable name="number" access="read,write,required"></variable>
| </controller>
| </task>
| <event type="node-leave">
| <action name="Execute Shipping Rules" class="com.sample.action.FireRulesActionHandler">
| <rulefile>Sample.drl</rulefile>
| </action>
| </event>
| <transition name="" to="node1">
| </transition>
| </task-node>
|
As I said, when I execute the process through the Jbpm API, the process executes just fine, including the FireRulesActionHandler which fires all rules as it is supposed to. But when deploying the project to the server, it will deploy it, but during execution of the process, it would stop executing at that point where the ActionHandler is called. The server log looks as follows:
anonymous wrote :
| 11:33:04,385 DEBUG [GraphElement] event 'node-leave' on 'TaskNode(Receive Return
| )' for 'Token(/)'
| 11:33:04,395 DEBUG [GraphElement] executing action 'action[Execute Shipping Rule
| s]'
| 11:33:04,395 DEBUG [JbpmContext] closing JbpmContext
| 11:33:04,395 DEBUG [Services] closing service 'persistence': org.jbpm.persistenc
| e.db.DbPersistenceService@f6981a
| 11:33:04,395 DEBUG [DbPersistenceService] committing hibernate transaction
| 11:33:04,405 DEBUG [DbPersistenceService] closing hibernate session
| 11:33:04,405 DEBUG [Services] closing service 'logging': org.jbpm.logging.db.DbL
| oggingService@e4c30a
| 11:33:04,405 DEBUG [Services] closing service 'authentication': org.jbpm.securit
| y.authentication.DefaultAuthenticationService@c0fb53
| 11:33:04,405 ERROR [[FacesServlet]] Servlet.service() for servlet FacesServlet t
| hrew exception
| javax.faces.FacesException: Error calling action method of component with id tas
| kform:transitionButton
| at org.apache.myfaces.application.ActionListenerImpl.processAction(Actio
| nListenerImpl.java:74)
| at javax.faces.component.UICommand.broadcast(UICommand.java:106)
| at javax.faces.component.UIViewRoot._broadcastForPhase(UIViewRoot.java:9
| 0)
| at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1
| 64)
| at org.apache.myfaces.lifecycle.LifecycleImpl.invokeApplication(Lifecycl
| eImpl.java:271)
| at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java
| :86)
| at javax.faces.webapp.FacesServlet.service(FacesServlet.java:94)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
| icationFilterChain.java:252)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
| ilterChain.java:173)
| at org.jbpm.webapp.filter.AuthenticationFilter.doFilter(AuthenticationFi
| lter.java:56)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
| icationFilterChain.java:202)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
| ilterChain.java:173)
| at org.jbpm.web.JbpmContextFilter.doFilter(JbpmContextFilter.java:83)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
| icationFilterChain.java:202)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
| ilterChain.java:173)
| at org.jbpm.webapp.filter.LogFilter.doFilter(LogFilter.java:59)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
| icationFilterChain.java:202)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
| ilterChain.java:173)
| at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFi
| lter.java:81)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
| icationFilterChain.java:202)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
| ilterChain.java:173)
| at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV
| alve.java:213)
| at org.apache.catalina.core.StandardContextValve.invoke(StandardContextV
| alve.java:178)
| at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrinc
| ipalValve.java:39)
| at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(Securit
| yAssociationValve.java:159)
| at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValv
| e.java:59)
| at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j
| ava:126)
| at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j
| ava:105)
| at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVal
| ve.java:107)
| at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.jav
| a:148)
| at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java
| :856)
| at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.proce
| ssConnection(Http11Protocol.java:744)
| at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpo
| int.java:527)
| at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWor
| kerThread.java:112)
| at java.lang.Thread.run(Unknown Source)
| Caused by: javax.faces.el.EvaluationException: Exception while invoking expressi
| on #{taskBean.saveAndClose}
| at org.apache.myfaces.el.MethodBindingImpl.invoke(MethodBindingImpl.java
| :153)
| at org.apache.myfaces.application.ActionListenerImpl.processAction(Actio
| nListenerImpl.java:63)
| ... 34 more
| Caused by: java.lang.NoClassDefFoundError: org/drools/RuleBase
| at java.lang.Class.getDeclaredConstructors0(Native Method)
| at java.lang.Class.privateGetDeclaredConstructors(Unknown Source)
| at java.lang.Class.getConstructor0(Unknown Source)
| at java.lang.Class.newInstance0(Unknown Source)
| at java.lang.Class.newInstance(Unknown Source)
| at org.jbpm.instantiation.FieldInstantiator.newInstance(FieldInstantiato
| r.java:103)
| at org.jbpm.instantiation.FieldInstantiator.instantiate(FieldInstantiato
| r.java:48)
| at org.jbpm.instantiation.Delegation.instantiate(Delegation.java:163)
| at org.jbpm.instantiation.Delegation.getInstance(Delegation.java:125)
| at org.jbpm.instantiation.Delegation$$FastClassByCGLIB$$6bae1598.invoke(
| )
| at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)
| at org.hibernate.proxy.CGLIBLazyInitializer.intercept(CGLIBLazyInitializ
| er.java:136)
| at org.jbpm.instantiation.Delegation$$EnhancerByCGLIB$$3c64f0ee.getInsta
| nce()
| at org.jbpm.graph.def.Action.execute(Action.java:122)
| at org.jbpm.graph.def.GraphElement.executeAction(GraphElement.java:235)
| at org.jbpm.graph.def.GraphElement.executeActions(GraphElement.java:212)
|
| at org.jbpm.graph.def.GraphElement.fireAndPropagateEvent(GraphElement.ja
| va:182)
| at org.jbpm.graph.def.GraphElement.fireEvent(GraphElement.java:166)
| at org.jbpm.graph.def.Node.leave(Node.java:371)
| at org.jbpm.graph.node.TaskNode.leave(TaskNode.java:198)
| at org.jbpm.graph.def.Node$$FastClassByCGLIB$$d187eeda.invoke()
| at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)
| at org.hibernate.proxy.CGLIBLazyInitializer.intercept(CGLIBLazyInitializ
| er.java:136)
| at org.jbpm.graph.def.Node$$EnhancerByCGLIB$$56174330.leave()
|
| at org.jbpm.graph.exe.Token.signal(Token.java:178)
| at org.jbpm.graph.exe.Token.signal(Token.java:123)
| at org.jbpm.graph.exe.Token$$FastClassByCGLIB$$74df1c6e.invoke(<generate
| d>)
| at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)
| at org.hibernate.proxy.CGLIBLazyInitializer.intercept(CGLIBLazyInitializ
| er.java:136)
| at org.jbpm.graph.exe.Token$$EnhancerByCGLIB$$e6e7aac4.signal()
| at org.jbpm.taskmgmt.exe.TaskInstance.end(TaskInstance.java:441)
| at org.jbpm.taskmgmt.exe.TaskInstance.end(TaskInstance.java:355)
| at org.jbpm.taskmgmt.exe.TaskInstance$$FastClassByCGLIB$$cb2c21af.invoke
| ()
| at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)
| at org.hibernate.proxy.CGLIBLazyInitializer.intercept(CGLIBLazyInitializ
| er.java:136)
| at org.jbpm.taskmgmt.exe.TaskInstance$$EnhancerByCGLIB$$fed0bc85.end(<ge
| nerated>)
| at org.jbpm.webapp.bean.TaskBean.saveAndClose(TaskBean.java:178)
| at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
| at java.lang.reflect.Method.invoke(Unknown Source)
| at org.apache.myfaces.el.MethodBindingImpl.invoke(MethodBindingImpl.java
| :129)
| ... 35 more
| 11:33:06,618 DEBUG [JbpmContextInfo] creating jbpm context with service factorie
| s '[message, scheduler, logging, persistence, authentication]'
| 11:33:06,618 DEBUG [JbpmContext] creating JbpmContext
| 11:33:06,618 DEBUG [StaticNotifier] woke up
| 11:33:06,628 DEBUG [DbPersistenceServiceFactory] creating persistence service
| 11:33:06,628 DEBUG [DbPersistenceService] creating hibernate session
|
I guess the line anonymous wrote : Caused by: java.lang.NoClassDefFoundError: org/drools/RuleBase
is the essential one. Probably it's a problem concerning jar - files. But unfortunately I don't know which jar files are missing and how to include the missing jar files then. I am using the Jbpm server that came with the "jbpm-starters-kit-3.1.3".
I appreciate any hint that could help me to solve this problem. Many thanks in advance!
Best regards,
Maurice
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4008250#4008250
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4008250
19 years, 2 months
[Installation, Configuration & Deployment] - Empty server.log when booting
by idickinson
I've recently installed JBoss 4.0.4GA onto an FC5 machine via JPackage. When I try to start the jboss4 service ('service jboss4 start'), I get a message
Starting jboss4: [FAILED]
Process crashed on startup
>From server.log it looked to be a problem with hsql, so I ensured that hsql was working ok, then, to try to minimise the noise, I deleted /var/log/jboss4/default/server.log before trying again, thinking that jboss would recreate the log file when it booted up. Now, I'm getting nothing at all written to that file when I try to start jboss (which is still failing with the error above).
What would cause JBoss not to write anything at all to server.log? I've tried touching the server.log file to see if that kick starts the logging process, but nothing doing. I emphasise that I didn't change the JBoss configuration at all, only rm'ed server.log.
Any help appreciated!
Ian
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4008248#4008248
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4008248
19 years, 2 months