Nev Mehta

Greenhorn
+ Follow
since Jan 09, 2007
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Nev Mehta

There was some mismatch in the version of classes i was using. It works now. Thanks for your answer.
11 years ago
I am implementing the AbstractFactory pattern allowing outsiders to create Factories. I am reading the factory implementation name from a properties file, loading the factory class and using it to construct objects. Problem is that somewhere in my factory implementation when i'm trying to create an object of a task i get the following error.



Following is the GetUrl constructor, nothing fancy!



Any feedback on what might be happening here? Cross posted at http://stackoverflow.com/questions/12667377/java-lang-classformaterror-while-loading-class
11 years ago
I have some code that had lots of (oracle) database accesses. I encountered 'too many open cursors' errors. Although i checked thoughroghly, i think i was missing out on closing some resources. I changed my source code to have a single method that executed queries and returned a CachedRowSet. My question is, being a disconnected resultset is it absolutely necessary to close the CachedRowSet? I did close the Statement objects and ResultSet objects from which i got the CachedRowSet object. Wont just resetting the old CachedRowSet with a new one be ok? Something like:-



Thanks
Neville
Yes it does and the solution was in the comments itself. As far as the reason is concerned i guess google will suffice. Thanks for pointing out.
12 years ago
Created a HelloWorld webservice to try to learn how to use objects as input and return params. I created the webservice which had a method



Following are the HelloWorldIn and HelloWorldOut objects



WSDL was generated, following was the XSD representation of the objects



Problem is when i generate stub classes using wsimport the setters for the List variable are missing for HelloWorldIn and HelloWorldOut. Any clues why this maybe happening?
12 years ago
Add target/generated-sources/gwt to the Eclipse build path. This is not done automatically, unfortunately. This solved my problem. Source
12 years ago
GWT
I created a GWT app project using the gwt-maven-plugin and added the same to eclipse. Tried running it from eclipse (as a web application) however got the following errors (screenshot). Any ideas on why this would be happening?

Would like to mention that the app builds fine and when i manually deploy that war file in tomcat, the app works as expected. However running from eclipse causes issues.

Cross posted here
12 years ago
GWT
So we would have some service objects (which are part of the model) which return populated Model objects to the Controller? Something like this.

So in that sense could we say that the UserService is also part of the model?
12 years ago
Where does the database code go in case of the MVC model? We could take the example SimpleCommand.war (https://coderanch.com/how-to/java/CodeBarnSimpleCommand) as a reference. So would the database connection go in one of the 'command classes'? If yes, then the database connection code would be part of the controller and not the model right?
12 years ago
I am trying to use JNDI to create a new binding while using 'RefFSContextFactory'. So what i am trying to do is create a new File using JNDI. However this code throws an exception javax.naming.OperationNotSupportedException: Can only bind References or Referenceable objects.

Was not trying to divert attention on purpose; i just thought this maybe the issue. Also, had no idea we needed to mention the we have cross-posted, will do that next time. Thanks for the help.
14 years ago
So on doing some debugging i realized that the http thread that started executing may have not exited correctly. That may explain the fact that when i shut the java server down explicitly while the 'php' code waits for some response, the response suddenly appears.

While creating the server i am using:-


In ThreadPoolExecutor.class




Using the debugger tool took me to the class ThreadPoolExecutor.class which seems to be the bottleneck; This condition is true (poolSize > corePoolSize || allowCoreThreadTimeOut(=false)) and it starts polling. I think maybe this is causing the problem and if it exited maybe the result would appear. Even if the corePoolSize is more than poolsize it seems to be getting stuck in .

I dont know how it works ok with a browser but hangs when PHP request comes into the picture. Strange...

Thanks
Neville
14 years ago
Content length is known and set in headers;
14 years ago
Hello all,

I have created an httpserver using 'com.sun.net.httpserver'. Everything works fine except one thing.

When i make this simple call from PHP (http://localhost:8081/something outputs an XML file):-


Nothing appears and it times out after sometime.

However, while the browser is 'trying' to get the result (from PHP file) if i 'stop' my HttpServer (Java) the result suddenly appears. I am very sure i close all the streams i opened. Does anyone have any idea?

Thanks
Neville
14 years ago
Don't know if i'm thinking correct but shouldn't splitting on 'nothing' mean the entire string becomes one token. Wouldnt this always be false (where NOTHING is empty string)?
14 years ago