Author |
Message |
![[Post New]](/jwsForum219/templates/default/images/icon_minipost_new.gif) 24/04/2012 13:05:10
|
stephezapo
jWebSocket Forum User
Joined: 22/04/2012 14:31:52
Messages: 2
Offline
|
Hello,
I am new to jWebSocket and trying to use it now with my own applications.
I downloaded the server and client package, extracted it into a folder and set the JWEBSOCKET_HOME accordingly.
The server bat script works fine, I can use the demos provided in the client package.
No I am trying to implement my own server in netbeans.
I added the libraries jWebSocket-Common, ...-Server and -ServerAPI to my project and wrote the following:
In a main class I instantiate a new class object and call init(), but the JWebSocketFactory.start() returns a nullPoint Exception
java.lang.NullPointerException
at org.jwebsocket.factory.JWebSocketFactory.start(JWebSocketFactory.java:119)
at org.jwebsocket.factory.JWebSocketFactory.start(JWebSocketFactory.java:83)
at webserver.WebSocketServer.init(WebSocketServer.java:2
at webserver.WebServer.main(WebServer.java:19)
What is wrong here?
|
|
 |
![[Post New]](/jwsForum219/templates/default/images/icon_minipost_new.gif) 24/04/2012 19:53:01
|
aschulze
jWebSocket Owner
![[Avatar]](/jwsForum219/images/avatar/eccbc87e4b5ce2fe28308fd9f2a7baf3.jpg)
Joined: 16/03/2010 18:15:55
Messages: 375
Location: Germany, Herzogenrath
Offline
|
Hi stephezapo,
these are the first two lines which are mandatory to start up the server:Please insert these lines and the server should start up, don't hesitate to contact us again in case of further questions.
Best Regards
Alex
|
|
 |
![[Post New]](/jwsForum219/templates/default/images/icon_minipost_new.gif) 26/04/2012 15:41:10
|
stephezapo
jWebSocket Forum User
Joined: 22/04/2012 14:31:52
Messages: 2
Offline
|
That worked, thank you very much! initForConsoleApp() was missing in my code.
|
|
 |
![[Post New]](/jwsForum219/templates/default/images/icon_minipost_new.gif) 17/05/2012 11:47:30
|
sanjay
jWebSocket Forum User
Joined: 17/05/2012 11:38:54
Messages: 2
Offline
|
jwebsocket config.init for console(aArgs);
hello sir,
i am not able to understand, that what should i pass here in jwebsocket config.init for console(____what to pass______);
|
|
 |
![[Post New]](/jwsForum219/templates/default/images/icon_minipost_new.gif) 17/05/2012 11:50:49
|
sanjay
jWebSocket Forum User
Joined: 17/05/2012 11:38:54
Messages: 2
Offline
|
Error initializing engine based on given configuration
i m also facing above error
|
|
 |
![[Post New]](/jwsForum219/templates/default/images/icon_minipost_new.gif) 24/05/2012 14:04:49
|
JayJay
jWebSocket Forum User
Joined: 21/02/2012 12:42:55
Messages: 21
Offline
|
Do i still need this in the newest Version?
i don't have this method in my org.jwebsocket.config.JWebSocketConfig Class??
initForConsoleApp(aArgs);
What exactly is it doing?
Btw it seems like in the newest version there is no standard Tokenserver starting automatically? When i use the getServers method at the WebSocketFactory i get null as answer. is that correct?
This message was edited 1 time. Last update was at 24/05/2012 15:29:45
|
|
 |
![[Post New]](/jwsForum219/templates/default/images/icon_minipost_new.gif) 22/06/2012 00:38:25
|
simpligility
jWebSocket Forum User
Joined: 21/06/2012 23:36:38
Messages: 1
Offline
|
I just fixed this problem in my test and I had to do this:
public void contextInitialized(ServletContextEvent aSCE) {
// http://enapso.org/jwsForum219/posts/list/15619.page
// the following line must not be removed due to GNU LGPL 3.0 license!
JWebSocketFactory.printCopyrightToConsole();
// check if home, config or bootstrap path are passed by command line
JWebSocketConfig.initForWebApp(aSCE.getServletContext());
// start the jWebSocket server sub system
JWebSocketFactory.start();
Is that the correct approach?
|
|
 |
|