Jar cannot access class of a dependency??

Hi All,
I'm not sure if this is the right place to post but I'm getting a class not found exception. I'm building a test client for db4o and my test uses three classes, two from com.db4o and the other from com.db4o.cs (Client Server). In my test when I call the client server class my program crashes, here's the line
ObjectContainer client = Db4oClientServer.openClient(Db4oClientServer.newClientConfiguration(), HOST, PORT, USER, PASS);I use Maven to manage the dependencies, in this case just db4o, and package as a jar. When I run here's what I get (my project name is Db4oServer)
bash-3.2$ java -jar target/Db4oServer.jar
Running server test...
Exception in thread "main" java.lang.NoClassDefFoundError: com/db4o/cs/Db4oClientServer
        at myTest.db4o.client.TestClient.test(TestClient.java:33)
        at myTest.db4o.client.TestClient.main(TestClient.java:23)
Caused by: java.lang.ClassNotFoundException: com.db4o.cs.Db4oClientServer
        at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
        ... 2 moreWhat I don't get is that the other classes have no problem and I searched the db4o jar and the CS class is in there... ? Please help this is extremely frustrating.

Seems to me like your compile time classpath is fine, but your runtime classpath is not. My bet is that the db4o jar is not on the classpath when you run your application.
You are executing the application as an executable jar; this means that any dependency jars need to be mentioned in the class-path line of the META-INF/manifest.mf inside the jar. This will probably not be the case. So you need to figure out how to setup your pom so this is going to happen; Given the manual page of the jar plugin:
http://maven.apache.org/shared/maven-archiver/examples/classpath.html
I'd say you need to add the addClasspath tag.

