Issue Details (XML | Word | Printable)

Key: JDBC-483
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Mark Rotteveel
Reporter: Mark Rotteveel
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Jaybird JCA/JDBC Driver

Jaybird 3 fails to load in Netbeans 8.2 with Could not initialize class org.firebirdsql.encodings.EncodingFactory$DefaultEncodingFactory

Created: 13/Mar/17 02:14 PM   Updated: 13/Mar/17 03:55 PM
Component/s: JDBC driver
Affects Version/s: Jaybird 3.0.0-beta-3
Fix Version/s: None

Environment: Netbeans 8.2, Jaybird 3.0.0-beta-3


 Description  « Hide
Attempting to use a connection in Netbeans 8.2 to Firebird using Jaybird 3.0.0-beta-3 results in a Could not initialize class org.firebirdsql.encodings.EncodingFactory$DefaultEncodingFactory

Steps to reproduce:
1. in Netbeans Windows-Services(Ctrl-5)
2. databases->drivers-(right click)->new driver. add files. I've tryed add only jaybird-full or jaybird-full+jna+connector+antldr. ->OK
3.right click on thes added driver and "connect using this driver". fill username,pass, url and "test connection" -> got such error.

Related stacktrace:

SEVERE [org.firebirdsql.encodings.DefaultEncodingSet]: Error loading encoding definition from default-firebird-encodings.xml
javax.xml.bind.JAXBException: ClassCastException: attempting to cast jar:file:/usr/share/netbeans-nb-8.2/ide/modules/ext/jaxb/api/jaxb-api.jar!/javax/xml/bind/JAXBContontext.class to jar:file:/opt/oracle-jdk-bin-1.8.0.121/jre/lib/rt.jar!/javax/xml/bind/JAXBContext.class. Please make sure that you are specifying the proper ClassLoader
        at javax.xml.bind.ContextFinder.handleClassCastException(ContextFinder.java:114)
        at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:250)
        at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:234)
        at javax.xml.bind.ContextFinder.find(ContextFinder.java:441)
        at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:641)
        at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:584)
        at org.firebirdsql.encodings.DefaultEncodingSet.loadEncodingsFromXml(DefaultEncodingSet.java:100)
        at org.firebirdsql.encodings.DefaultEncodingSet.createEncodingDefinitions(DefaultEncodingSet.java:129)
        at org.firebirdsql.encodings.DefaultEncodingSet.getEncodings(DefaultEncodingSet.java:66)
        at org.firebirdsql.encodings.EncodingFactory.processEncodingSet(EncodingFactory.java:333)
        at org.firebirdsql.encodings.EncodingFactory.<init>(EncodingFactory.java:81)
        at org.firebirdsql.encodings.EncodingFactory.createInstance(EncodingFactory.java:480)
        at org.firebirdsql.encodings.EncodingFactory.access$000(EncodingFactory.java:36)
        at org.firebirdsql.encodings.EncodingFactory$DefaultEncodingFactory.<clinit>(EncodingFactory.java:59)
        at org.firebirdsql.encodings.EncodingFactory.getPlatformDefault(EncodingFactory.java:428)
        at org.firebirdsql.jdbc.FBDriverPropertyManager.handleEncodings(FBDriverPropertyManager.java:241)
        at org.firebirdsql.jdbc.FBDriverPropertyManager.normalize(FBDriverPropertyManager.java:208)
        at org.firebirdsql.jdbc.FBDriver.connect(FBDriver.java:116)
        at org.netbeans.modules.db.explorer.DbDriverManager.getConnection(DbDriverManager.java:131)
        at org.netbeans.modules.db.explorer.DatabaseConnection.doConnect(DatabaseConnection.java:923)
        at org.netbeans.modules.db.explorer.DatabaseConnection.access$200(DatabaseConnection.java:103)
        at org.netbeans.modules.db.explorer.DatabaseConnection$3.run(DatabaseConnection.java:988)
        at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1443)
        at org.netbeans.modules.openide.util.GlobalLookup.execute(GlobalLookup.java:68)
        at org.openide.util.lookup.Lookups.executeWith(Lookups.java:303)
        at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2058)

 All   Comments   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Mark Rotteveel added a comment - 13/Mar/17 02:57 PM

Mark Rotteveel added a comment - 13/Mar/17 03:55 PM
Specified explicit classloader, and this fixed the problem.