Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
firebird-issue-importer opened this issue Mar 13, 2017 · 4 comments

Comments

@firebird-issue-importer

Submitted by: @mrotteveel

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)

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Mar 13, 2017

Modified by: @mrotteveel

description: 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

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)

=>

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)

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Mar 13, 2017

Commented by: @mrotteveel

Specified explicit classloader, and this fixed the problem.

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Mar 13, 2017

Modified by: @mrotteveel

status: Open [ 1 ] => Resolved [ 5 ]

resolution: Fixed [ 1 ]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants