-
1. Re: serializableTypes
pablo.mmarcondes Jun 4, 2010 2:34 PM (in response to pablo.mmarcondes)Hi guys, I think I've found a problem with this serializableTypes thing, when using it with classes without enum, it passes the compilation, but at deploy time I got this:
Caused by: java.lang.ClassNotFoundException: errai.bus.serializableTypesat java.net.URLClassLoader$1.run(URLClassLoader.java:202)at java.security.AccessController.doPrivileged(Native Method)at java.net.URLClassLoader.findClass(URLClassLoader.java:190)at org.glassfish.web.loader.WebappClassLoader.findClass(WebappClassLoader.java:959)at org.glassfish.web.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1430)at java.lang.Class.forName0(Native Method)at java.lang.Class.forName(Class.java:169)at org.jboss.errai.bus.server.service.bootstrap.DiscoverServices.execute(DiscoverServices.java:210)... 98 moreand looking at the code it seems that this code :
Enumeration<String> keys = bundle.getKeys();
while(keys.hasMoreElements())
{
String key = keys.nextElement();
if(key.equals(ErraiServiceConfigurator.CONFIG_ERRAI_SERIALIZABLE_TYPE))
{
for (String s : key.split(" ")) {
try {
Class<?> cls = Class.forName(s.trim());
should be something like this:
Enumeration<String> keys = bundle.getKeys();
while(keys.hasMoreElements())
{
String key = keys.nextElement();
if(key.equals(ErraiServiceConfigurator.CONFIG_ERRAI_SERIALIZABLE_TYPE))
{
String value = bundle.getString(key);
for (String s : value.split(" ")) {
try {
Class<?> cls = Class.forName(s.trim());
what do you think?
-
2. Re: serializableTypes
cbrock Jun 7, 2010 10:55 PM (in response to pablo.mmarcondes)Interesting. I'm responding from my cellphone right now. I will definitely look into this tomorrow. Can you log a JIRA?
-
3. Re: serializableTypes
pablo.mmarcondes Jun 9, 2010 7:39 AM (in response to cbrock)I've found that Heiko Braun has created this issue, but why is it associated to CDI?
Heiko Braun created ERRAI-82 (Provide an API to register serializable types from external context (CDI))
-
4. Re: serializableTypes
cbrock Jun 9, 2010 5:37 PM (in response to pablo.mmarcondes)1 of 1 people found this helpfulThat's actually a separate issue. But I can now confirm the enum issue is fixed in trunk. However, all enums must be exposed just like normal classes with @ExposeEntity or in the properties file per the docs, otherwise you will experience a failure.
-
5. Re: serializableTypes
pablo.mmarcondes Jun 10, 2010 3:38 PM (in response to cbrock)I saw your implementation, but I think the DiscoverServices class is not correct by this line:
for (String s : key.split(" ")) {
applying this diff, Ive managed to get the external classes recognized:
Index: src/main/java/org/jboss/errai/bus/server/service/bootstrap/DiscoverServices.java===================================================================--- src/main/java/org/jboss/errai/bus/server/service/bootstrap/DiscoverServices.java (revision 1602)+++ src/main/java/org/jboss/errai/bus/server/service/bootstrap/DiscoverServices.java (working copy)@@ -219,7 +219,8 @@while (keys.hasMoreElements()) {String key = keys.nextElement();if (key.equals(ErraiServiceConfigurator.CONFIG_ERRAI_SERIALIZABLE_TYPE)) {- for (String s : key.split(" ")) {+ String value = bundle.getString(key);+ for (String s : value.split(" ")) {try {Class<?> cls = Class.forName(s.trim());log.info("Marked " + cls + " as serializable.");but the Enum serialization is not working yet as it should be, I've got this error:
[ERROR] Type annotated with @ExposeEntity does not expose a default constructor
[INFO] java.lang.NoSuchMethodException: com.ati.sglweb.sglclient.shared.dto.basics.ExecutedActionType.<init>()
[INFO] at java.lang.Class.getConstructor0(Class.java:2706)
[INFO] at java.lang.Class.getConstructor(Class.java:1657)
[INFO] at org.jboss.errai.bus.rebind.BusClientConfigGenerator.generateMarshaller(BusClientConfigGenerator.java:123)
[INFO] at org.jboss.errai.bus.rebind.BusClientConfigGenerator.generate(BusClientConfigGenerator.java:94)Can someone help me on these, please?
Thanks in advance,
Pablo
-
6. Re: serializableTypes
cbrock Jun 11, 2010 11:59 AM (in response to pablo.mmarcondes)So you are configuring the type in a properties file or are you using @ExposeEntity?
-
7. Re: serializableTypes
pablo.mmarcondes Jun 11, 2010 4:02 PM (in response to cbrock)This error occur when Im using the properties file, because the classes are on an external jar
-
8. Re: serializableTypes
cbrock Jun 11, 2010 4:04 PM (in response to pablo.mmarcondes)Should be fixed now.
-
9. Re: serializableTypes
pablo.mmarcondes Jun 14, 2010 7:30 AM (in response to cbrock)We will test it today and give a feedback, thanks!
-
10. Re: serializableTypes
pablo.mmarcondes Jun 17, 2010 10:12 AM (in response to pablo.mmarcondes)Sorry for the delay, but with the svn code from today, its not working for enums yet.
[ERROR] org.jboss.errai.bus.server.ErraiBootstrapFailure: org.jboss.errai.bus.rebind.GenerationException: Type annotated with @ExposeEntity does not expose a default constructor
[ERROR] at org.jboss.errai.bus.rebind.BusClientConfigGenerator.generate(BusClientConfigGenerator.java:97)
[ERROR] at org.jboss.errai.bus.rebind.ExtensionProxyGenerator.generateExtensions(ExtensionProxyGenerator.java:128)
[ERROR] at org.jboss.errai.bus.rebind.ExtensionProxyGenerator.generateClass(ExtensionProxyGenerator.java:105)
[ERROR] at org.jboss.errai.bus.rebind.ExtensionProxyGenerator.generate(ExtensionProxyGenerator.java:66)
[ERROR] at com.google.gwt.dev.javac.StandardGeneratorContext.runGenerator(StandardGeneratorContext.java:418)
[ERROR] at com.google.gwt.dev.cfg.RuleGenerateWith.realize(RuleGenerateWith.java:38)
[ERROR] at com.google.gwt.dev.shell.StandardRebindOracle$Rebinder.tryRebind(StandardRebindOracle.java:108)
[ERROR] at com.google.gwt.dev.shell.StandardRebindOracle$Rebinder.rebind(StandardRebindOracle.java:54)
[ERROR] at com.google.gwt.dev.shell.StandardRebindOracle.rebind(StandardRebindOracle.java:154)
[ERROR] at com.google.gwt.dev.shell.StandardRebindOracle.rebind(StandardRebindOracle.java:143)
[ERROR] at com.google.gwt.dev.Precompile$DistillerRebindPermutationOracle.getAllPossibleRebindAnswers(Precompile.java:317)
[ERROR] at com.google.gwt.dev.jdt.WebModeCompilerFrontEnd.doFindAdditionalTypesUsingRebinds(WebModeCompilerFrontEnd.java:95)
[ERROR] at com.google.gwt.dev.jdt.AbstractCompiler$Sandbox$CompilerImpl.process(AbstractCompiler.java:200)
[ERROR] at org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:444)
[ERROR] at com.google.gwt.dev.jdt.AbstractCompiler$Sandbox$CompilerImpl.compile(AbstractCompiler.java:123)
[ERROR] at com.google.gwt.dev.jdt.AbstractCompiler$Sandbox$CompilerImpl.compile(AbstractCompiler.java:234)
[ERROR] at com.google.gwt.dev.jdt.AbstractCompiler$Sandbox$CompilerImpl.access$200(AbstractCompiler.java:109)
[ERROR] at com.google.gwt.dev.jdt.AbstractCompiler.compile(AbstractCompiler.java:522)
[ERROR] at com.google.gwt.dev.jdt.BasicWebModeCompiler.getCompilationUnitDeclarations(BasicWebModeCompiler.java:112)
[ERROR] at com.google.gwt.dev.jdt.WebModeCompilerFrontEnd.getCompilationUnitDeclarations(WebModeCompilerFrontEnd.java:47)
[ERROR] at com.google.gwt.dev.jjs.JavaToJavaScriptCompiler.precompile(JavaToJavaScriptCompiler.java:422)
[ERROR] at com.google.gwt.dev.jjs.JavaScriptCompiler.precompile(JavaScriptCompiler.java:32)
[ERROR] at com.google.gwt.dev.Precompile.precompile(Precompile.java:522)
[ERROR] at com.google.gwt.dev.Precompile.precompile(Precompile.java:414)
[ERROR] at com.google.gwt.dev.Compiler.run(Compiler.java:201)
[ERROR] at com.google.gwt.dev.Compiler$1.run(Compiler.java:152)
[ERROR] at com.google.gwt.dev.CompileTaskRunner.doRun(CompileTaskRunner.java:87)
[ERROR] at com.google.gwt.dev.CompileTaskRunner.runWithAppropriateLogger(CompileTaskRunner.java:81)
[ERROR] at com.google.gwt.dev.Compiler.main(Compiler.java:159)
[ERROR] Caused by: org.jboss.errai.bus.rebind.GenerationException: Type annotated with @ExposeEntity does not expose a default constructor
[ERROR] at org.jboss.errai.bus.rebind.BusClientConfigGenerator.generateMarshaller(BusClientConfigGenerator.java:128)
[ERROR] at org.jboss.errai.bus.rebind.BusClientConfigGenerator.generate(BusClientConfigGenerator.java:94)
[INFO] [ERROR] Error generating extensions -
11. Re: serializableTypes
cbrock Jun 18, 2010 6:56 PM (in response to pablo.mmarcondes)Would you be willing to post some example code? I can't seem to reproduce this.
-
12. Re: serializableTypes
pablo.mmarcondes Jun 22, 2010 4:10 PM (in response to cbrock)I will do that, we've got comet working fine with atmosphere-gwt-comet, but we want to make it work with errai too, so we can compare both.
-
13. Re: serializableTypes
pablo.mmarcondes Jul 7, 2010 10:17 AM (in response to cbrock)Hi,
We've found that using your example project errai-bus-demos-serialization, and configuring it to use serialization from properties config file:
adding errai.bus.serializableTypes=org.errai.samples.serialization.client.model.RecordType to file ErraiApp.properties
we could reproduce the error we are facing with our project.
Can you try that on your side?
Regards
-
14. Re: serializableTypes
cbrock Jul 10, 2010 12:09 PM (in response to pablo.mmarcondes)I'll definitely look at this.