[JBoss JIRA] (AS7-5970) RichFaces Showcase portlet is unable to switch skins
by Ken Finnigan (JIRA)
Ken Finnigan created AS7-5970:
---------------------------------
Summary: RichFaces Showcase portlet is unable to switch skins
Key: AS7-5970
URL: https://issues.jboss.org/browse/AS7-5970
Project: Application Server 7
Issue Type: Bug
Components: JSF
Affects Versions: 7.1.3.Final (EAP)
Reporter: Ken Finnigan
Assignee: Stan Silvert
The following exception is thrown when the user changes skins for the second time immediately after changing the skin for the first time:
{noformat}
Caused by: javax.faces.FacesException: Cannot remove the same component twice: pbG9dea276d_2dee9e_2d4150_2dad91_2d22255b5a57d2_j_id1:j_idt444
at com.sun.faces.context.StateContext$AddRemoveListener.handleAddRemoveWithAutoPrune(StateContext.java:489) [jsf-impl-2.1.13-redhat-1.jar:2.1.13-redhat-1]
at com.sun.faces.context.StateContext$AddRemoveListener.handleRemove(StateContext.java:371) [jsf-impl-2.1.13-redhat-1.jar:2.1.13-redhat-1]
at com.sun.faces.context.StateContext$AddRemoveListener.processEvent(StateContext.java:334) [jsf-impl-2.1.13-redhat-1.jar:2.1.13-redhat-1]
at javax.faces.event.SystemEvent.processListener(SystemEvent.java:106) [jboss-jsf-api_2.1_spec-2.0.7.Final-redhat-1.jar:2.0.7.Final-redhat-1]
{noformat}
This error manifests due to the Portlet Bridge needing to retain the UIViewRoot from JSF between Portlet Requests, which causes the list of component tree actions, ie. adding and removing, to be retained making JSF think that it's trying to remove a component that was actually removed in a previous request.
This has been raised as http://java.net/jira/browse/JAVASERVERFACES-2609, but wanted to raise this as a tracker so that when that fix is available it can be incorporated.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 2 months
[JBoss JIRA] (AS7-5972) SharedLocalYieldingLockManager.LocalLock
by MJ Kim (JIRA)
MJ Kim created AS7-5972:
---------------------------
Summary: SharedLocalYieldingLockManager.LocalLock
Key: AS7-5972
URL: https://issues.jboss.org/browse/AS7-5972
Project: Application Server 7
Issue Type: Bug
Components: Clustering
Reporter: MJ Kim
Assignee: Paul Ferraro
Hi,
Recently my system has been in the QA. (includes Stress test, Endurance test)
During the endurance test, I found that the heap space was getting exausted, and not removed after full gc.
When the heap space got close to 90%, the gabage collection was happend every 2 min, and my system was stopped reponding.
The heap space was not cleaned up, nevertheless I ended the test (no request during a few hours)
I downloaded some heap dumps, and found that the SharedLocalYieldingLockManage.LocalLock() resided much of heap space. (above 60%)
I think the session expiration doesn't operate porperly.
If the SessionBasesClusteredSession class raises the expiration signals with "LocalOnly=True", the lock would not be removed.
Addionally, I reviewed our source code and did a leakage discory test, anything was matter.
Here is my environment. If you want to see my standalone.xml, please post a reply thread.
<Cluster>
- 8 JVM (4 machine, each 2)
- JDK : 1.6u31
- OS : Amazon Linux 64bit
- JGroups : FILE_PING (The shared storage is GlusterFS volume)
- Infinispan operation mode : L1 + Distribution / ASYNC / expiration 1min
- Session handling : web.xml (expiration every 1min)
(Originally our setting was 30 min. Beacuse the load generator was sending too many requests with new session, I lowered the threshold to 1min)
- Source code : 7.1.3 Final tag (downloaded from Github)
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 2 months
[JBoss JIRA] (JBRULES-3686) Wrong type declartion initialization causes an infinite loop when using property reactivity
by Mario Fusco (JIRA)
Mario Fusco created JBRULES-3686:
------------------------------------
Summary: Wrong type declartion initialization causes an infinite loop when using property reactivity
Key: JBRULES-3686
URL: https://issues.jboss.org/browse/JBRULES-3686
Project: Drools
Issue Type: Bug
Security Level: Public (Everyone can see)
Reporter: Mario Fusco
Assignee: Mario Fusco
A drl like the following with DataSample being annotated as @PropertyReactive ends up in an infinite loop even if it shouldn't.
{{
rule 'Init'
when
$m: Model()
then
System.out.println("Inserting a DataSample");
insert(new DataSample($m));
end
rule "Rule 1"
when
$m: Model()
$d: DataSample(model == $m)
then
System.out.println(drools.getRule().getName());
modify($d){
addValue(Parameter.PARAM_A, 10.0)
}
end
rule "Rule 2"
when
$m: Model()
$d: DataSample(model == $m, $v: values[Parameter.PARAM_A] > 9.0)
then
System.out.println(drools.getRule().getName());
modify($d){
addMessage("Hello")
}
end
rule "Data without messages"
salience -100
when
$m: Model()
$d: DataSample(model == $m, messaged == false)
then
System.out.println(drools.getRule().getName());
end
}}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 2 months
[JBoss JIRA] (AS7-5968) jboss-deployment-structure.xml depend on era name
by Marco Benuzzi (JIRA)
Marco Benuzzi created AS7-5968:
----------------------------------
Summary: jboss-deployment-structure.xml depend on era name
Key: AS7-5968
URL: https://issues.jboss.org/browse/AS7-5968
Project: Application Server 7
Issue Type: Bug
Components: Server
Affects Versions: 7.1.1.Final
Reporter: Marco Benuzzi
Assignee: Jason Greene
Priority: Minor
Here's my use case: I've an application ear which contains an ejb module and a war module.
* myapp.ear
** myapp-ejb.jar
** myapp-gwt.war
The application runs in a cluster of 2 nodes.
I've some scheduled EJBs and I need different schedules on the two cluster nodes, so I package my application in two different ear files:
* myapp-node1.ear
* myapp-node1.ear
Both files are identical except ear/myapp-ejb.jar/META-INF/ejb.xml in which I've different <timer> configurations.
ear/META-INF/application.xml is
{code:xml}
<?xml version="1.0" encoding="UTF-8"?>
<application xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:application="http://java.sun.com/xml/ns/javaee/application_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/application_6.xsd" id="Application_ID" version="6">
<application-name>myapp</application-name>
<display-name>My Application</display-name>
<module>
<ejb>myapp-ejb.jar</ejb>
</module>
<module>
<web>
<web-uri>myapp-gwt.war</web-uri>
<context-root>myapp</context-root>
</web>
</module>
</module>
</application>
{code}
Declaring <application> all my EJB have the same JNDI application name even if they come from different ear files.
The problem is in the ear/META-INF/jboss-deployment-structure.xml
It is not possible to use subdeployments isolation because I must use the real ear name.
{code:xml}
<jboss-deployment-structure>
<ear-subdeployments-isolated>true</ear-subdeployments-isolated>
<deployment>
<dependencies>
<module name="org.apache.commons.lang" />
</dependencies>
</deployment>
<sub-deployment name="myapp-ejb.jar">
<dependencies>
<module name="org.apache.commons.lang" />
<module name="org.apache.commons.collections" />
<module name="org.apache.commons.configuration" />
<module name="org.apache.commons.codec" />
<module name="org.apache.httpcomponents" />
</dependencies>
</sub-deployment>
<sub-deployment name="myapp-gwt.war">
<dependencies>
<module name="deployment.myapp.ear.myapp-ejb.jar" />
</dependencies>
</sub-deployment>
</jboss-deployment-structure>
{code}
The problem is the line
{quote}
<module name="deployment.*myapp.ear*.myapp-ejb.jar" />
{quote}
beacuse it is mandatory to use the actual ear file name.
In this situation it will be usefull to have an "alias" to indicate the containing ear, so the above line could be
{quote}
<module name="deployment.*self-ear*.myapp-ejb.jar" />
{quote}
The workaround for this issues are:
* use <ear-subdeployments-isolated>false</ear-subdeployments-isolated> and do not declare any dependencies
* use different jboss-deployment-structure.xml files with real ear file names
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 2 months
[JBoss JIRA] (AS7-5971) Module Service Dependencies do not take transitive dependencies into account
by Stuart Douglas (JIRA)
Stuart Douglas created AS7-5971:
-----------------------------------
Summary: Module Service Dependencies do not take transitive dependencies into account
Key: AS7-5971
URL: https://issues.jboss.org/browse/AS7-5971
Project: Application Server 7
Issue Type: Bug
Components: Class Loading
Affects Versions: 7.1.3.Final (EAP)
Reporter: Stuart Douglas
Assignee: Stuart Douglas
A ModuleLoadService has dependencies on all its dependent ModuleSpecServices, however this does not work if the ModuleSpecService has a dependency on another ModuleSpecService with export=true, as the module may attempt to load before transitive dependencies have been started.
This has caused transient failures in EarClassPathTransitiveClosureTestCase.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 2 months
[JBoss JIRA] (JBWEB-253) IndexOutOfBoundsException for large PUT or POST request
by Marko Lukša (JIRA)
Marko Lukša created JBWEB-253:
---------------------------------
Summary: IndexOutOfBoundsException for large PUT or POST request
Key: JBWEB-253
URL: https://issues.jboss.org/browse/JBWEB-253
Project: JBoss Web
Issue Type: Bug
Security Level: Public (Everyone can see)
Affects Versions: JBossWeb-7.2.0.Alpha1
Reporter: Marko Lukša
Assignee: Remy Maucherat
NOTE: this affects version Alpha2, but Alpha2 is not available in JIRA.
The following code results in an IndexOutOfBoundsException if {{largeFile}} is larger than approximately 8k.
{code}
DefaultHttpClient client = new DefaultHttpClient();
HttpPut put = new HttpPut(url);
put.setEntity(new FileEntity(largeFile, "text/plain"));
HttpResponse response = client.execute(put);
{code}
This is the error:
{code}
17:14:52,502 ERROR [org.apache.coyote.http11] (http-127.0.0.1/127.0.0.1:8080-4) JBWEB003072: Error finishing request: java.lang.IndexOutOfBoundsException
at java.nio.Buffer.checkBounds(Buffer.java:559) [rt.jar:1.7.0_07]
at java.nio.DirectByteBuffer.get(DirectByteBuffer.java:259) [rt.jar:1.7.0_07]
at org.apache.coyote.http11.InternalNioInputBuffer.fill(InternalNioInputBuffer.java:404) [jbossweb-7.2.0.Alpha2.jar:7.2.0.Alpha2]
at org.apache.coyote.http11.InternalNioInputBuffer$InputBufferImpl.doRead(InternalNioInputBuffer.java:509) [jbossweb-7.2.0.Alpha2.jar:7.2.0.Alpha2]
at org.apache.coyote.http11.filters.IdentityInputFilter.end(IdentityInputFilter.java:161) [jbossweb-7.2.0.Alpha2.jar:7.2.0.Alpha2]
at org.apache.coyote.http11.AbstractInternalInputBuffer.endRequest(AbstractInternalInputBuffer.java:291) [jbossweb-7.2.0.Alpha2.jar:7.2.0.Alpha2]
at org.apache.coyote.http11.Http11NioProcessor.endRequest(Http11NioProcessor.java:437) [jbossweb-7.2.0.Alpha2.jar:7.2.0.Alpha2]
at org.apache.coyote.http11.Http11NioProcessor.process(Http11NioProcessor.java:377) [jbossweb-7.2.0.Alpha2.jar:7.2.0.Alpha2]
at org.apache.coyote.http11.Http11NioProtocol$Http11ConnectionHandler.process(Http11NioProtocol.java:900) [jbossweb-7.2.0.Alpha2.jar:7.2.0.Alpha2]
at org.apache.tomcat.util.net.NioEndpoint$ChannelProcessor.run(NioEndpoint.java:1025) [jbossweb-7.2.0.Alpha2.jar:7.2.0.Alpha2]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) [rt.jar:1.7.0_07]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) [rt.jar:1.7.0_07]
at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_07]
{code}
This error does not occur on JBossAS 7.1.1.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 2 months
[JBoss JIRA] (JBRULES-3689) Organize Imports
by Simon Raess (JIRA)
Simon Raess created JBRULES-3689:
------------------------------------
Summary: Organize Imports
Key: JBRULES-3689
URL: https://issues.jboss.org/browse/JBRULES-3689
Project: Drools
Issue Type: Feature Request
Security Level: Public (Everyone can see)
Components: drools-eclipse (expert)
Affects Versions: 5.5.0.Final
Reporter: Simon Raess
Assignee: Mark Proctor
Support "Organize Imports" [Ctrl+Shift+O] in drl editor, as we all know it from the Java editor. i.e. add missing imports (showing a dialog, if there are ambiguous matches), remove unused imports.
Additionally, when completing a class name, the editor should add an import and "complete" the unqualified name (today, the fully qualified name is added, unless there is already an import).
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 2 months
[JBoss JIRA] (JBRULES-3688) Provide detailed context information for NoClassDefFoundError: Could not initialize class org.drools.rule.constraint.MvelConstraint$ExecutorHolder at org.drools.rule.constraint.MvelConstraint.jitEvaluator(MvelConstraint.java:232)
by Hendy Irawan (JIRA)
Hendy Irawan created JBRULES-3688:
-------------------------------------
Summary: Provide detailed context information for NoClassDefFoundError: Could not initialize class org.drools.rule.constraint.MvelConstraint$ExecutorHolder at org.drools.rule.constraint.MvelConstraint.jitEvaluator(MvelConstraint.java:232)
Key: JBRULES-3688
URL: https://issues.jboss.org/browse/JBRULES-3688
Project: Drools
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: drools-core
Affects Versions: 5.5.0.Final
Environment: Karaf
Karaf version 2.3.0
Karaf home /home/ceefour/git/bippo-commerce5/karaf
Karaf base /home/ceefour/git/bippo-commerce5/karaf
OSGi Framework org.apache.felix.framework - 4.0.3
JVM
Java Virtual Machine OpenJDK 64-Bit Server VM version 23.2-b09
Version 1.7.0_07
Vendor Oracle Corporation
Uptime 8 minutes
Total compile time 44.295 seconds
Threads
Live threads 107
Daemon threads 92
Peak 140
Total started 322
Memory
Current heap size 203,385 kbytes
Maximum heap size 466,048 kbytes
Committed heap size 283,072 kbytes
Pending objects 0
Garbage collector Name = 'PS Scavenge', Collections = 73, Time = 0.654 seconds
Garbage collector Name = 'PS MarkSweep', Collections = 2, Time = 0.366 seconds
Classes
Current classes loaded 15,546
Total classes loaded 15,547
Total classes unloaded 1
Operating system
Name Linux version 3.2.0-32-generic
Architecture amd64
Processors 8
Reporter: Hendy Irawan
Assignee: Mark Proctor
We're using Drools 5.5.0 in OSGi with: Karaf 2.3.0, Pax Wicket 1.1.1.
We experience several issues and this is one of them. Even if a fix is not in sight, I'd appreciate if a check with more detailed information can be provided at the exception point, which will be helpful for us to diagnose and for future bug report to Drools team.
The error is intermittent, together with #JBRULES-3687 during a single session it happens:
1. This bug: ~ 40%
2. #JBRULES-3687: ~ 50%
3. Success: ~ 10%
Stack:
{code}
Root cause:
java.lang.NoClassDefFoundError: Could not initialize class org.drools.rule.constraint.MvelConstraint$ExecutorHolder
at org.drools.rule.constraint.MvelConstraint.jitEvaluator(MvelConstraint.java:232)
at org.drools.rule.constraint.MvelConstraint.evaluate(MvelConstraint.java:197)
at org.drools.rule.constraint.MvelConstraint.isAllowed(MvelConstraint.java:157)
at org.drools.reteoo.AlphaNode.assertObject(AlphaNode.java:137)
at org.drools.reteoo.SingleObjectSinkAdapter.propagateAssertObject(SingleObjectSinkAdapter.java:59)
at org.drools.reteoo.AlphaNode.assertObject(AlphaNode.java:141)
at org.drools.reteoo.SingleObjectSinkAdapter.propagateAssertObject(SingleObjectSinkAdapter.java:59)
at org.drools.reteoo.AlphaNode.assertObject(AlphaNode.java:141)
at org.drools.reteoo.CompositeObjectSinkAdapter.doPropagateAssertObject(CompositeObjectSinkAdapter.java:497)
at org.drools.reteoo.CompositeObjectSinkAdapter.propagateAssertObject(CompositeObjectSinkAdapter.java:372)
at org.drools.reteoo.ObjectTypeNode.assertObject(ObjectTypeNode.java:235)
at org.drools.reteoo.EntryPointNode.assertObject(EntryPointNode.java:240)
at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:350)
at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:311)
at org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:903)
at org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:847)
at org.drools.impl.StatefulKnowledgeSessionImpl.insert(StatefulKnowledgeSessionImpl.java:269)
at id.co.bippo.booking.BookingCheckRulesImpl.processBookings(BookingCheckRulesImpl.java:177)
at id.co.bippo.booking.BookingCheckRulesImpl.processFacts(BookingCheckRulesImpl.java:195)
at id.co.bippo.booking.BookingCheckRulesImpl.check(BookingCheckRulesImpl.java:147)
at id.co.bippo.booking.web.ProductBookingPanel.<init>(ProductBookingPanel.java:47)
at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
at org.soluvas.web.site.compose.impl.LiveChildContributorImpl$1.create(LiveChildContributorImpl.java:187)
at org.soluvas.web.site.compose.ComposeUtils.compose(ComposeUtils.java:68)
at org.soluvas.web.bootstrap.BootstrapPage.onInitialize(BootstrapPage.java:302)
at org.apache.wicket.Component.fireInitialize(Component.java:933)
at org.apache.wicket.MarkupContainer.internalInitialize(MarkupContainer.java:960)
at org.apache.wicket.Page.internalPrepareForRender(Page.java:277)
at org.apache.wicket.Component.render(Component.java:2313)
at org.apache.wicket.Page.renderPage(Page.java:1035)
at org.apache.wicket.request.handler.render.WebPageRenderer.renderPage(WebPageRenderer.java:115)
at org.apache.wicket.request.handler.render.WebPageRenderer.respond(WebPageRenderer.java:237)
at org.apache.wicket.request.handler.RenderPageRequestHandler.respond(RenderPageRequestHandler.java:167)
at org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.respond(RequestCycle.java:784)
at org.apache.wicket.request.RequestHandlerStack.execute(RequestHandlerStack.java:64)
at org.apache.wicket.request.cycle.RequestCycle.execute(RequestCycle.java:255)
at org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:212)
at org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:283)
at org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:188)
at org.apache.wicket.protocol.http.WicketServlet.doGet(WicketServlet.java:137)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:693)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:806)
at org.ops4j.pax.wicket.internal.FilterDelegator$Chain.doFilter(FilterDelegator.java:79)
at org.apache.shiro.web.servlet.AbstractShiroFilter.executeChain(AbstractShiroFilter.java:449)
at org.apache.shiro.web.servlet.AbstractShiroFilter$1.call(AbstractShiroFilter.java:365)
at org.apache.shiro.subject.support.SubjectCallable.doCall(SubjectCallable.java:90)
at org.apache.shiro.subject.support.SubjectCallable.call(SubjectCallable.java:83)
at org.apache.shiro.subject.support.DelegatingSubject.execute(DelegatingSubject.java:383)
at org.apache.shiro.web.servlet.AbstractShiroFilter.doFilterInternal(AbstractShiroFilter.java:362)
at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125)
at org.ops4j.pax.wicket.internal.FilterDelegator$Chain.doFilter(FilterDelegator.java:77)
at org.ops4j.pax.wicket.internal.FilterDelegator.doFilter(FilterDelegator.java:61)
at org.ops4j.pax.wicket.internal.ServletProxy$ServletInvocationHandler.invoke(ServletProxy.java:72)
at $Proxy80.service(Unknown Source)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.ops4j.pax.web.service.internal.HttpServiceStarted$2.invoke(HttpServiceStarted.java:210)
at org.ops4j.pax.web.service.internal.$Proxy0.service(Unknown Source)
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:652)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:447)
at org.ops4j.pax.web.service.jetty.internal.HttpServiceServletHandler.doHandle(HttpServiceServletHandler.java:70)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:137)
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:559)
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:227)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1038)
at org.ops4j.pax.web.service.jetty.internal.HttpServiceContext.doHandle(HttpServiceContext.java:117)
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:374)
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:189)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:972)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)
at org.ops4j.pax.web.service.jetty.internal.JettyServerHandlerCollection.handle(JettyServerHandlerCollection.java:74)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)
at org.eclipse.jetty.server.Server.handle(Server.java:363)
at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:483)
at org.eclipse.jetty.server.BlockingHttpConnection.handleRequest(BlockingHttpConnection.java:53)
at org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:920)
at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:982)
at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:635)
at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:235)
at org.eclipse.jetty.server.BlockingHttpConnection.handle(BlockingHttpConnection.java:72)
at org.eclipse.jetty.server.nio.BlockingChannelConnector$BlockingChannelEndPoint.run(BlockingChannelConnector.java:298)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608)
at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543)
at java.lang.Thread.run(Thread.java:722)
Complete stack:
java.lang.RuntimeException: Cannot create component id.co.bippo.booking.web.ProductBookingPanel for contributor id.co.bippo.product.web.pub.ProductView/addToCartRegion from id.co.bippo.booking.web [3478]
at org.soluvas.web.site.compose.impl.LiveChildContributorImpl$1.create(LiveChildContributorImpl.java:189)
at org.soluvas.web.site.compose.ComposeUtils.compose(ComposeUtils.java:68)
at org.soluvas.web.bootstrap.BootstrapPage.onInitialize(BootstrapPage.java:302)
at org.apache.wicket.Component.fireInitialize(Component.java:933)
at org.apache.wicket.MarkupContainer.internalInitialize(MarkupContainer.java:960)
at org.apache.wicket.Page.internalPrepareForRender(Page.java:277)
at org.apache.wicket.Component.render(Component.java:2313)
at org.apache.wicket.Page.renderPage(Page.java:1035)
at org.apache.wicket.request.handler.render.WebPageRenderer.renderPage(WebPageRenderer.java:115)
at org.apache.wicket.request.handler.render.WebPageRenderer.respond(WebPageRenderer.java:237)
at org.apache.wicket.request.handler.RenderPageRequestHandler.respond(RenderPageRequestHandler.java:167)
at org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.respond(RequestCycle.java:784)
at org.apache.wicket.request.RequestHandlerStack.execute(RequestHandlerStack.java:64)
at org.apache.wicket.request.cycle.RequestCycle.execute(RequestCycle.java:255)
at org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:212)
at org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:283)
at org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:188)
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
at org.soluvas.web.site.compose.impl.LiveChildContributorImpl$1.create(LiveChildContributorImpl.java:187)
at org.soluvas.web.site.compose.ComposeUtils.compose(ComposeUtils.java:68)
at org.soluvas.web.bootstrap.BootstrapPage.onInitialize(BootstrapPage.java:302)
at org.apache.wicket.Component.fireInitialize(Component.java:933)
at org.apache.wicket.MarkupContainer.internalInitialize(MarkupContainer.java:960)
at org.apache.wicket.Page.internalPrepareForRender(Page.java:277)
at org.apache.wicket.Component.render(Component.java:2313)
at org.apache.wicket.Page.renderPage(Page.java:1035)
at org.apache.wicket.request.handler.render.WebPageRenderer.renderPage(WebPageRenderer.java:115)
at org.apache.wicket.request.handler.render.WebPageRenderer.respond(WebPageRenderer.java:237)
at org.apache.wicket.request.handler.RenderPageRequestHandler.respond(RenderPageRequestHandler.java:167)
at org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.respond(RequestCycle.java:784)
at org.apache.wicket.request.RequestHandlerStack.execute(RequestHandlerStack.java:64)
at org.apache.wicket.request.cycle.RequestCycle.execute(RequestCycle.java:255)
at org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:212)
at org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:283)
at org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:188)
{code}
Another stack trace, same root cause, different execution path:
{code}
Root cause:
java.lang.NoClassDefFoundError: Could not initialize class org.drools.rule.constraint.MvelConstraint$ExecutorHolder
at org.drools.rule.constraint.MvelConstraint.jitEvaluator(MvelConstraint.java:232)
at org.drools.rule.constraint.MvelConstraint.evaluate(MvelConstraint.java:197)
at org.drools.rule.constraint.MvelConstraint.isAllowedCachedLeft(MvelConstraint.java:169)
at org.drools.common.TripleBetaConstraints.isAllowedCachedLeft(TripleBetaConstraints.java:91)
at org.drools.reteoo.JoinNode.propagateFromLeft(JoinNode.java:105)
at org.drools.reteoo.JoinNode.assertLeftTuple(JoinNode.java:95)
at org.drools.reteoo.SingleLeftTupleSinkAdapter.doPropagateAssertLeftTuple(SingleLeftTupleSinkAdapter.java:196)
at org.drools.reteoo.SingleLeftTupleSinkAdapter.propagateAssertLeftTuple(SingleLeftTupleSinkAdapter.java:71)
at org.drools.reteoo.FromNode.checkConstraintsAndPropagate(FromNode.java:333)
at org.drools.reteoo.FromNode.assertLeftTuple(FromNode.java:164)
at org.drools.reteoo.CompositeLeftTupleSinkAdapter.doPropagateAssertLeftTuple(CompositeLeftTupleSinkAdapter.java:232)
at org.drools.reteoo.CompositeLeftTupleSinkAdapter.createAndPropagateAssertLeftTuple(CompositeLeftTupleSinkAdapter.java:116)
at org.drools.reteoo.LeftInputAdapterNode.assertObject(LeftInputAdapterNode.java:154)
at org.drools.reteoo.SingleObjectSinkAdapter.propagateAssertObject(SingleObjectSinkAdapter.java:59)
at org.drools.reteoo.AlphaNode.assertObject(AlphaNode.java:141)
at org.drools.reteoo.SingleObjectSinkAdapter.propagateAssertObject(SingleObjectSinkAdapter.java:59)
at org.drools.reteoo.AlphaNode.assertObject(AlphaNode.java:141)
at org.drools.reteoo.SingleObjectSinkAdapter.propagateAssertObject(SingleObjectSinkAdapter.java:59)
at org.drools.reteoo.AlphaNode.assertObject(AlphaNode.java:141)
at org.drools.reteoo.CompositeObjectSinkAdapter.doPropagateAssertObject(CompositeObjectSinkAdapter.java:497)
at org.drools.reteoo.CompositeObjectSinkAdapter.propagateAssertObject(CompositeObjectSinkAdapter.java:372)
at org.drools.reteoo.ObjectTypeNode.assertObject(ObjectTypeNode.java:235)
at org.drools.reteoo.EntryPointNode.assertObject(EntryPointNode.java:240)
at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:350)
at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:311)
at org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:903)
at org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:847)
at org.drools.impl.StatefulKnowledgeSessionImpl.insert(StatefulKnowledgeSessionImpl.java:269)
at id.co.bippo.booking.BookingCheckRulesImpl.processBookings(BookingCheckRulesImpl.java:177)
at id.co.bippo.booking.BookingCheckRulesImpl.processFacts(BookingCheckRulesImpl.java:195)
at id.co.bippo.booking.BookingCheckRulesImpl.check(BookingCheckRulesImpl.java:147)
at id.co.bippo.booking.web.ProductBookingPanel.<init>(ProductBookingPanel.java:47)
at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
at org.soluvas.web.site.compose.impl.LiveChildContributorImpl$1.create(LiveChildContributorImpl.java:187)
at org.soluvas.web.site.compose.ComposeUtils.compose(ComposeUtils.java:68)
at org.soluvas.web.bootstrap.BootstrapPage.onInitialize(BootstrapPage.java:302)
at org.apache.wicket.Component.fireInitialize(Component.java:933)
at org.apache.wicket.MarkupContainer.internalInitialize(MarkupContainer.java:960)
at org.apache.wicket.Page.internalPrepareForRender(Page.java:277)
at org.apache.wicket.Component.render(Component.java:2313)
at org.apache.wicket.Page.renderPage(Page.java:1035)
at org.apache.wicket.request.handler.render.WebPageRenderer.renderPage(WebPageRenderer.java:115)
at org.apache.wicket.request.handler.render.WebPageRenderer.respond(WebPageRenderer.java:237)
at org.apache.wicket.request.handler.RenderPageRequestHandler.respond(RenderPageRequestHandler.java:167)
at org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.respond(RequestCycle.java:784)
at org.apache.wicket.request.RequestHandlerStack.execute(RequestHandlerStack.java:64)
at org.apache.wicket.request.cycle.RequestCycle.execute(RequestCycle.java:255)
at org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:212)
at org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:283)
at org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:188)
at org.apache.wicket.protocol.http.WicketServlet.doGet(WicketServlet.java:137)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:693)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:806)
at org.ops4j.pax.wicket.internal.FilterDelegator$Chain.doFilter(FilterDelegator.java:79)
at org.apache.shiro.web.servlet.AbstractShiroFilter.executeChain(AbstractShiroFilter.java:449)
at org.apache.shiro.web.servlet.AbstractShiroFilter$1.call(AbstractShiroFilter.java:365)
at org.apache.shiro.subject.support.SubjectCallable.doCall(SubjectCallable.java:90)
at org.apache.shiro.subject.support.SubjectCallable.call(SubjectCallable.java:83)
at org.apache.shiro.subject.support.DelegatingSubject.execute(DelegatingSubject.java:383)
at org.apache.shiro.web.servlet.AbstractShiroFilter.doFilterInternal(AbstractShiroFilter.java:362)
at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125)
at org.ops4j.pax.wicket.internal.FilterDelegator$Chain.doFilter(FilterDelegator.java:77)
at org.ops4j.pax.wicket.internal.FilterDelegator.doFilter(FilterDelegator.java:61)
at org.ops4j.pax.wicket.internal.ServletProxy$ServletInvocationHandler.invoke(ServletProxy.java:72)
at $Proxy80.service(Unknown Source)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.ops4j.pax.web.service.internal.HttpServiceStarted$2.invoke(HttpServiceStarted.java:210)
at org.ops4j.pax.web.service.internal.$Proxy0.service(Unknown Source)
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:652)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:447)
at org.ops4j.pax.web.service.jetty.internal.HttpServiceServletHandler.doHandle(HttpServiceServletHandler.java:70)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:137)
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:559)
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:227)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1038)
at org.ops4j.pax.web.service.jetty.internal.HttpServiceContext.doHandle(HttpServiceContext.java:117)
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:374)
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:189)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:972)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)
at org.ops4j.pax.web.service.jetty.internal.JettyServerHandlerCollection.handle(JettyServerHandlerCollection.java:74)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)
at org.eclipse.jetty.server.Server.handle(Server.java:363)
at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:483)
at org.eclipse.jetty.server.BlockingHttpConnection.handleRequest(BlockingHttpConnection.java:53)
at org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:920)
at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:982)
at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:635)
at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:235)
at org.eclipse.jetty.server.BlockingHttpConnection.handle(BlockingHttpConnection.java:72)
at org.eclipse.jetty.server.nio.BlockingChannelConnector$BlockingChannelEndPoint.run(BlockingChannelConnector.java:298)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608)
at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543)
at java.lang.Thread.run(Thread.java:722)
Complete stack:
java.lang.RuntimeException: Cannot create component id.co.bippo.booking.web.ProductBookingPanel for contributor id.co.bippo.product.web.pub.ProductView/addToCartRegion from id.co.bippo.booking.web [3478]
at org.soluvas.web.site.compose.impl.LiveChildContributorImpl$1.create(LiveChildContributorImpl.java:189)
at org.soluvas.web.site.compose.ComposeUtils.compose(ComposeUtils.java:68)
at org.soluvas.web.bootstrap.BootstrapPage.onInitialize(BootstrapPage.java:302)
at org.apache.wicket.Component.fireInitialize(Component.java:933)
at org.apache.wicket.MarkupContainer.internalInitialize(MarkupContainer.java:960)
at org.apache.wicket.Page.internalPrepareForRender(Page.java:277)
at org.apache.wicket.Component.render(Component.java:2313)
at org.apache.wicket.Page.renderPage(Page.java:1035)
at org.apache.wicket.request.handler.render.WebPageRenderer.renderPage(WebPageRenderer.java:115)
at org.apache.wicket.request.handler.render.WebPageRenderer.respond(WebPageRenderer.java:237)
at org.apache.wicket.request.handler.RenderPageRequestHandler.respond(RenderPageRequestHandler.java:167)
at org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.respond(RequestCycle.java:784)
at org.apache.wicket.request.RequestHandlerStack.execute(RequestHandlerStack.java:64)
at org.apache.wicket.request.cycle.RequestCycle.execute(RequestCycle.java:255)
at org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:212)
at org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:283)
at org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:188)
java.lang.reflect.InvocationTargetException
at sun.reflect.GeneratedConstructorAccessor111.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
at org.soluvas.web.site.compose.impl.LiveChildContributorImpl$1.create(LiveChildContributorImpl.java:187)
at org.soluvas.web.site.compose.ComposeUtils.compose(ComposeUtils.java:68)
at org.soluvas.web.bootstrap.BootstrapPage.onInitialize(BootstrapPage.java:302)
at org.apache.wicket.Component.fireInitialize(Component.java:933)
at org.apache.wicket.MarkupContainer.internalInitialize(MarkupContainer.java:960)
at org.apache.wicket.Page.internalPrepareForRender(Page.java:277)
at org.apache.wicket.Component.render(Component.java:2313)
at org.apache.wicket.Page.renderPage(Page.java:1035)
at org.apache.wicket.request.handler.render.WebPageRenderer.renderPage(WebPageRenderer.java:115)
at org.apache.wicket.request.handler.render.WebPageRenderer.respond(WebPageRenderer.java:237)
at org.apache.wicket.request.handler.RenderPageRequestHandler.respond(RenderPageRequestHandler.java:167)
at org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.respond(RequestCycle.java:784)
at org.apache.wicket.request.RequestHandlerStack.execute(RequestHandlerStack.java:64)
at org.apache.wicket.request.cycle.RequestCycle.execute(RequestCycle.java:255)
at org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:212)
at org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:283)
at org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:188)
{code}
Bundles:
{code}
[3016] [Active ] [ ] [ ] [ 80] id.co.bippo.booking.rs (5.0.0.SNAPSHOT)
[3017] [Active ] [ ] [ ] [ 80] id.co.bippo.booking (5.0.0.SNAPSHOT)
[3173] [Active ] [ ] [Started] [ 80] berbatik_booking.xml (0.0.0)
[3192] [Active ] [ ] [Started] [ 80] berbatik_booking.rs.xml (0.0.0)
[3295] [Active ] [ ] [ ] [ 50] org.drools.api (5.5.0.Final)
[3296] [Active ] [ ] [ ] [ 50] org.drools.internalapi (5.5.0.Final)
[3297] [Active ] [ ] [ ] [ 50] org.drools.core (5.5.0.Final)
[3298] [Active ] [ ] [ ] [ 50] org.drools.compiler (5.5.0.Final)
[3299] [Active ] [ ] [ ] [ 50] org.drools.templates (5.5.0.Final)
[3478] [Active ] [Created ] [ ] [ 80] id.co.bippo.booking.web (5.0.0.SNAPSHOT)
{code}
DRL:
{code}
package id.co.bippo.booking
dialect "mvel"
import org.slf4j.Logger;
import org.joda.time.*;
import id.co.bippo.booking.*;
import id.co.bippo.booking.CheckProduct.Bookability;
import id.co.bippo.booking.CheckProduct.Confirmability;
import id.co.bippo.person.*;
import id.co.bippo.product.util.ProductUtils;
global Logger log;
global BookingDao bookingDao;
global ProductUtils productUtils;
global PersonUtils personUtils;
rule "Cek booking produk dengan qty 1, stock ada"
activation-group "Check"
when
$action : CheckProduct( $personId : personId, $productId : productId, $qty : qty == 1.0,
bookability == Bookability.NEW,
confirmability == Confirmability.NEW)
$bookedQty : Double() from bookingDao.findBookedQty($productId)
$availableQty : Double(this - $bookedQty >= $qty) from productUtils.getQtyByProductId($productId)
$countBook : Long(this < 100) from bookingDao.getBookCountByPersonIdToday($personId)
then
log.info("{} boleh booking {} sebanyak {} (stok tersedia: {}, sudah dibooking: {})",
{$personId, $productId, $qty, $availableQty, $bookedQty});
modify($action) {
setBookability(CheckProduct$Bookability.AVAILABLE),
setConfirmability(CheckProduct$Confirmability.AVAILABLE),
setMessage("Anda boleh melakukan booking untuk produk "+ $productId +", Terima Kasih")
}
end
rule "Check booking yang melebihi batas yang telah ditentukan, batas booking 3 per 24 jam"
activation-group "Check"
when
$action : CheckProduct( $personId : personId, $productId : productId, $qty : qty == 1.0,
bookability == Bookability.NEW,
confirmability == Confirmability.NEW)
$countBook : Long(this >= 100) from bookingDao.getBookCountByPersonIdToday($personId)
then
log.info("Person ID {} telah melakukan booking product sebanyak {}", {$personId, $countBook});
modify($action) {
setBookability(CheckProduct$Bookability.QUOTA_EXCEEDED),
setConfirmability(CheckProduct$Confirmability.QUOTA_EXCEEDED),
setMessage("Sorry, Cannot book product currently, you have too many bookings today");
}
end
rule "Check if product is already booked by himself (BookingDetail status: open/pending/waiting)."
activation-group "Check"
salience 15
when
$action : CheckProduct( $personId : personId, $productId: productId, $qty: qty == 1.0,
bookability == Bookability.NEW,
confirmability == Confirmability.NEW)
$bookingDetail : BookingDetail(booking.personId == $personId, productId == $productId, qty == $qty,
/*status in (BookingDetail$Status.OPEN, BookingDetail$Status.PENDING_WAITING) )*/
status == BookingDetail$Status.OPEN)
then
log.info("{} sudah booking {} sebanyak {}, tinggal diorder",
{$personId, $productId, $qty});
modify($action) {
setBookability(CheckProduct$Bookability.ALREADY_SELF),
setConfirmability(CheckProduct$Confirmability.PLEASE_PAY_TO_ORDER),
setBooker(personUtils.getPersonRefById($bookingDetail.booking.personId)),
setMessage($personId + " sudah booking " + $productId " sebanyak " + $qty + ", tinggal diorder")
}
end
rule "Check if product is already confimed by himself (BookingDetail status: pending_waiting)."
activation-group "Check"
salience 15
when
$action : CheckProduct( $personId : personId, $productId: productId, $qty: qty == 1.0,
bookability == Bookability.NEW,
confirmability == Confirmability.NEW)
$bookingDetail : BookingDetail(booking.personId == $personId, productId == $productId, qty == $qty,
status == BookingDetail$Status.PENDING_WAITING)
then
log.info("{} sudah booking {} sebanyak {}, tinggal diorder",
{$personId, $productId, $qty});
modify($action) {
setBookability(CheckProduct$Bookability.ALREADY_SELF),
setConfirmability(CheckProduct$Confirmability.PLEASE_PAY_TO_WAIT),
setBooker(personUtils.getPersonRefById($bookingDetail.booking.personId)),
setMessage($personId + " sudah booking " + $productId " sebanyak " + $qty + ", tinggal diorder")
}
end
rule "Check: Product already booked by other, AND already confirmed by yet another."
activation-group "Check"
salience 20
when
$action : CheckProduct( $personId : personId, $productId: productId, $qty: qty == 1.0,
bookability == Bookability.NEW,
confirmability == Confirmability.NEW)
$bookedQty : Double(this >= 1.0) from bookingDao.findBookedQty($productId)
$bookingDetail : BookingDetail(booking.personId != $personId, productId == $productId, qty == $qty,
status == BookingDetail$Status.OPEN)
$bookingDetail2 : BookingDetail(booking.personId != $personId, productId == $productId, qty == $qty,
status == BookingDetail$Status.PENDING_WAITING)
then
log.info("{} ingin booking {} sebanyak {} tapi sudah dibooking dan diconfirm 2 orang",
{$personId, $productId, $qty});
modify($action) {
setBookability(CheckProduct$Bookability.BOOKED_BY_OTHER),
setConfirmability(CheckProduct$Confirmability.CONFIRMED_BY_OTHER),
setBooker(personUtils.getPersonRefById($bookingDetail.booking.personId)),
setMessage($productId + " sudah dibooking dan diconfirm 2 orang customer lain.")
}
end
rule "Check the product, but the product was booked by other."
activation-group "Check"
salience 10
when
$action : CheckProduct( $personId : personId, $productId: productId, $qty: qty == 1.0,
bookability == Bookability.NEW,
confirmability == Confirmability.NEW)
$bookedQty : Double(this >= 1.0) from bookingDao.findBookedQty($productId)
$bookingDetail : BookingDetail(booking.personId != $personId, productId == $productId, qty == $qty,
status == BookingDetail$Status.OPEN)
then
log.info("{} ingin booking {} sebanyak {} tapi sudah dibooking orang, mau confirm dan nunggu ngga?",
{$personId, $productId, $qty});
modify($action) {
setBookability(CheckProduct$Bookability.BOOKED_BY_OTHER),
setConfirmability(CheckProduct$Confirmability.MUST_CONFIRM_WAITING),
setBooker(personUtils.getPersonRefById($bookingDetail.booking.personId)),
setMessage($productId + " sudah dibooking customer lain, silahkan untuk confirm waiting list.")
}
end
rule "Cek booking produk dengan qty 1, stock habis"
activation-group "Check"
when
$action : CheckProduct( $personId : personId, $productId : productId, $qty : qty == 1.0,
bookability == Bookability.NEW,
confirmability == Confirmability.NEW)
$bookedQty : Double() from bookingDao.findBookedQty($productId)
$availableQty : Double(this - $bookedQty < $qty) from productUtils.getQtyByProductId($productId)
then
log.info("{} tidak bisa booking {} sebanyak {} karena stok tidak cukup. Stok sekarang: {}, sudah dibooking orang: {}",
{$personId, $productId, $qty, $availableQty, $bookedQty});
modify($action) {
setBookability(CheckProduct$Bookability.OUT_OF_STOCK),
setConfirmability(CheckProduct$Confirmability.OUT_OF_STOCK),
setMessage("Maaf, produk "+ $productId + " tidak tersedia saat ini")
}
end
rule "Check booking produk dengan qty bukan 1"
activation-group "Check"
when
$action : CheckProduct( $personId : personId, $productId : productId, $qty : qty != 1.0,
bookability == Bookability.NEW,
confirmability == Confirmability.NEW)
then
log.info("{} booking {} sebanyak {}. Tidak boleh! Qty harus 1",
{$personId, $productId, $qty});
modify($action) {
setBookability(CheckProduct$Bookability.INVALID),
setConfirmability(CheckProduct$Confirmability.INVALID),
setMessage("Booking qty harus 1")
}
end
/*
rule "Minta booking produk, tapi tidak ada ada stock"
activation-group "Check"
salience -10
when
$action : CheckProduct( $personId : personId, $productId : productId, $qty : qty,
bookability == Bookability.NEW,
confirmability == Confirmability.NEW)
Double(this == null) from stockSvc.getAvailableQtyByProductId($productId)
then
log.info("{} booking {} sebanyak {}. Maaf stock tidak terdaftar!",
{$personId, $productId, $qty});
modify($action) {
setMessage("Stock produk " + $productId + " tidak terdaftar"),
setBookability(Bookability.NO_STOCK_DATA),
setConfirmability(Confirmability.NO_STOCK_DATA)
}
end
*/
rule "Minta booking produk... tak ada kriteria lain yang matching (unhandled case)"
activation-group "Check"
salience -100
when
$action : CheckProduct( $personId : personId, $productId : productId, $qty : qty,
bookability == Bookability.NEW,
confirmability == Confirmability.NEW)
then
log.warn("{} minta booking {} sebanyak {}, tapi tidak ada rule yang matching",
{$personId, $productId, $qty});
modify($action) {
setMessage("Internal error: " + $personId + " check booking " + $productId +
" sebanyak " + $qty + " namun tidak ada rule yang match. " +
" Mohon laporkan ke customer support."),
setBookability(CheckProduct$Bookability.ERROR),
setConfirmability(CheckProduct$Confirmability.ERROR)
}
end
{code}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 2 months