Java break - ObjectId, WriteListener

228 views
Skip to first unread message

Joel Hughes

unread,
Jun 8, 2017, 9:37:31 PM6/8/17
to foam-framework-discuss
A couple Java compilation issues from the recent ObjectId changes:

/Users/jhughes/workspace/jbbmobile/repos/sesad/node_modules/foam2/java_src/foam/dao/history/HistoryDAO.java:74: error: method setObjectId in class HistoryRecord cannot be applied to given types;
    historyRecord.setObjectId(objectId);
                 ^
  required: String
  found: Object
  reason: actual argument Object cannot be converted to String by method invocation conversion
/Users/jhughes/workspace/jbbmobile/repos/sesad/node_modules/foam2/java_src/foam/nanos/http/ServletHandler.java:112: error: <anonymous foam.nanos.http.ServletHandler$ResponseWrapper$1> is not abstract and does not override abstract method setWriteListener(WriteListener) in ServletOutputStream
    final ServletOutputStream   servletOutputStream = new ServletOutputStream() {
                                                                                ^
/Users/jhughes/workspace/jbbmobile/repos/sesad/node_modules/foam2/java_src/foam/nanos/http/ServletHandler.java:196: error: <anonymous foam.nanos.http.ServletHandler$1> is not abstract and does not override abstract method setReadListener(ReadListener) in ServletInputStream
    final ServletInputStream   is       = new ServletInputStream() {
                                                                   ^

Joel

Kevin Greer

unread,
Jun 8, 2017, 9:59:08 PM6/8/17
to Joel Hughes, foam-framework-discuss
Fixed. Thx

--
You received this message because you are subscribed to the Google Groups "foam-framework-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to foam-framework-discuss+unsub...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Joel Hughes

unread,
Jun 8, 2017, 10:03:16 PM6/8/17
to Kevin Greer, foam-framework-discuss
Almost, still have:  (this may be a duplicate - the forum is hung for me at the moment).

/Users/jhughes/workspace/jbbmobile/repos/sesad/node_modules/foam2/java_src/foam/nanos/http/ServletHandler.java:112: error: <anonymous foam.nanos.http.ServletHandler$ResponseWrapper$1> is not abstract and does not override abstract method setWriteListener(WriteListener) in ServletOutputStream
    final ServletOutputStream   servletOutputStream = new ServletOutputStream() {
                                                                                ^
/Users/jhughes/workspace/jbbmobile/repos/sesad/node_modules/foam2/java_src/foam/nanos/http/ServletHandler.java:196: error: <anonymous foam.nanos.http.ServletHandler$1> is not abstract and does not override abstract method setReadListener(ReadListener) in ServletInputStream
    final ServletInputStream   is       = new ServletInputStream() {
Fixed. Thx

To unsubscribe from this group and stop receiving emails from it, send an email to foam-framework-discuss+unsubscri...@googlegroups.com.

Kevin Greer

unread,
Jun 8, 2017, 10:11:28 PM6/8/17
to Joel Hughes, foam-framework-discuss
Compiles fine for me with Java 1.8 Servlet 2.5. What versions are you using?

Joel Hughes

unread,
Jun 8, 2017, 10:32:02 PM6/8/17
to Kevin Greer, foam-framework-discuss
Occurs with a target of 1.7 or 1.8. 
Servlet 2.5.

When did you guys switch to target java 1.8? That is significant.  
I'll keep poking around.
Joel

Joel Hughes

unread,
Jun 8, 2017, 10:54:22 PM6/8/17
to Kevin Greer, foam-framework-discuss
I compile with java target 1.7 as GAE only supports Java 1.7.
I've verified that I'm using the same libraries and versions as in your pom.xml. 
There isn't much to play around with.

I have to make the following manual edits to get things compiled:

diff --git a/java_src/foam/nanos/http/ServletHandler.java b/java_src/foam/nanos/http/ServletHandler.java
index 8d13557..cce5dd1 100644
--- a/java_src/foam/nanos/http/ServletHandler.java
+++ b/java_src/foam/nanos/http/ServletHandler.java
@@ -115,6 +115,9 @@ public class ServletHandler
       public void write(int b) throws IOException {
         outputStream.write(b);
       }
+      @Override
+      public void setWriteListener(WriteListener listener) {}
+      public boolean isReady() { return true; }
     };

     protected final HttpExchange ex;
@@ -199,6 +202,10 @@ public class ServletHandler
       public int read() throws IOException {
         return newInput.read();
       }
+      @Override
+      public void setReadListener(ReadListener listener) {}
+      public boolean isReady() { return true; }
+      public boolean isFinished() { return false; }
     };

     Map<String, String[]> parsePostData = new HashMap<>();
Reply all
Reply to author
Forward
0 new messages