Bug 828212 - Camel integration using JAXB, an exception is thrown instead of fact handle returning when deployed on JBoss 5.1
Summary: Camel integration using JAXB, an exception is thrown instead of fact handle r...
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: JBoss Enterprise BRMS Platform 5
Classification: JBoss
Component: BRE (Expert, Fusion)
Version: BRMS 5.3.0.GA
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: ER9
: BRMS 5.3.0.GA
Assignee: Nobody
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-06-04 12:57 UTC by Radovan Synek
Modified: 2025-02-10 03:20 UTC (History)
2 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2025-02-10 03:20:02 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
exception stacktrace (42.22 KB, text/plain)
2012-06-04 12:57 UTC, Radovan Synek
no flags Details
reproducer web app (26.96 KB, application/zip)
2012-06-12 18:14 UTC, Radovan Synek
no flags Details

Description Radovan Synek 2012-06-04 12:57:11 UTC
Created attachment 589147 [details]
exception stacktrace

Problem occurs with commands where fact handle should be returned in the answer (insert, query). 

The root exception is:
Caused by The property has a getter "public java.lang.String org.drools.common.DefaultFactHandle.getExternalForm()" but no setter. For unmarshalling, please define setters. (Or if this is a collection property, make sure that the getter returns a collection instance.)

Complete stacktrace is attached.

This problem is very likely caused by different jaxb version needed by droolsjbpm (jaxb-impl-2.2.1.1) and inside JBoss 5.1 (jaxb-impl-2.1.12)

Comment 1 Ryan Zhang 2012-06-12 09:10:03 UTC
I think this has been assigned to Toni, so I update the status.
If not, please feel free to revert it.
ER9 is waiting on this.

Comment 2 Toni Rikkola 2012-06-12 10:16:17 UTC
Yes I'm taking a look. 

Any info on how to reproduce this would help. I'm not that familiar with the Camel integration.

Comment 3 Radovan Synek 2012-06-12 12:10:53 UTC
(In reply to comment #2)
> Yes I'm taking a look. 
> 
> Any info on how to reproduce this would help. I'm not that familiar with the
> Camel integration.

Hi Toni,

I have found more about the problem - it's about the jaxb version, but also about classloading from war/ear. It seems that application deployed as war has no problem with jaxb version because libraries from war are loaded first. On the other hand, if you deploy the application as ear, container's libraries are found first and this problem occurs.

I have also tried some configurations with jboss-classloading.xml, but it does not help. To be honest, I know only a little about configuring this stuff.

I am working on reproducer that can be deployed on jboss, so hold on please.

Comment 4 Geoffrey De Smet 2012-06-12 16:18:56 UTC
Rsynek, do you got a ear file so we can reproduce this problem locally?

Comment 5 Geoffrey De Smet 2012-06-12 16:19:38 UTC
Rsynek: are the jaxb jars in in the ear directly or in the war inside the ear?

Comment 6 Mark Proctor 2012-06-12 16:31:35 UTC
Neither toni or geoffrey have managed to reproduce this problem so far. Geoffrey is still working on it, trying to reproduce the issue. Without further information, it is unlikely we'll progress this BZ further.

Comment 7 Radovan Synek 2012-06-12 18:14:40 UTC
Created attachment 591251 [details]
reproducer web app

Comment 8 Radovan Synek 2012-06-12 18:19:22 UTC
Excuse for the wrong information, it turned out that the problem is also with WAR. Our Arquillian test (deployed as WAR) somehow resolved the Jaxb version to 2.1.12 which works, so I thought that the problem is only with EAR packaging (recently the test was deploing as EAR with the Jaxb 2.2.1.1 inside).

I have finally prepared the promised reproducer - maven web app which launches insert and fireAllRules commands in a batch through Camel. After deploying on JBoss, please run the app from URL http://localhost:8080/cameljboss/run.htm?type=jaxb. You should see the stacktrace.

Comment 9 Geoffrey De Smet 2012-06-12 21:01:11 UTC
Thanks rsynek, I managed to reproduce it locally thanks to your war.

Comment 10 Geoffrey De Smet 2012-06-12 22:00:49 UTC
Our current working theory is that:
- the jaxb version difference makes no difference (the war failes no matter what). We haven't been able to verify this yet though (when deploying to tomcat with jaxb 2.2.* it gives another exception)
- it's caused by the JaxbCommandExecutor. createRouteBuilder(...) method that forgets to do something like jdf = DroolsPolicy.augmentJaxbDataFormatDefinition( jdf ).

We're trying to verify that now.

Comment 11 Geoffrey De Smet 2012-06-12 22:10:36 UTC
The DroolsPolicy.augmentJaxbDataFormatDefinition(...) is probably a red herring: no need to do that in normal code.

Comment 12 Geoffrey De Smet 2012-06-12 22:18:54 UTC
When deploying this war to JBoss 7.0.2 or Tomcat 6, we get "Content is not allowed in prolog", which is some sort of XML encoding problem. Therefor, we haven't been able to verify if the jaxb version matters.

Comment 13 Radovan Synek 2012-06-13 07:01:42 UTC
(In reply to comment #12)
> When deploying this war to JBoss 7.0.2 or Tomcat 6, we get "Content is not
> allowed in prolog", which is some sort of XML encoding problem. Therefor, we
> haven't been able to verify if the jaxb version matters.

This issue was revealed on JBoss EAP 5.1.2, I tried with Tomcat 6 just now and I got the same Exception as you. I think there is a problem with another issue: https://bugzilla.redhat.com/show_bug.cgi?id=814669

The JbossPackageScanClassResolver is needed when you want to deploy on JBoss, but on Tomcat 6 it seems it cause the problem you have described. After removing this line of code in AbstractCamelCommandExecutor.configure() : camelContext.setPackageScanClassResolver(new JBossPackageScanClassResolver());

it started working.

Comment 15 Geoffrey De Smet 2012-06-13 08:58:03 UTC
Rsynek verified that the reproducer war is now successfull with the BRMS build.
There is a separate pretty xml issue discussion, but that's no blocker.

Comment 16 Geoffrey De Smet 2012-06-13 09:00:01 UTC
Changes also forward ported to 5.4.x and master.

Comment 17 Ryan Zhang 2012-06-13 09:32:30 UTC
This issue's fixes  have been picked by ER9. Please verify them on ER9.

Comment 18 Radovan Synek 2012-06-14 07:35:03 UTC
Verified on ER9.

Comment 24 Red Hat Bugzilla 2025-02-10 03:20:02 UTC
This product has been discontinued or is no longer tracked in Red Hat Bugzilla.


Note You need to log in before you can comment on or make changes to this bug.