Question

Since I have added to reference libraries ucanaccess-2.0.3.jar (eclipse Luna), I receive this error while executing my program:

Exception in thread "main" java.lang.NoClassDefFoundError: Could not initialize class net.ucanaccess.jdbc.UcanaccessDriver

referenced to a row of code that contains JT400 connection, and that works if I don't include ucanaccess jar in my project, as follows:

Class.forName("com.ibm.as400.access.AS400JDBCDriver");
Connection c = DriverManager.getConnection("jdbc:as400://"+systemi,user,pass);
return c;

so I'm confused... I also have a class that does ucanaccess connection, but it's not invocated until I press a button:

Class.forName("net.ucanaccess.jdbc.UcanaccessDriver");
Connection c=DriverManager.getConnection("jdbc:ucanaccess://M:/FServer.mdb"); 
return c;

Is it a conflict of libraries? Has anyone sperimented it yet?

Was it helpful?

Solution

the issue you linked is likely related to a mdb corrupted and it's totally unrelated to your NoClassDefFoundError problem. Also it's impossible a specific conflict problem with the AS400JDBCDriver, so it would be better to focus on the java.lang.NoClassDefFoundError. It means there is a lack in your runtime environment classpath. You should firstly check if you are using java 6 or older, if there are all UCanAccess dependencies in your classpath (see the jars in the lib folder of the UCanAccess distribution: jackcess, hsqldb,commons-logging and commons-lang) and if they aren't in conflict with the jars already in the classpath (e.g., presence of an old and incompatible version of jackcess). Cheers Marco

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top