Similar Messages

  • PDK 9.0.4 Error: cannot access class oracle.security.jazn.realm.RealmUser

    Dear Forum,
    we are developing portlets for Portal 3.0.9.8. We use the default JPDK version, that comes with the standalone Oracle OC4J 9.0.4 bundled with PDK.
    We want to improve our portlet by check the userid of the portal user. Therefore, we want to use oracle.portal.provider.v2.ProviderUser.getUser().getName()
    in a JSP.
    First - even before the method call - we included
    <%@ page import="oracle.portal.provider.v2.http.ServletProviderUser" %>
    But even this 1 statement gives in JDeveloper 9.0.4 with the libs pdkjava and ptlshare from the OC4J the following error:
    Error: cannot access class oracle.security.jazn.realm.RealmUser; file oracle\security\jazn\realm\RealmUser.class not found
    What is wrong here? What missing library we must include?
    Thank You in advance

    Problem solved. Need to include jazn.jar in project's lib-paths.

  • Cannot access class oracle.sql.BLOB;

    Hi,
    I am trying to save a .tif file into Oracle database. When I run the program in JDeveloper I get the following errors:
    Error(9,19): cannot access class oracle.sql.BLOB; file oracle\sql\BLOB.class not found
    Error(59,29): class BLOB not found in class mypackage1.ImageUpload
    package mypackage1;
    import java.io.File;
    import java.io.FileInputStream;
    import java.io.IOException;
    import java.io.InputStream;
    import java.io.OutputStream;
    import java.sql.*;
    import java.util.Properties;
    import oracle.sql.BLOB;
    Blob imgblob = rs.getBlob(1);
    OutputStream blobos = ((BLOB) imgblob).getBinaryOutputStream();
    ...................Any help is appreciated. Thanks

    What package do I need to include in my classpath for
    this. ThanksWhy don't you inspect your JAR files? Do you have WinZip? Open them with it and find the class.

  • Error: cannot access class oracle.security.jazn.realm.RealmUser

    Hi,
    I try to compile this simple jsp, which use jpdkv2, with jdeveloper 9i.
    But I obtain this error:
    Error: cannot access class oracle.security.jazn.realm.RealmUser; file oracle\security\jazn\realm\RealmUser.class not found
    Someone has an idea ?
    Source code of my jsp:
    <%@ page contentType="text/html;charset=windows-1252"%>
    <%@page import = "oracle.portal.provider.v2.render.PortletRenderRequest" %>
    <%@page import = "oracle.portal.provider.v2.http.HttpCommonConstants" %>
    <%
    PortletRenderRequest portletRequest = (PortletRenderRequest)
    request.getAttribute(HttpCommonConstants.PORTLET_RENDER_REQUEST);
    %>
    <HTML>
    <HEAD>
    <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=windows-1252">
    <TITLE>
    Hello World
    </TITLE>
    </HEAD>
    <BODY>
    <H2>
    The current time is:
    </H2>
    <P>
    <% out.println((new java.util.Date()).toString()); %>
    </P>
    <P>Hello: <%= portletRequest.getUser().getName() %></P>
    </BODY>
    </HTML>

    Please check if jazn.jar is available under your <YOUR_OC4J_PATH>\j2ee\home folder.
    This library files contains all the security related classes required by jpdkv2 providers.

  • "cannot access class netcape.plugin.Plugin"

    Hello!
    I made a project consisting in several Java files, in Jbuilder. The program involves the use og a netscape plugin (a 3D browser). It works perfectly on my computer at work.
    When I try tu run exactly the same project at home, i get the error message:
    "cannot access class netcape.plugin.Plugin;neither class nor source found for netscape.plugin.Plugin"
    Does anyone know what this is about? Please tell me how to solve this problem!
    Thank you!

    Hi,
    Is netscape installed on your computer at home?
    The netscape.plugin.Plugin class resides in java40.jar (for Netscape 4.7). Try including it into your classpath.
    Hope this helps,
    Kurt.

  • CANNOT ACCESS CLASS JAVA....

    I use Jdevelopper 10.1.2 and I make a little application for authentication against users in a table (Account in HR schema).
    (see loginapp.zip)
    I don't understand why just one java file don't compile in my Workspace!!!!
    Help please!!!
    Luc

    LoginAction.jar
    --Error(13,23): cannot access class loginapp.model.AppModule; file
    loginapp\model\AppModule.class not found
    See below exemple
    ADF MODEL
    // in AccountViewImpl.java
    public boolean SofeValideUsager( String p_username,
    String p_password)
    setMaxFetchSize(1);
    setWhereClause("username = p_username and password = p_password");
    executeQuery();
    boolean p_valide = first() != null;
    setWhereClause(null);
    setWhereClauseParams(null);
    setMaxFetchSize(0);
    return p_valide;
    //in AccountView.java
    public interface AccountView extends ViewObject
    boolean SofeValideUsager(String p_username, String p_password);
    ADF View Controller
    // in LoginAction.jar
    import loginapp.model.AppModule;
    import loginapp.model.AccountImpl;
    import loginapp.model.common.AccountView;
    public class LoginAction extends Action
    public ActionForward execute(ActionMapping mapping, ActionForm form,
    HttpServletRequest request, HttpServletResponse response) throws IOException,
    ServletException
    String p_user = (String)((DynaActionForm)form).get("user");
    String p_password = (String)((DynaActionForm)form).get("password");
    if (SofeValideUsager(p_user, p_password))
    { return mapping.findForward("success");}
    else
    { return mapping.findForward("fail");}

  • Cannot access class javax.sql.RowSet

    Hello everyone,
    I had a question about this error I am receiving "cannot access class.javax.sql.RowSet". I have put the RowSet.jar file into my jdk/jre/lib/ext directory and when I compile I recieve this error. Can Anyone help? Thanks!

    I think you need to add one (or more) of the available libraries to your project, in your project's settings dialog, but I'm unsure which. If you can't find the correct one, you can always add a newly created one, which holds a reference to your jar file.

  • Cannot access class oracle.jheadstart.model.adfbc.JhsApplicationModuleImpl;

    Error(2,38): cannot access class oracle.jheadstart.model.adfbc.JhsApplicationModuleImpl; file oracle\jheadstart\model\adfbc\JhsApplicationModuleImpl.class not found
    Hi,
    I am working on demo application from JHeadstart Developer's Guide (ch2). I got the above error when I tried to test the ADF BC.
    I checked the Project properties of the model and there was no jheadstart subfolder under oracle folder.
    I followed the install.html for JHeadstart download without problem.
    I am wondering if the .jar files from JHeadstart that I copied to Jdeveloper is where the issue is?
    Any help is much appreciated.
    Ahsan

    Sandra,
    Thanks for your prompt and helpful response.
    When you are at page 2-9 in the Getting Started chapter, you should not have run the Application Generator yet, therefore your Application Module should not extend JhsApplicationModuleImpl yet.
    CORRECT.
    Or did you explicitly set the ADF BC Base Class properties to JhsApplicationModuleImpl?
    YES I DID THIS.
    The paragraph that describes this does mention that JHeadstart sets it up for you, you don't have to do it yourself. Is that where the confusion originated?
    YES I UNDERSTOOD THIS ALSO BUT THE CONFUSION WAS NOT HERE.
    MY SUGGESTION: if you modified the first sentence on page 2-10 to something like (You need to 'run the JAG' before you do Right-click the "HRService"Application Module and choose 'Test' 'otherwise you will get an error') would resolve the confusion for me.

  • Cannot access class java.nio.ByteBuffer

    Hi All -
    I'm trying to compile a java sample code.
    I keep getting the error described in the subject line
    cannot access class java.nio.ByteBuffer; file java\nio\ByteBuffer.class not found
    I have un-ziped the java sdk 1.4.1 src.zip to a directory under c:\ and added the java\nio directory to the project setting and compile with jdk runtime 1.4.1 and yet get the same error....
    I've tried by redirecting to src.zip and didn't work either....
    I would appreciate your feedbacks and sorry for the lame question, consider it as a newcomer to Java world.
    thanks in advance

    You test it by running the following line....
    java java.nio.ByteBuffer
    If it says "main not found" then your problem has nothing to do with the java install nor the classpath. The code you are trying to compile is wrong.
    If it says class not found then you use this line next....
    java -version
    If this returns nothing then you are not using the Sun VM (you are using the MS one.) If it returns a version below 1.4 then your PATH statement is wrong (and you should uninstall all sun versions then reinstall.) You can fix the MS VM problem by altering the path so the java path is first.
    If it does say 1.4 then you need to uninstall and reinstall because something is messed up.

  • Cannot access class javax.naming.Referenceable;

    Hi
    I am trying to create a connection pool and using the oracle.jdbc.pool.* in JavaBeans using JDeveloper 3.1.
    I am getting the following error.Unable to find the reason for this and the sun documentation says - no usage for this class.
    Error:
    cannot access class javax.naming.Referenceable; file javax/naming/Referenceable.class not found.
    Any help is greatly appreciated..
    thanks
    Yugandhar
    null

    You need to make sure $ORACLE_HOME/jdbc/lib/jndi.zip is on your classpath for this to work.

  • Cannot access class jclass.util.JCVector

    I need the libraries .
    Where can I get the libraries for my java application?.
    When I compile , I get this error:cannot access class jclass.util.JCVector.
    I have been looking for them in the sitraka home, but I haven�t
    found any.
    I have installed libraries for jclass.bwt. package but I imagine
    that it isn�t enough.
    Thanks alot-
    ras

    I dont know the class JCVector, but if you received the error message
    "cannot access class jclass.util.JCVector"
    It means that the class is there, but you cannot access.
    Why I cannot access if the class is there? - you should ask
    Problably the access permission of this class is not Public, it must be private or protected.
    The most common is the class is protected and it is in another package.
    So the JVM locate the class, but cannot access it from your current class, because the class you are trying to access is protected or private.
    Hope that i Helped
    JoseAugusto

  • Cannot access class javax.jms.TextMessage;

    Hi,
    I am trying to run standard page from JDev and i am getting below error from EOImpl.java.
    " cannot access class javax.jms.TextMessage; file javax\jms\TextMessage.class not found "
    I tried to import javax/jms dir to my local machine but i could not find jms directory under javax in OS. Can you guys pls help me to resolve this.
    Thanks,

    Hi Scott,
    Not sure wht you wanted me to try...
    I have something like this in the code which is causing that error..
    BusinessEvent businessevent = new BusinessEvent(s1, s2);
    businessevent.setData("Opportunity " + s2 + "updated");
    ArrayList arraylist = new ArrayList(1);
    arraylist.add(oadbtransaction);
    businessevent.setObject(arraylist);
    businessevent.setStringProperty("pLeadId", getLeadId().toString());
    java.sql.Connection connection1 = oadbtransaction.getJdbcConnection();
    businessevent.raise(connection1);
    Its asking me to import jms..but ii could not find those files in Unix..is there anyway to import these files OR any other solution to fix this error?
    Please help..

  • Error: cannot access class oracle.jbo.server.ViewObjectImpl;

    hi
    while compiling my project
    i m getting this error..
    Error: cannot access class oracle.jbo.server.ViewObjectImpl; file oracle\jbo\server\ViewObjectImpl.class not found
    please help.
    regards
    naveen

    Are the fwk class libraries included in jdev project ?
    Thanks
    Tapash

  • Error: cannot access class oracle.jsp.runtime.HttpJsp; file oracle\jsp\runtime\HttpJs

    Hello,
    where is now oracle\jsp\runtime\HttpJsp.class located?
    thanks.
    Oleg.

    Same problem,
    Error: cannot access class oracle.jsp.runtime.HttpJsp; file oracle\jsp\runtime\HttpJsp.class not found
    Thanks
    aldo

  • Applet inside a JAR: Cannot access other classes within the JAR

    Hello,
    Description
    Web app + applet (packaged in a JAR)
    I have followed this tutorial
    JAR contents
    package mypackage
    SimpleApplet.class
    SimpleObj.class
    _"SimpleApplet" uses "SimpleObj"_
    package mypackage;
    public class SimpleApplet extends JApplet {
        @Override
        public void init() {
            SimpleObj obj = new SimpleObj();
    HTML code
    <applet archive="SimpleApplet.jar" codebase="." code="mypackage.SimpleApplet.class" width="800" height="600" />
    SimpleObj cannot be found (Java Console)
    java.lang.NoClassDefFoundError: mypackage/SimpleObj
    at java.lang.Class.getDeclaredConstructors0(Native Method)
    at java.lang.Class.privateGetDeclaredConstructors(Unknown Source)
    at java.lang.Class.getConstructor0(Unknown Source)
    at java.lang.Class.newInstance0(Unknown Source)
    at java.lang.Class.newInstance(Unknown Source)
    at sun.plugin2.applet.Plugin2Manager.createApplet(Unknown Source)
    at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
    Caused by: java.lang.ClassNotFoundException: mypackage.SimpleObj
    at sun.plugin2.applet.Applet2ClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClassInternal(Unknown Source)
    ... 8 more
    Caused by: java.io.IOException: open HTTP connection failed:*http://localhost:8080/SimpleApp/mypackage/SimpleObj.class*
    at sun.plugin2.applet.Applet2ClassLoader.getBytes(Unknown Source)
    at sun.plugin2.applet.Applet2ClassLoader.access$000(Unknown Source)
    at sun.plugin2.applet.Applet2ClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    ... 12 more
    Exception: java.lang.NoClassDefFoundError: mypackage/SimpleObj
    It looks like JRE does not search for the SimpleObj class inside the JAR, but tries to get it from the server...
    Any ideas?
    Thanks in advance,
    Gerard
    Edited by: gsoldevila on Dec 10, 2008 2:05 AM

    misread, deleted
    Edited by: atmguy on Dec 10, 2008 1:12 PM

Maybe you are looking for

  • SPRY menu bar not working in IE 9

    Hey! I recently just finished building my very first website using Dreamweaver CS5.5!  It looks really great and works perfectly in firefox and safari however the SPRY menu bar does not work in IE 8 or 9. Does anyone know what i can do to fix this wi

  • Error when opening files in KM Navigation Iview / Web-Dynpro

    Hello, i've created a navigation iview to browse through my km server, and also created a web dynpro application which allows me to do the same thing. I can browse through folders without any probles, but when I try to open a file,  I get a java.lang

  • HT201263 its sayin no service but have sim card in iphone?

    ive just restored back to factory settings on iphone 3g its sayin no service but have sim card in iphone 3g an connect to itunes i am thats what says in iphone  thats all i have so  far tho it has itunes symbol usb plug with arrow when connect to itu

  • Prelude 2014.1 crashes on startup

    Prelude 2014.1 crashes on startup. I re-installed it wiping out the presets, but it still won't start. I can send a crash report to anyone interested. Would be grateful for any suggestions. OS X 10.1.1, a lot of plugins, some extensions. Removing ext

  • XML / Actionscript Question

    Hi -- I am trying to add a weather "widget" to my website. I am pulling the XML forcast using this link: Weather XML I get the XML back ok, however the XML has data names like "weather-icon", and others with hypens. When I attempt to read the data I