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

[Bug]: Postgres Bulk Loader throws class exception #2907

Closed
usbrandon opened this issue May 9, 2023 · 1 comment · Fixed by #2920
Closed

[Bug]: Postgres Bulk Loader throws class exception #2907

usbrandon opened this issue May 9, 2023 · 1 comment · Fixed by #2920
Assignees
Labels
bug P2 Default Priority Transforms
Milestone

Comments

@usbrandon
Copy link
Contributor

Apache Hop version?

2.4-GA

Java version?

11

Operating system

Linux

What happened?

Take a fresh copy of 2.4-GA. Take any data to the PG Bulk Loader against any PG table and it will throw the following exception.

2023/05/09 02:12:36 - PostgreSQL Bulk Loader.0 -
2023/05/09 02:12:36 - PostgreSQL Bulk Loader.0 - class org.postgresql.jdbc.PgConnection cannot be cast to class org.postgresql.PGConnection (org.postgresql.jdbc.PgConnection is in unnamed module of loader org.apache.hop.core.plugins.HopURLClassLoader @3eb64e63; org.postgresql.PGConnection is in unnamed module of loader org.apache.hop.core.plugins.HopURLClassLoader @72155315)
2023/05/09 02:12:36 - PostgreSQL Bulk Loader.0 -
2023/05/09 02:12:36 - PostgreSQL Bulk Loader.0 - at org.apache.hop.pipeline.transforms.pgbulkloader.PGBulkLoader.doCopy(PGBulkLoader.java:161)
2023/05/09 02:12:36 - PostgreSQL Bulk Loader.0 - at org.apache.hop.pipeline.transforms.pgbulkloader.PGBulkLoader.processRow(PGBulkLoader.java:240)
2023/05/09 02:12:36 - PostgreSQL Bulk Loader.0 - at org.apache.hop.pipeline.transform.RunThread.run(RunThread.java:55)
2023/05/09 02:12:36 - PostgreSQL Bulk Loader.0 - at java.base/java.lang.Thread.run(Thread.java:829)
2023/05/09 02:12:36 - PostgreSQL Bulk Loader.0 - Caused by: java.lang.ClassCastException: class org.postgresql.jdbc.PgConnection cannot be cast to class org.postgresql.PGConnection (org.postgresql.jdbc.PgConnection is in unnamed module of loader org.apache.hop.core.plugins.HopURLClassLoader @3eb64e63; org.postgresql.PGConnection is in unnamed module of loader org.apache.hop.core.plugins.HopURLClassLoader @72155315)
2023/05/09 02:12:36 - PostgreSQL Bulk Loader.0 - at org.apache.hop.pipeline.transforms.pgbulkloader.PGBulkLoader.doCopy(PGBulkLoader.java:158)
2023/05/09 02:12:36 - PostgreSQL Bulk Loader.0 - ... 3 more
2023/05/09 02:12:36 - PostgreSQL Bulk Loader.0 - Finished processing (I=0, O=0, R=1, W=0, U=0, E=1)

Issue Priority

Priority: 2

Issue Component

Component: Transforms

@sramazzina
Copy link
Contributor

Ciao @usbrandon

the fix is not that easy but we are working on it. The best solution we foresee for this issue is to move forward with issue #2129 but in the meanwhile, to workaround the problem, move the postgresql jdbc driver out of the plugins/database/postgresql/lib directory to lib/core directory. As I said, this is a temporary workaround in the meanwhile we will fix the things cleanly and definitely.

sramazzina added a commit to sramazzina/hop that referenced this issue May 11, 2023
fix apache#2129 - Refactor the usage of JDBC Drivers: relocated drivers to lib/jdbc
sramazzina added a commit to sramazzina/hop that referenced this issue May 11, 2023
fix apache#2129 - Refactor the usage of JDBC Drivers: relocated drivers to lib/jdbc
sramazzina added a commit to sramazzina/hop that referenced this issue May 11, 2023
@sramazzina sramazzina mentioned this issue May 11, 2023
5 tasks
@sramazzina sramazzina added this to the 2.5 milestone May 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug P2 Default Priority Transforms
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants