To do interface that utilizes REST doesn't work
Tried to deploy the code in Netbeans 8.0.1 IDE with Glassfish 4.0. The Websocket sample worked fine. However the TO DO didn't work. Looks like an issue with the REST interface ( tried to invoke the separately in the browser). Below is the stack trace error:
HTTP Status 500 - Internal Server Error
type Exception report
messageInternal Server Error
descriptionThe server encountered an internal error that prevented it from fulfilling this request.
exception
javax.servlet.ServletException: A MultiException has 3 exceptions. They are:
- org.glassfish.hk2.api.UnsatisfiedDependencyException: There was no object available for injection at Injectee(requiredType=ToDoService,parent=ToDoResource,qualifiers={}),position=-1,optional=false,self=false,unqualified=null,84300295)
- java.lang.IllegalArgumentException: While attempting to resolve the dependencies of org.glassfish.javaee.javascript.backend.todo.ToDoResource errors were found
- java.lang.IllegalStateException: Unable to perform operation: resolve on org.glassfish.javaee.javascript.backend.todo.ToDoResource
This is likely a bug that was in GF 4.0 that has already been fixed. Can you try with 4.1 and let me know what happens? If so, I'll update the instructions to use GF 4.1 and not GF 4.0.
Sorry for the delayed response. I tried with Glass Fish 4.1 and it looks the server side (CDI injection) error is gone. There is no error in Glassfish console. But "To DO" feature still doesn't work and it gives the following error in the chrome console output (I used the credentials reza/secret1)
https://localhost:8181/javaee-javascript/resources/todo/reza Failed to load resource: net::ERR_CONNECTION_REFUSED https://localhost:48566/javaee-javascript/todo.jsp Failed to load resource: net::ERR_CACHE_MISS
I see. It looks like the issue is that the application is expecting GF to run on port 8181 but it is actually running on port 48566. I would either change the port or change the code.