[JBoss JIRA] (JBRULES-3687) Provide detailed context information for java.lang.NullPointerException at org.drools.reteoo.RightTuple.unlinkFromRightParent(RightTuple.java:70)
by Hendy Irawan (JIRA)
Hendy Irawan created JBRULES-3687:
-------------------------------------
Summary: Provide detailed context information for java.lang.NullPointerException at org.drools.reteoo.RightTuple.unlinkFromRightParent(RightTuple.java:70)
Key: JBRULES-3687
URL: https://issues.jboss.org/browse/JBRULES-3687
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 null 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.
Stack:
{code}
java.lang.NullPointerException
at org.drools.reteoo.RightTuple.unlinkFromRightParent(RightTuple.java:70)
at org.drools.reteoo.FromNode.unlinkCreatedHandles(FromNode.java:393)
at org.drools.reteoo.FromNode.retractLeftTuple(FromNode.java:379)
at org.drools.reteoo.ObjectTypeNode.retractObject(ObjectTypeNode.java:290)
at org.drools.reteoo.EntryPointNode.retractObject(EntryPointNode.java:354)
at org.drools.common.NamedEntryPoint.retract(NamedEntryPoint.java:568)
at org.drools.common.AbstractWorkingMemory.retract(AbstractWorkingMemory.java:936)
at org.drools.common.AbstractWorkingMemory.retract(AbstractWorkingMemory.java:924)
at org.drools.impl.StatefulKnowledgeSessionImpl.retract(StatefulKnowledgeSessionImpl.java:273)
at id.co.bippo.booking.BookingCheckRulesImpl.processBookings(BookingCheckRulesImpl.java:185)
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)
java.lang.RuntimeException: Error during booking check CheckProduct [bookability=OUT_OF_STOCK, confirmability=OUT_OF_STOCK, message=Maaf, produk zibalabel_t05 tidak tersedia saat ini, getPersonId()=arum_puspita, getProductId()=zibalabel_t05, getQty()=1.0]
at id.co.bippo.booking.BookingCheckRulesImpl.check(BookingCheckRulesImpl.java:151)
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)
{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
11 years, 11 months
[JBoss JIRA] (AS7-5062) PersistenceUnitRootURL for JPA providers may not be spec compliant
by Craig Ringer (JIRA)
Craig Ringer created AS7-5062:
---------------------------------
Summary: PersistenceUnitRootURL for JPA providers may not be spec compliant
Key: AS7-5062
URL: https://issues.jboss.org/browse/AS7-5062
Project: Application Server 7
Issue Type: Bug
Components: JPA / Hibernate
Affects Versions: 7.1.1.Final
Environment: $ java -version
java version "1.7.0_03-icedtea"
OpenJDK Runtime Environment (fedora-2.2.1.fc17.8-x86_64)
OpenJDK 64-Bit Server VM (build 23.0-b21, mixed mode)
$ uname -a
Linux ayaki.localdomain 3.4.2-4.fc17.x86_64 #1 SMP Thu Jun 14 22:22:05 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux
Reporter: Craig Ringer
Assignee: Scott Marlow
Discussion on the EclipseLink bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=383200 ("On JBoss AS 7, EclipseLink doesn't find entity classes unless they're explicitly listed in persistence.xml") suggests that JBoss AS 7 may not be providing a spec-compliant PersistenceUnitRootURL or contents.
EclipseLink can't scan the contents of a deployment for @Entity annotated classes, so it doesn't find any entities unless they're explicitly named in persistence.xml .
http://docs.oracle.com/javaee/6/api/javax/persistence/spi/PersistenceUnit... states:
{quote}
java.net.URL getPersistenceUnitRootUrl()
Returns the URL for the jar file or directory that is the root of the persistence unit. (If the persistence unit is rooted in the WEB-INF/classes directory, this will be the URL of that directory.) The URL will either be a file: URL referring to a jar file or referring to a directory that contains an exploded jar file, or some other URL from which an InputStream in jar format can be obtained.
*Returns*: a URL referring to a jar file or directory
{quote}
... and that's what EclipseLink expects. However, for EclipseLink class scanning to function correctly an adapter class must be provided, such as the classes provided here:
https://community.jboss.org/wiki/HowToUseEclipseLinkWithAS7
to integrate EclipseLink with JBoss's VFS.
It may be worth investigating why this is necessary and whether the current behavior is standards compliant.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
11 years, 12 months
[JBoss JIRA] (AS7-5474) Url returned by PersistenceUnitInfo#getPersistenceUnitRootUrl() point to an empty folder
by Adriano Verona (JIRA)
Adriano Verona created AS7-5474:
-----------------------------------
Summary: Url returned by PersistenceUnitInfo#getPersistenceUnitRootUrl() point to an empty folder
Key: AS7-5474
URL: https://issues.jboss.org/browse/AS7-5474
Project: Application Server 7
Issue Type: Bug
Components: JPA / Hibernate
Affects Versions: 7.2.0.Alpha1
Environment: $ java -version
java version "1.6.0_31"
Java(TM) SE Runtime Environment (build 1.6.0_31-b05)
Java HotSpot(TM) Client VM (build 20.6-b01, mixed mode, sharing)
Windows 7 x64
Reporter: Adriano Verona
Assignee: Scott Marlow
When setting "jboss.as.jpa.vfs" property to false in persistence.xml PersistenceUnitInfo#getPersistenceUnitRootUrl() returns an Url that points to an empty folder (named "Contents"). The parent of this folder does holds the application jar.
file:/D:/Java/jboss-as-7.2.0.Alpha1/standalone/tmp/vfs/temp9c270668d311f0c4/vjpa_jboss_example.jar-7ef91a4c66eeff18/contents/
Observed this at PersistenceProvider#createContainerEntityManagerFactory() method call.
--
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
11 years, 12 months
[JBoss JIRA] (AS7-5281) JBoss loading wrong Hibernate version when using Persistence unit in WAR file
by Kuthair Habboush (JIRA)
Kuthair Habboush created AS7-5281:
-------------------------------------
Summary: JBoss loading wrong Hibernate version when using Persistence unit in WAR file
Key: AS7-5281
URL: https://issues.jboss.org/browse/AS7-5281
Project: Application Server 7
Issue Type: Feature Request
Components: Class Loading, JPA / Hibernate
Affects Versions: 7.1.1.Final
Environment: JBoss 7.1.1.Final & Hibernate 4.1.5.SP1 on Mac OSX 10.7/10.8
SQL Server 2008 on Windows 7 virtual
Reporter: Kuthair Habboush
Assignee: David Lloyd
Attachments: hibernate-test.zip
JBoss is loading Hibernate 4.0.1.Final (ships with) instead of the version specified in my Maven POM file and embedded in WAR archive, version: 4.1.5.SP1.
This ONLY occurs when I have a Persistence Unit setup in my WAR file in directory: resources/META-INF.
If I rename persistence.xml to persistence.xml.old, JBoss loads the correct version: Hibernate 4.1.5.SP1.
I have a sample project.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
11 years, 12 months
[JBoss JIRA] (JBRULES-3684) MVEL is having issues resolving a generic member in a concrete type
by Justin Holmes (JIRA)
Justin Holmes created JBRULES-3684:
--------------------------------------
Summary: MVEL is having issues resolving a generic member in a concrete type
Key: JBRULES-3684
URL: https://issues.jboss.org/browse/JBRULES-3684
Project: Drools
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: drools-compiler
Affects Versions: 5.5.0.CR1
Reporter: Justin Holmes
Assignee: Mark Proctor
Priority: Minor
Pull request with test case to follow...
I have 2 classes:
public abstract class AbstractBase<T> {
protected T foo;
public T getFoo() {
return foo;
}
}
public class StringConcrete extends AbstractBase<String> {
public StringConcrete() {
this.foo = new String();
}
}
The following rule fails in MVEL dialect, but passes in Java dialect.
rule "test"
dialect "mvel"
when
$S : StringConcrete()
then
System.out.println( $S.getFoo().concat("this works with java dialect") );
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
11 years, 12 months