Bug 1312887 - kie-server JSON doesn't work with singleton extra classes
Summary: kie-server JSON doesn't work with singleton extra classes
Keywords:
Status: CLOSED EOL
Alias: None
Product: JBoss BRMS Platform 6
Classification: Retired
Component: Kie-Server
Version: 6.2.0
Hardware: Unspecified
OS: Unspecified
medium
unspecified
Target Milestone: ER1
: 6.3.0
Assignee: Edson Tirelli
QA Contact: Karel Suta
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-02-29 12:52 UTC by Tomas Schlosser
Modified: 2020-03-27 20:04 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-03-27 20:04:03 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Tomas Schlosser 2016-02-29 12:52:03 UTC
Description of problem:
Using a code like this:
KieServicesConfiguration config = createJmsConfiguration();
config.setMarshallingFormat(MarshallingFormat.JSON);
config.setExtraJaxbClasses(Collections.singleton(clazz));
...
RuleServicesClient rules;
...
rules.executeCommands("testContainer", commands.newBatchExecution(commandList));

Throws unsupported operation exception:
java.lang.UnsupportedOperationException: null
	at java.util.AbstractCollection.add(AbstractCollection.java:262)
	at org.kie.server.api.marshalling.json.JSONMarshaller.<init>(JSONMarshaller.java:69)
	at org.kie.server.api.marshalling.MarshallerFactory.getMarshaller(MarshallerFactory.java:41)
	at org.kie.server.client.impl.AbstractKieServicesClientImpl.<init>(AbstractKieServicesClientImpl.java:72)
	at org.kie.server.client.impl.KieServicesClientImpl.<init>(KieServicesClientImpl.java:60)
	at org.kie.server.client.KieServicesFactory.newKieServicesClient(KieServicesFactory.java:93)
	at com.redhat.xpaas.brms.transport.TransportTest.evaluateRules(TransportTest.java:249)
	at com.redhat.xpaas.brms.transport.TransportTest.testRestJson(TransportTest.java:144)


Version-Release number of selected component (if applicable):
kie-server-api 6.3.0.Final.redhat-1

How reproducible:
Always

Additional info:
The problem is in JSONMarshaller:69 when the passed set is singleton/unmodifiable instance.

Comment 5 Karel Suta 2016-03-21 11:38:39 UTC
Verified in 6.3.0 ER1


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