Menu
I'm using netbeans to create a simple java maven application with a very simple JavaDB database connectivity. I've configured the dependencies in maven pom.xml file as follows, and my application w.
I've a simple VWP application that is not working so far. I get a server log error that reads as follows: Unexpected exception while creating resource Failed to obtain/create connection. Reason: Class name is wrong or classpath is not set for: org.apache.derby.jdbc.ClientDataSource Error allocating connection: Error in allocating a connection. Cause: Class name is wrong or classpath is not set for: org.apache.derby.jdbc.ClientDataSource It looks like I need to include derbyclient.jar in my CLASSPATH, but I cannot locate where this jar file is. I've SUNWappserv under /opt/SUNWappserv I've /opt/netbeans-5.5.1/rave2.0 I've /usr/local/jdk1.6.002 and have searched in these and in their sub folders but cannot locate derbyclient.jar ANY ONE KNOWS WHERE THIS derbycliet.jar file can be found? I do appreciate your kind help.
The derbyclient.jar should be in the app server installation. What version of the Sun App Server are you using? All of the Derby files are under the directory 'javadb', which is immediately under the top-level app server installation directory. The derbyclient.jar is in the lib subdirectory. (The above applies for SJSAS v9; for v8, the organization is the same, but the database directory is named 'derby'.) Please check the appropriate location, and see if the library is there.Jim On 7/16/07 8:07 PM, rrugemalira wrote. I've a simple VWP application that is not working so far. I get a server log error that reads as follows: Unexpected exception while creating resource Failed to obtain/create connection.
Reason: Class name is wrong or classpath is not set for: org.apache.derby.jdbc.ClientDataSource Error allocating connection: Error in allocating a connection. Cause: Class name is wrong or classpath is not set for: org.apache.derby.jdbc.ClientDataSource It looks like I need to include derbyclient.jar in my CLASSPATH, but I cannot locate where this jar file is. I've SUNWappserv under /opt/SUNWappserv I've /opt/netbeans-5.5.1/rave2.0 I've /usr/local/jdk1.6.002 and have searched in these and in their sub folders but cannot locate derbyclient.jar ANY ONE KNOWS WHERE THIS derbycliet.jar file can be found?
I do appreciate your kind help. The derbyclient.jar should be in the app server installation. What version of the Sun App Server are you using?
All of the Derby files are under the directory 'javadb', which is immediately under the top-level app server installation directory. The derbyclient.jar is in the lib subdirectory.
(The above applies for SJSAS v9; for v8, the organization is the same, but the database directory is named 'derby'.) Please check the appropriate location, and see if the library is there.Jim On 7/16/07 8:07 PM, rrugemalira wrote: I've a simple VWP application that is not working so far. I get a server log error that reads as follows: Unexpected exception while creating resource Failed to obtain/create connection.
Reason: Class name is wrong or classpath is not set for: org.apache.derby.jdbc.ClientDataSource Error allocating connection: Error in allocating a connection. Cause: Class name is wrong or classpath is not set for: org.apache.derby.jdbc.ClientDataSource It looks like I need to include derbyclient.jar in my CLASSPATH, but I cannot locate where this jar file is. I've SUNWappserv under /opt/SUNWappserv I've /opt/netbeans-5.5.1/rave2.0 I've /usr/local/jdk1.6.002 and have searched in these and in their sub folders but cannot locate derbyclient.jar ANY ONE KNOWS WHERE THIS derbycliet.jar file can be found? I do appreciate your kind help.
![Netbeans Netbeans](http://4.bp.blogspot.com/-1tTMXX7u6-g/VZ9aTOsaQHI/AAAAAAAAAz0/YyOIiefREno/s1600/netbeans-2.png)
Let's say you create a new project, and want it to make use of some 3rd party library, say, widget.jar. Where do you add this JAR:. File Project Properties Libraries Compile-Time Libraries; or. File Project Properties Libraries Run-Time Libraries; or.
Tools Libraries (Library Manager) Library Classpath; or. Tools Java Platforms (Java Platform Manager) All of these dialogs seem to do the same thing but I'm sure they all have their proper usages. Can't find a good 'best practices' article online and the NetBeans Help Contents dialog isn't helping with this either. You want to add libraries to your project and in doing so you have two options as you yourself identified: Compile-time libraries are libraries which is needed to compile your application. They are not included when your application is assembled (e.g., into a war-file).
Libraries of this kind must be provided by the container running your project. This is useful in situation when you want to vary API and implementation, or when the library is supplied by the container (which is typically the case with javax.servlet which is required to compile but provided by the application server, e.g., Apache Tomcat). Run-time libraries are libraries which is needed both for compilation and when running your project.
This is probably what you want in most cases. If for instance your project is packaged into a war/ear, then these libraries will be included in the package. As for the other alernatives you have either global libraries using Library Manageror jdk libraries. The latter is simply your regular java libraries, while the former is just a way for your to store a set of libraries under a common name.
For all your future projects, instead of manually assigning the libraries you can simply select to import them from your Library Manager. If your project's source code has import statements that reference classes that are in widget.jar, you should add the jar to your projects Compile-time Libraries. (The jar widget.jar will automatically be added to your project's Run-time Libraries). That corresponds to (1).
If your source code has imports for classes in some other jar and the source code for those classes has import statements that reference classes in widget.jar, you should add widget.jar to the Run-time libraries list. That corresponds to (2).
You can add the jars directly to the Libraries list in the project properties. You can also create a Library that contains the jar file and then include that Library in the Compile-time or Run-time Libraries list. If you create a NetBeans Library for widget.jar, you can also associate source code for the jar's content and Javadoc for the APIs defined in widget.jar. This additional information about widget.jar will be used by NetBeans as you debug code. It will also be used to provide addition information when you use code completion in the editor.
You should avoid using Tools Java Platform to add a jar to a project. That dialog allows you to modify the classpath that is used to compile and run all projects that use the Java Platform that you create.
That may be useful at times but hides your project's dependency on widget.jar almost completely.