jWebSocket Forum

[Search] Search   [Recent Topics] Recent Topics   [Hottest Topics] Hottest Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
NullPointer Exception when trying to implement a sample token server.  XML
Forum Index » Installation and Configuration
Author Message

jWebSocket Forum User

Joined: 22/04/2012 14:31:52
Messages: 2


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

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?

jWebSocket Owner

Joined: 16/03/2010 18:15:55
Messages: 375
Location: Germany, Herzogenrath

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

jWebSocket Forum User

Joined: 22/04/2012 14:31:52
Messages: 2

That worked, thank you very much! initForConsoleApp() was missing in my code.


jWebSocket Forum User

Joined: 17/05/2012 11:38:54
Messages: 2

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______);


jWebSocket Forum User

Joined: 17/05/2012 11:38:54
Messages: 2

Error initializing engine based on given configuration
i m also facing above error

jWebSocket Forum User

Joined: 21/02/2012 12:42:55
Messages: 21

Do i still need this in the newest Version?

i don't have this method in my org.jwebsocket.config.JWebSocketConfig Class??


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


jWebSocket Forum User

Joined: 21/06/2012 23:36:38
Messages: 1

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!

// check if home, config or bootstrap path are passed by command line

// start the jWebSocket server sub system

Is that the correct approach?
[Email] [WWW]
Forum Index » Installation and Configuration
Go to:   
Powered by JForum 2.1.9 © JForum Team