Skip to main content

Java Web Service trouble in GlassFish

No replies
Joined: 2008-08-22


I have written a java web service using Eclipse Front end and GlassFish server using the Java Web Service API using annotations like @WebService etc. And it runs perfectly. This is the only problem i am facing.

I have a class called NotationReader with 3 methods exposed

1. loadXMLConfiguration() - This loads an XML and parses it and loads the information into 3 datastructures

2. getSmbolList() etc- These methods simply returns the datastructures.

This is the client i have written

NotationReaderService service = new NotationReaderService();

//create proxy
NotationReader proxy = service.getNotationReaderPort();


Now when i run the method for the first time, it returns the correct numbers 29,1,5 since the XML is read once, but if i run the client again ,it does not create a new NotationReader object but uses the same one hence the size of the datastructures double....everytime i run it.. is there any way to have the webservice so that everytime a client calls the service a new NotationReader object is created ? Any help would be appreciated.