File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Java in General and the fly likes Can't find using netbeans, hibernate and glassfish Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Can Watch "Can New topic

Can't find using netbeans, hibernate and glassfish

Alvaro Reinoso

Joined: Feb 14, 2012
Posts: 4

I'm getting this error when I run my web application using netbeans and glassfish:

I really need to debug the hibernate queries. file is configured, but it seems my app can't find it.

This the class where I initialize the logger:

I want to store in cfg folder. Even if I try PropertyConfigurator.configure("") (also hardcoding the path) and put the file in src folder, it can't find.

Any help would be really useful.

Paul Clapham

Joined: Oct 14, 2005
Posts: 19973

The normal way to configure log4j is to put the file in the classpath. That's all you need to do... unless you are trying to configure something which isn't in the properties file. Your code doesn't do anything like that, so you should remove it entirely.

As for putting it into the classpath, your Netbeans cfg directory definitely isn't going to be the right place. In real life your Glassfish server won't care about Netbeans at all, or even know about it. I try to arrange things so that my file gets put into the web application's /WEB-INF/classes directory. I assume Netbeans can arrange that for you but (not being a Netbeans user) I can't tell you how.
I agree. Here's the link:
subject: Can't find using netbeans, hibernate and glassfish
It's not a secret anymore!