Issue Details (XML | Word | Printable)

Key: JDBC-501
Type: Bug Bug
Status: Reopened Reopened
Priority: Major Major
Assignee: Mark Rotteveel
Reporter: erick de oliveira leal
Votes: 0
Watchers: 0
Operations

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

Error wildfly datasource

Created: 09/Jun/17 10:13 PM   Updated: 27/Oct/18 11:37 AM
Component/s: None
Affects Version/s: Jaybird 3.0.1
Fix Version/s: None

Environment: windows 7, jdk 8, wildfly 10
Issue Links:
Relate
 


 Description  « Hide
I'm using wildfly with firebird datasource and i got this in initialization

19:11:27,524 SEVERE [org.firebirdsql.gds.impl.GDSFactory] (ServerService Thread Pool -- 62) Can't register plugin (skipping): org.firebirdsql.gds.impl.GDSFactoryPlugin: Provider org.firebirdsql.gds.impl.oo.OOGDSFactoryPlugin not a subtype: java.util.ServiceConfigurationError: org.firebirdsql.gds.impl.GDSFactoryPlugin: Provider org.firebirdsql.gds.impl.oo.OOGDSFactoryPlugin not a subtype
at java.util.ServiceLoader.fail(ServiceLoader.java:239)
at java.util.ServiceLoader.access$300(ServiceLoader.java:185)
at java.util.ServiceLoader$LazyIterator.nextService(ServiceLoader.java:376)
at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:404)
at java.util.ServiceLoader$1.next(ServiceLoader.java:480)
at org.firebirdsql.gds.impl.GDSFactory.loadPluginsFromClassLoader(GDSFactory.java:123)
at org.firebirdsql.gds.impl.GDSFactory.<clinit>(GDSFactory.java:75)
at org.firebirdsql.jdbc.FBDriver.connect(FBDriver.java:110)

 All   Comments   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order

Mark Rotteveel added a comment - 10/Jun/17 07:02 AM
This exception will be logged if you have two copies of Jaybird on the classpath of two different classloader hierarchies, for example one as a module in Wildlfy, and one in the deployed WAR. See also JDBC-490 and the release notes under changes for Jaybird 3.0.0. Jaybird attempts to load components of itself as a plugin, and it tries a number of accessible classloaders, but if those are separate hierarchies, then plugins loaded from one hierarchy cannot be used in the other.

Since 3.0.0 this should have no effect on the application itself: Jaybird will log the exception and continue with the next plugin, so it will continue to work. To fix this polluting your log: remove one of the copies (probably the one in the WAR).

erick de oliveira leal added a comment - 10/Jun/17 02:36 PM
Hello Mark Rotteveel, thanks for explaining.

But I need the lib both to create the datasource in the server, also inside my war, cause in my application I use in some places the manual connection, outside the container and other places I use from container. Do you know how can I avoid this error in this cenario?

Mark Rotteveel added a comment - 10/Jun/17 03:04 PM
I don't use usually use Wildfly, but IIRC you should declare a dependency on the Jaybird module in your deployment descriptor, or add it as a global module.

See https://docs.jboss.org/author/display/WFLY10/Developer+Guide#DeveloperGuide-ClassloadinginWildFly (eg under Global Modules and under JBoss Deployment Structure File)

But again: these errors are not failures: the application will just work. It just logs that it found a plugin but wasn't able to load it. I will see if I can log them as warning instead of error for a future release, or maybe I'll just move the loading of the default plugins purely into code instead of as a discovery mechanism.

erick de oliveira leal added a comment - 10/Jun/17 10:37 PM
Thank you. I created a global module inside ee umbrella in standalone.xml and it is loading correctly.

 <global-modules>
                <module name="org.firebirdsql" slot="main"/>
            </global-modules>

But I'm having a different bug now, I have an ApplicationScoped bean that load some entities from database in application startup and while it is loading the below warning appears: (if downgrade to 2.2.13 no warnings)

