{"class":"foam.box.Message","attributes":{},"object":{"class":"foam.box.NoSuchNameException","name":""}}
- {class: "foam.box.Message", attributes: {replyBox: {class: "foam.box.HTTPReplyBox"}},…}
- attributes:{replyBox: {class: "foam.box.HTTPReplyBox"}}
- class:"foam.box.Message"
- object:{class: "foam.box.SubBoxMessage", name: "Configuration", attributes: {},…}
- attributes:{}
- class:"foam.box.SubBoxMessage"
- name:"Configuration"
- object:{class: "foam.box.RPCMessage", name: "select_", args: [null, null, 0, 9007199254740991, null, null],…}
((BoxRegistryBox)x.get(BoxRegistryBox.class.getSimpleName())).send(msg);
The payload you posted has a subbox messages named 'Configuration' inside an additional subbox message also named 'Configuration' but I doubt that matches the server configuration.
I would investigate why it's being decorated twice.
I'm away from my computer at the moment so I can't point you to any examples but will try to do so later.
Most of our modern box stuff is in foam/nanos, but nanos doesn't currently use a box registry.
LocalBoxRegistry.doLookup
javaCode: `Object registration = getRegistry_().get(name);if ( registration == null ) { throw new RuntimeException("No such name");}return ((Registration)registration).getExportBox();` },
INFO: namespace: namespace, model:
com.serviceecho.ui.map.RouteConfiguration, class: class com.serviceecho.ui.map.RouteConfiguration
Dec 19, 2017 7:56:48 PM com.serviceecho.api.APIContext build
SEVERE: java.lang.RuntimeException: java.lang.ClassNotFoundException: Registration
java.lang.RuntimeException: java.lang.RuntimeException: java.lang.ClassNotFoundException: Registration
at foam.core.SimpleFacetManager.create(SimpleFacetManager.java:65)
at foam.core.AbstractX.create(EmptyX.java:63)
at foam.core.AbstractX.create(EmptyX.java:59)
at foam.box.LocalBoxRegistry.register(LocalBoxRegistry.java:106)
Joel Hughes <joel.l...@gmail.com> writes:
> LocalBoxRegistry failing with ClassNotFoundException on what I believe is this cast to 'Registration'.
> I can't find reference to Registration elsewhere so suspect something
> was removed/changed and this was missed.
Does your generated LocalBoxRegistry.java contain the Registration inner class?
public static class Registration extends foam.core.AbstractFObject {
>
> LocalBoxRegistry.doLookup
>
> javaCode: `
> Object registration = getRegistry_().get(name);
> if ( registration == null ) {
> throw new RuntimeException("No such name");
> }
> return ((Registration)registration).getExportBox();
> `
> },
>
> In my call LocalBoxRegistry.register I'm not requesting anything name Registration, hence I believe it's the cast above. The stack trace doesn't line exactly with the `` code blocks.
>
> INFO: namespace: namespace, model:
>
> com.serviceecho.ui.map.RouteConfiguration, class: class com.serviceecho.ui.map.RouteConfiguration
>
> Dec 19, 2017 7:56:48 PM com.serviceecho.api.APIContext build
>
> SEVERE: java.lang.RuntimeException: java.lang.ClassNotFoundException: Registration
>
> java.lang.RuntimeException: java.lang.RuntimeException: java.lang.ClassNotFoundException: Registration
>
> at foam.core.SimpleFacetManager.create(SimpleFacetManager.java:65)
>
> at foam.core.AbstractX.create(EmptyX.java:63)
>
> at foam.core.AbstractX.create(EmptyX.java:59)
>
> at foam.box.LocalBoxRegistry.register(LocalBoxRegistry.java:106)
>
> On Thursday, December 14, 2017 at 9:38:17 PM UTC-5, Joel Hughes wrote:
>
> Hi Adam
> So my servlet is modelled after origintrials.servlets.APIServlet, is this style still supported?
> I've been using this particular Servlet for probably close to a year now, something in the underlying box/registry in last couple of months has changed. I'm ok with refactoring as you do, but I've got nothing to go on.
>
> Thanks for any ideas.
> Joel
>
> On Thu, Dec 14, 2017 at 6:00 PM, Adam Van Ymeren <ad...@vany.ca> wrote:
>
> On December 14, 2017 3:36:22 PM EST, Joel Hughes <joel.l...@gmail.com> wrote:
>
> Adam
> Can you point me to a java servlet example so I can verify against my implemenetation?
> Thanks
> Joel
>
> ((BoxRegistryBox)x.get(BoxRegistryBox.class.getSimpleName())).send(msg);
>
> On Thursday, December 14, 2017 at 11:27:21 AM UTC-5, Joel Hughes wrote:
>
> Can anyone recall changes to Java HTTPBox naming in the past couple of months?
> Scanned the commit logs, but nothing jumped out.
>
> Upgrading/Updating an app last deployed in September with the last foam and getting the following on my requests to java running on Google App Engine.
>
> {"class":"foam.box.Message","attributes":{},"object":{"class":"foam.box.NoSuchNameException","name":""}}
>
> Request:
>
> 1 {class: "foam.box.Message", attributes: {replyBox: {class: "foam.box.HTTPReplyBox"}},…}
>
> 1 attributes:{replyBox: {class: "foam.box.HTTPReplyBox"}}
> 2 class:"foam.box.Message"
> 3 object:{class: "foam.box.SubBoxMessage", name: "Configuration", attributes: {},…}
>
> 1 attributes:{}
> 2 class:"foam.box.SubBoxMessage"
> 3 name:"Configuration"
> 4 object:{class: "foam.box.RPCMessage", name: "select_", args: [null, null, 0, 9007199254740991, null, null],…}
Joel Hughes <joel.l...@gmail.com> writes:
> Yes it does.
>
> public static class Registration extends foam.core.AbstractFObject {
Hmm, I probably can't use the context to create an inner class like
that. Can you pull and try again when you get a chance?
[jhughes@woodchuck foam2 (se_master)]$ git diff src/foam/dao/DatastoreDAO.java DatastoreDAO.java
diff --git a/src/foam/dao/DatastoreDAO.java b/src/foam/dao/DatastoreDAO.java
index 942064f5e..20dc3d84a 100644
--- a/src/foam/dao/DatastoreDAO.java
+++ b/src/foam/dao/DatastoreDAO.java
@@ -95,7 +95,10 @@ public class DatastoreDAO
serialize(subEntity, (FObject) value);
value = subEntity;
}
-
+ if (value != null &&
+ value.getClass().equals(String.class)) {
+ value = new Text((String)value);
+ }
target.setProperty(prop.getName(), value);
}
@@ -130,7 +133,10 @@ public class DatastoreDAO
if ( value instanceof EmbeddedEntity ) {
value = deserialize((EmbeddedEntity) value);
}
-
+ if (value != null &&
+ value.getClass().equals(Text.class)) {
+ value = ((Text)value).getValue();
+ }
prop.set(obj, value);
Joel Hughes <joel.l...@gmail.com> writes:
> Hi Adam
> Registration is now found.
> Thanks
>
> So now back to the original issue. I'll provide an update later.
What was the original issue?