Help regarding Guvnor 5.0 integration in secured application (https protocol)
by Swapnil Sawant
Hi,
I am implementing drools 5.0(Guvnor GUI) in my application (protocol for same is https)
For this purpose , I have set up drools 5.0 framework code needed to run the rules from my application. Also, I have integrated Guvnor GUi code inside my application itself.
While doing implementation, inside changeset.xml file I have written following code :
<change-set xmlns='http://drools.org/drools-5.0/change-set'
xmlns:xs='http://www.w3.org/2001/XMLSchema-instance'
xs:schemaLocation='http://drools.org/drools-5.0/change-set drools-change-set-5.0.xsd' >
<add>
<resource source='https://localhost:8441/drools-guvnor/org.drools.guvnor.Guvnor/package/Pay...' type='DRL' />//as I have integrated Guvnor GUI in my secured app
</add>
</change-set>
I have created a simple rule using Guvnor GUI (GUI code inside my application). When I run the same rule from my business layer, I get following security exception :
Message: Service [ruleService] target threw an unexpected exception (javax.net.ssl.SSLHandshakeException: sun.security.va
lidator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable
to find valid certification path to requested target)
---- cause ---------------------------------------------------------------------
Exception: java.lang.RuntimeException
Message: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.s
ecurity.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
Then I changed the "changeset.xml" as follows :
<resource source='http://localhost:8441/drools-guvnor/org.drools.guvnor.Guvnor/package/Payr...' type='DRL' />
This time when I run the same rule , I got following error :
[2010:08:214 10:08:319:debug] ResourceChangeScanner subcribing notifier=org.drools.io.impl.ResourceChangeNotifierImpl@c40
88a to resource=[UrlResource path='http://localhost:8441/drools-guvnor/org.drools.guvnor.Guvnor/package/defa...
TEST.drl']
[2010:08:214 10:08:319:debug] KnowledgeAgent ChangeSet requires KnowledgeBuilder
[2010:08:214 10:08:319:debug] KnowledgeAgent rebuilding KnowledgeBase using ChangeSet
2010-08-02 10:53:34,615 (http-0.0.0.0-8441-2) [ ServiceDispatcher.java:515:INFO ] [[Sync service failed...- total:0.0,si
nce last(Begin):0.0]] - 'payroll / ruleService'
2010-08-02 10:53:34,615 (http-0.0.0.0-8441-2) [ TransactionUtil.java:344:INFO ] [TransactionUtil.rollback] transaction
rolled back
2010-08-02 10:53:34,615 (http-0.0.0.0-8441-2) [ TransactionUtil.java:269:WARN ] [TransactionUtil.commit] Not committin
g transaction, status is No Transaction (6)
2010-08-02 10:53:34,615 (http-0.0.0.0-8441-2) [ServiceEventHandler.java:352:ERROR]
---- exception report ----------------------------------------------------------
Service invocation error
Exception: org.ofbiz.service.GenericServiceException
Message: Service [ruleService] target threw an unexpected exception (java.net.SocketException: Unexpected end of file fro
m server)
---- cause ---------------------------------------------------------------------
Exception: java.lang.RuntimeException
Message: java.net.SocketException: Unexpected end of file from server
---- cause ---------------------------------------------------------------------
Exception: java.net.SocketException
Message: Unexpected end of file from server
---- stack trace ---------------------------------------------------------------
java.net.SocketException: Unexpected end of file from server
sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:769)
sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:632)
sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:766)
sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:632)
sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1000)
Finally, I tried deploying same rule on "Guvnor 5.0 GUI on my separate tomcat server(outside my secured app) ". When I give the "drl path" of this codebase on my separate Tomcat inside my changset.xml, things work fine.
I have a doubt as to is the error coming as I am trying to access a "https" url as "http" ?
Can any one pl help me in this regard. Any help of yours would be great help.Thanks in advance.
Regards,
Swapnil Sawant
________________________________
This Email may contain confidential or privileged information for the intended recipient (s) If you are not the intended recipient, please do not use or disseminate the information, notify the sender and delete it from your system.
______________________________________________________________________
15 years, 10 months
Re: [rules-users] Possible concurrency issue in Drools
by Norman C
All,
Just wanted to mention, I'm using version 5.0.1 of Drools.
Thanks,
Norman
________________________________
From: Norman C <rent_my_time(a)yahoo.com>
To: rules-users(a)lists.jboss.org
Sent: Sat, July 31, 2010 9:50:19 PM
Subject: Possible concurrency issue in Drools
Hi All,
I recently ran into an issue which I believe might point to a concurrency
issue. My server stopped processing new requests, so I did a thread dump. In
examining the dump, I found that all of the processing threads, save two, were
blocking while trying to acquire the lock in NamedEntryPoint.insert. Both of
the other two threads appeared to be infinitely looping in the
NamedEntryPoint.insert method. Here are snippets of the stack traces:
ActiveMQ Session Task" prio=10 tid=0x00002aab0003b000 nid=0x7b98 runnable
[0x000000004c086000..0x000000004c087c90] java.lang.Thread.State: RUNNABLE
at org.drools.util.ObjectHashMap.remove(ObjectHashMap.java:121) at
org.drools.common.SingleThreadedObjectStore.removeHandle(SingleThreadedObjectStore.java:150)
at org.drools.common.NamedEntryPoint.retract(NamedEntryPoint.java:296)
at org.drools.common.NamedEntryPoint.retract(NamedEntryPoint.java:245) at
org.drools.reteoo.ReteooWorkingMemory$WorkingMemoryReteExpireAction.execute(ReteooWorkingMemory.java:350)
at
org.drools.common.AbstractWorkingMemory.executeQueuedActions(AbstractWorkingMemory.java:1488)
at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:158)
at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:122) at
org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:80) at
org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:28) at
ActiveMQ Session Task" prio=10 tid=0x000000005a35cc00 nid=0xdf6 runnable
[0x000000004a268000..0x000000004a269a90] java.lang.Thread.State: RUNNABLE
at org.drools.util.AbstractHashTable.resize(AbstractHashTable.java:115) at
org.drools.util.ObjectHashMap.put(ObjectHashMap.java:78) at
org.drools.common.SingleThreadedObjectStore.addHandle(SingleThreadedObjectStore.java:136)
at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:113)
at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:80) at
org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:28) at
So it seems like one while the first thread is holding the lock and is
attempting to remove an object handle from the object store in NamedEntryPoint,
the other thread is trying to resize that same object store in response to an
addHandle call that puts it over the threshold. I haven't worked out exactly
how these concurrent accesses to the same object store by two different threads
causes an infinite loop in both threads, but it seems like the call to
SingleThreadedObjectStore.addHandle should be preceded by acquiring the lock.
Is this correct? I can imagine that resizing a large hash map could potentially
take a long time and thus synchronizing this call could impact performance, but
somehow, the action of resizing the table must be protected in some way from
adversely impacting other operations on the table.
Any help would be appreciated.
thanks,
Norman
15 years, 11 months
Possible concurrency issue in Drools
by Norman C
Hi All,
I recently ran into an issue which I believe might point to a concurrency
issue. My server stopped processing new requests, so I did a thread dump. In
examining the dump, I found that all of the processing threads, save two, were
blocking while trying to acquire the lock in NamedEntryPoint.insert. Both of
the other two threads appeared to be infinitely looping in the
NamedEntryPoint.insert method. Here are snippets of the stack traces:
ActiveMQ Session Task" prio=10 tid=0x00002aab0003b000 nid=0x7b98 runnable
[0x000000004c086000..0x000000004c087c90] java.lang.Thread.State: RUNNABLE
at org.drools.util.ObjectHashMap.remove(ObjectHashMap.java:121) at
org.drools.common.SingleThreadedObjectStore.removeHandle(SingleThreadedObjectStore.java:150)
at org.drools.common.NamedEntryPoint.retract(NamedEntryPoint.java:296)
at org.drools.common.NamedEntryPoint.retract(NamedEntryPoint.java:245) at
org.drools.reteoo.ReteooWorkingMemory$WorkingMemoryReteExpireAction.execute(ReteooWorkingMemory.java:350)
at
org.drools.common.AbstractWorkingMemory.executeQueuedActions(AbstractWorkingMemory.java:1488)
at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:158)
at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:122) at
org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:80) at
org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:28) at
ActiveMQ Session Task" prio=10 tid=0x000000005a35cc00 nid=0xdf6 runnable
[0x000000004a268000..0x000000004a269a90] java.lang.Thread.State: RUNNABLE
at org.drools.util.AbstractHashTable.resize(AbstractHashTable.java:115) at
org.drools.util.ObjectHashMap.put(ObjectHashMap.java:78) at
org.drools.common.SingleThreadedObjectStore.addHandle(SingleThreadedObjectStore.java:136)
at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:113)
at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:80) at
org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:28) at
So it seems like one while the first thread is holding the lock and is
attempting to remove an object handle from the object store in NamedEntryPoint,
the other thread is trying to resize that same object store in response to an
addHandle call that puts it over the threshold. I haven't worked out exactly
how these concurrent accesses to the same object store by two different threads
causes an infinite loop in both threads, but it seems like the call to
SingleThreadedObjectStore.addHandle should be preceded by acquiring the lock.
Is this correct? I can imagine that resizing a large hash map could potentially
take a long time and thus synchronizing this call could impact performance, but
somehow, the action of resizing the table must be protected in some way from
adversely impacting other operations on the table.
Any help would be appreciated.
thanks,
Norman
15 years, 11 months