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

Error wildfly datasource [JDBC501] #537

Closed
firebird-automations opened this issue Jun 10, 2017 · 10 comments
Closed

Error wildfly datasource [JDBC501] #537

firebird-automations opened this issue Jun 10, 2017 · 10 comments

Comments

@firebird-automations
Copy link

Submitted by: erick de oliveira leal (erickdeoliveiraleal)

Is related to JDBC490

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)

@firebird-automations
Copy link
Author

Commented by: erick de oliveira leal (erickdeoliveiraleal)

complete log https://gist.github.com/erickdeoliveiraleal/1a5aaf2f449d17452bea27091b6a8fd0

@firebird-automations
Copy link
Author

Commented by: @mrotteveel

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 JDBC490 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).

@firebird-automations
Copy link
Author

Modified by: @mrotteveel

Link: This issue is related to JDBC490 [ JDBC490 ]

@firebird-automations
Copy link
Author

Modified by: @mrotteveel

status: Open [ 1 ] => Closed [ 6 ]

resolution: Won't Fix [ 2 ]

@firebird-automations
Copy link
Author

Commented by: erick de oliveira leal (erickdeoliveiraleal)

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?

@firebird-automations
Copy link
Author

Commented by: @mrotteveel

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.

@firebird-automations
Copy link
Author

Modified by: @mrotteveel

status: Closed [ 6 ] => Reopened [ 4 ]

resolution: Won't Fix [ 2 ] =>

@firebird-automations
Copy link
Author

Commented by: erick de oliveira leal (erickdeoliveiraleal)

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)

@firebird-automations
Copy link
Author

Commented by: @mrotteveel

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.

@firebird-automations
Copy link
Author

Commented by: @mrotteveel

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.

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

No branches or pull requests

2 participants