2017-06-10 19:27:22,892 WARNING [org.firebirdsql.gds.ng.wire.version10.V10Transaction] (Finalizer) Commit not completed, state was COMMITTING: java.lang.RuntimeException: Commit not completed
at org.firebirdsql.gds.ng.wire.version10.V10Transaction.commit(V10Transaction.java:94)
at org.firebirdsql.jca.FBManagedConnection.internalCommit(FBManagedConnection.java:636)
at org.firebirdsql.jca.FBLocalTransaction.internalCommit(FBLocalTransaction.java:193)
at org.firebirdsql.jca.FBLocalTransaction.commit(FBLocalTransaction.java:167)
at org.firebirdsql.jdbc.InternalTransactionCoordinator$AutoCommitCoordinator.statementCompleted(InternalTransactionCoordinator.java:373)
at org.firebirdsql.jdbc.InternalTransactionCoordinator.statementCompleted(InternalTransactionCoordinator.java:134)
at org.firebirdsql.jdbc.FBStatement.notifyStatementCompleted(FBStatement.java:259)
at org.firebirdsql.jdbc.AbstractPreparedStatement.notifyStatementCompleted(AbstractPreparedStatement.java:168)
at org.firebirdsql.jdbc.FBStatement.notifyStatementCompleted(FBStatement.java:254)
at org.firebirdsql.jdbc.FBStatement.completeStatement(FBStatement.java:211)
at org.firebirdsql.jdbc.AbstractPreparedStatement.completeStatement(AbstractPreparedStatement.java:159)
at org.firebirdsql.jdbc.InternalTransactionCoordinator$AbstractTransactionCoordinator.completeStatements(InternalTransactionCoordinator.java:240)
at org.firebirdsql.jdbc.InternalTransactionCoordinator$AutoCommitCoordinator.handleConnectionClose(InternalTransactionCoordinator.java:414)
at org.firebirdsql.jdbc.InternalTransactionCoordinator.handleConnectionClose(InternalTransactionCoordinator.java:171)
at org.firebirdsql.jdbc.FBConnection.close(FBConnection.java:566)
at org.firebirdsql.jdbc.FBConnection.finalize(FBConnection.java:1500)
at java.lang.System$2.invokeFinalize(System.java:1270)
at java.lang.ref.Finalizer.runFinalizer(Finalizer.java:98)
at java.lang.ref.Finalizer.access$100(Finalizer.java:34)
at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:210)

2017-06-10 19:27:22,892 WARNING [org.firebirdsql.gds.ng.wire.version10.V10Transaction] (Finalizer) Rollback not completed, state was ROLLING_BACK: java.lang.RuntimeException: Rollback not completed
at org.firebirdsql.gds.ng.wire.version10.V10Transaction.rollback(V10Transaction.java:114)
at org.firebirdsql.jca.FBManagedConnection.internalCommit(FBManagedConnection.java:640)
at org.firebirdsql.jca.FBLocalTransaction.internalCommit(FBLocalTransaction.java:193)
at org.firebirdsql.jca.FBLocalTransaction.commit(FBLocalTransaction.java:167)
at org.firebirdsql.jdbc.InternalTransactionCoordinator$AutoCommitCoordinator.statementCompleted(InternalTransactionCoordinator.java:373)
at org.firebirdsql.jdbc.InternalTransactionCoordinator.statementCompleted(InternalTransactionCoordinator.java:134)
at org.firebirdsql.jdbc.FBStatement.notifyStatementCompleted(FBStatement.java:259)
at org.firebirdsql.jdbc.AbstractPreparedStatement.notifyStatementCompleted(AbstractPreparedStatement.java:168)
at org.firebirdsql.jdbc.FBStatement.notifyStatementCompleted(FBStatement.java:254)
at org.firebirdsql.jdbc.FBStatement.completeStatement(FBStatement.java:211)
at org.firebirdsql.jdbc.AbstractPreparedStatement.completeStatement(AbstractPreparedStatement.java:159)
at org.firebirdsql.jdbc.InternalTransactionCoordinator$AbstractTransactionCoordinator.completeStatements(InternalTransactionCoordinator.java:240)
at org.firebirdsql.jdbc.InternalTransactionCoordinator$AutoCommitCoordinator.handleConnectionClose(InternalTransactionCoordinator.java:414)
at org.firebirdsql.jdbc.InternalTransactionCoordinator.handleConnectionClose(InternalTransactionCoordinator.java:171)
at org.firebirdsql.jdbc.FBConnection.close(FBConnection.java:566)
at org.firebirdsql.jdbc.FBConnection.finalize(FBConnection.java:1500)
at java.lang.System$2.invokeFinalize(System.java:1270)
at java.lang.ref.Finalizer.runFinalizer(Finalizer.java:98)
at java.lang.ref.Finalizer.access$100(Finalizer.java:34)
at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:210)

Mark Rotteveel added a comment - 11/Jun/17 08:13 AM
This is becoming more of a support inquiry than a bug report, could you post this on Firebird-Java?

The short version is that your code did not close a connection, then when it was garbage collected the finalizer closed it for you. When this happened it committed the active auto-commit transaction which failed, then it tried to roll it back which also failed. Note that these log statements are warnings. However the actual commit failure isn't logged by this code, but is thrown up to the caller of the close() method (the finalizer in this case), unfortunately Java doesn't log exceptions during finalization.

If you want to know the actual failure, you need to ensure connections are closed in your code, not in the finalizer.

Note that this would also have happened with Jaybird 2.2, it just didn't log these warnings.

Mark Rotteveel added a comment - 27/Oct/18 11:37 AM
For Jaybird 4, this will only log a short message on log level warning, and log the exception stacktrace for debugging purpose on log level debug.