Bug 834009 - Errai examples cannot be run in JBDS out of the box
Errai examples cannot be run in JBDS out of the box
Status: CLOSED CURRENTRELEASE
Product: JBoss Enterprise WFK Platform 2
Classification: JBoss
Component: Examples, Errai (Show other bugs)
2.0.0.CR1,2.1.0
Unspecified Unspecified
high Severity high
: CR1
: 2.1.0
Assigned To: Stefan Miklosovic
Karel Piwko
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-06-20 11:08 EDT by Tomas Remes
Modified: 2015-08-02 19:41 EDT (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
If you import an Errai based example in JBoss Developer Studio, example will not work out of the box. Following steps have to be done in order to make it deployable from IDE: 1. Install Google Plugin + Web Toolkit: Go to JBoss Central, select Software/Updates tab and install required software. 2. Add GWT Entry Module: Select project, right click on Properties, go to Google/Web Toolkit tab and add Entry point module. Dialog will offer you existing modules, for example "HelloWorld" 3. Compile GWT classes: Select project, right click on the Google/GWT Compile 4. Add Errai marshalling output to the Deployement assembly: Select project, right click on Properties, go to Deployment Assembly tab and add following: /target/classes WEB-INF/classes 5. Add GWT compiler output to the Deployement assembly: Select project, right click on Properties, go to Deployment Assembly tab and add following: /target/${finalName} / ${finalName} depends on you project settings, it can be for instance "errai-bus-demos-helloworld-2.0.1.Final-redhat-1 6. Now you can deploy the application using standard means in JBoss Developer Studio.
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-11-30 10:33:58 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Tomas Remes 2012-06-20 11:08:51 EDT
Description of problem: 
Helloworld-errai example deploys fine via JBDS and works also fine, but when clicking to "Say Hello" button, following exception appears in the log:

java.lang.NullPointerException
 	at org.jboss.errai.marshalling.server.MappingContextSingleton.loadPrecompiledMarshallers(MappingContextSingleton.java:99)
 	at org.jboss.errai.marshalling.server.MappingContextSingleton.<clinit>(MappingContextSingleton.java:79)
 	at org.jboss.errai.bus.server.io.MessageFactory.getParts(MessageFactory.java:109)
 	at org.jboss.errai.bus.server.io.MessageFactory.createCommandMessage(MessageFactory.java:93)
 	at org.jboss.errai.bus.server.servlet.DefaultBlockingServlet.doPost(DefaultBlockingServlet.java:117)
 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:754)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
 	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:329)
 	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248)
 	at org.jboss.weld.servlet.ConversationPropagationFilter.doFilter(ConversationPropagationFilter.java:62)
 	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280)
 	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248)
 	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275)
 	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161)
 	at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:153)
 	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:155)
 	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
 	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
 	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:368)
 	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877)
 	at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:679)
 	at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:931)
 	at java.lang.Thread.run(Thread.java:662)
java.lang.RuntimeException: Error instantiating org.jboss.errai.marshalling.client.marshallers.ListMarshaller
 	at org.jboss.errai.marshalling.server.MappingContextSingleton$3.loadMarshallers(MappingContextSingleton.java:234)
 	at org.jboss.errai.marshalling.server.MappingContextSingleton$3.<init>(MappingContextSingleton.java:158)
 	at org.jboss.errai.marshalling.server.MappingContextSingleton.loadDynamicMarshallers(MappingContextSingleton.java:153)
 	at org.jboss.errai.marshalling.server.MappingContextSingleton.<clinit>(MappingContextSingleton.java:85)
 	at org.jboss.errai.bus.server.io.MessageFactory.getParts(MessageFactory.java:109)
 	at org.jboss.errai.bus.server.io.MessageFactory.createCommandMessage(MessageFactory.java:93)
 	at org.jboss.errai.bus.server.servlet.DefaultBlockingServlet.doPost(DefaultBlockingServlet.java:117)
 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:754)
 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
 	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:329)
 	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248)
 	at org.jboss.weld.servlet.ConversationPropagationFilter.doFilter(ConversationPropagationFilter.java:62)
 	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280)
 	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248)
 	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275)
 	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161)
 	at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:153)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:155)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
 	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:368)
 	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877)
 	at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:679)
 	at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:931)
 	at java.lang.Thread.run(Thread.java:662)
 Caused by: java.lang.IllegalStateException: Mapping definition collision for java.util.List
 Already have: MappingDefinition [mappingClass=java.util.List, clientMarshallerClass=class org.jboss.errai.marshalling.client.marshallers.ListMarshaller, serverMarshallerClass=null]
) Attempted to add: MappingDefinition [mappingClass=java.util.List, clientMarshallerClass=class org.jboss.errai.marshalling.client.marshallers.ListMarshaller, serverMarshallerClass=null]
 	at org.jboss.errai.marshalling.rebind.DefinitionsFactoryImpl.putDefinitionIfAbsent(DefinitionsFactoryImpl.java:118)
 	at org.jboss.errai.marshalling.rebind.DefinitionsFactoryImpl.addDefinition(DefinitionsFactoryImpl.java:101)
 	at org.jboss.errai.marshalling.server.MappingContextSingleton$3.loadMarshallers(MappingContextSingleton.java:202)
 	... 24 more


Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.
2.
3.
  
Actual results:


Expected results:


Additional info:
Comment 1 Karel Piwko 2012-06-21 04:14:38 EDT
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
If you import an Errai based example in JBoss Developer Studio, example will not work out of the box. Following steps have to be done in order to make it deployable from IDE:

1. Install Google Plugin + Web Toolkit:
    Go to JBoss Central, select Software/Updates tab and install required software.

2. Add GWT Entry Module:
    Select project, right click on Properties, go to Google/Web Toolkit tab and add Entry point module. Dialog will offer you existing modules, for example "HelloWorld"

3. Compile GWT classes:
    Select project, right click on the Google/GWT Compile

4. Add Errai marshalling output to the Deployement assembly:
   Select project, right click on Properties, go to Deployment Assembly tab and add following:

   /target/classes  WEB-INF/classes

5. Add GWT compiler output to the Deployement assembly:
   Select project, right click on Properties, go to Deployment Assembly tab and add following:

   /target/${finalName}  /

   ${finalName} depends on you project settings, it can be for instance "errai-bus-demos-helloworld-2.0.1.Final-redhat-1

6. Now you can deploy the application using standard means in JBoss Developer Studio.
Comment 4 Karel Piwko 2012-11-12 08:57:08 EST
Verified in WFK 2.1.0.CR1, using JBDS 5.0.1 and 6.0.1.Beta1 on errai-cdi examples, errai-jpa examples and helloworld-errai example. The workaround is no longer needed.
Comment 5 Karel Piwko 2012-11-30 10:33:58 EST
Distributed as a part of WFK 2.1.0.GA release.

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