You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hop.apache.org by "nutsjian (via GitHub)" <gi...@apache.org> on 2024/03/04 08:23:12 UTC

[I] [Bug]: can't load external jars when running hop pipeline in docker (hop)

nutsjian opened a new issue, #3691:
URL: https://github.com/apache/hop/issues/3691

   ### Apache Hop version?
   
   2.7.0
   
   ### Java version?
   
   11
   
   ### Operating system
   
   Linux
   
   ### What happened?
   
   My project structure is as follows:
   
   ```shell
   /opt/workspace/hop-workspace/docker/example001
       - metadata
       - project-config.json
       - shared_jars
         - ojdbc8-21.8.0.0.jar
       - transformers
         - example001.hpl
   ```
   
   **example001.hpl**
   
   ```shell
   TableInput(Oracle Table Input) -----> Select Values -----> JSON output(Output value) ------> REST Client
   ```
   
   ```shell
   docker run -it -u root --rm \
     --env HOP_LOG_LEVEL=Basic \
     --env HOP_FILE_PATH='${PROJECT_HOME}/transforms/example001.hpl' \
     --env HOP_PROJECT_FOLDER=/files \
     --env HOP_PROJECT_NAME=hop_example_001 \
     --env HOP_RUN_CONFIG=local \
     --env HOP_SHARED_JDBC_FOLDERS=/lib/jdbc,/opt/workspace/hop-workspace/docker/example001/shared_jars \
     --name hop-example001-container \
     -v /opt/workspace/hop-workspace/docker/example001:/files \
     apache/hop:latest
   ```
   
   When I run the above command, the exception error message is as follows:
   
   ```shell
   2024/03/04 07:27:42 - Table input.0 - ERROR: An error occurred, processing will be stopped:
   2024/03/04 07:27:42 - Table input.0 - Error occurred while trying to connect to the database
   2024/03/04 07:27:42 - Table input.0 -
   2024/03/04 07:27:42 - Table input.0 - Driver class 'oracle.jdbc.driver.OracleDriver' could not be found, make sure the 'Oracle' driver (jar file) is installed.
   2024/03/04 07:27:42 - Table input.0 - Unable to load class 'oracle.jdbc.driver.OracleDriver' in this classloader or in the parent
   2024/03/04 07:27:42 - Table input.0 - ERROR: Error initializing transform [Table input]
   2024/03/04 07:27:42 - example001 - ERROR: Transform [Table input.0] failed to initialize!
   2024/03/04 07:27:42 - Table input.0 - Finished reading query, closing connection.
   ```
   
   Am I setting the `HOP_SHARED_JDBC_FOLDERS` environment variable incorrectly? 
   
   How should this parameter HOP_SHARED_JDBC_FOLDERS be set? Can you give a specific example?
   
   Thanks a lot!
   
   
   ### Issue Priority
   
   Priority: 3
   
   ### Issue Component
   
   Component: Containers, Component: Database


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@hop.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug]: can't load external jars when running hop pipeline in docker (hop)

Posted by "hansva (via GitHub)" <gi...@apache.org>.
hansva closed issue #3691: [Bug]: can't load external jars when running hop pipeline in docker
URL: https://github.com/apache/hop/issues/3691


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@hop.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug]: can't load external jars when running hop pipeline in docker (hop)

Posted by "nutsjian (via GitHub)" <gi...@apache.org>.
nutsjian commented on issue #3691:
URL: https://github.com/apache/hop/issues/3691#issuecomment-1978142037

   > you created a volume that maps `/opt/workspace/hop-workspace/docker/example001/shared_jars` (local) to `/files` in the container, and then you use the local path to set your `HOP_SHARED_JDBC_FOLDERS`.
   > 
   > try with `--env HOP_SHARED_JDBC_FOLDERS=/lib/jdbc,/files \` and see if that makes a difference
   
   @bamaer , yes, it works. Thanks a lot.
   
   ```shell
   docker run -it -u root --rm \
     --env HOP_LOG_LEVEL=Basic \
     --env HOP_FILE_PATH='${PROJECT_HOME}/transforms/example001.hpl' \
     --env HOP_PROJECT_FOLDER=/files \
     --env HOP_PROJECT_NAME=hop_example_001 \
     --env HOP_RUN_CONFIG=local \
     # --env HOP_SHARED_JDBC_FOLDERS=/lib/jdbc,/files \,also run successfully.
     --env HOP_SHARED_JDBC_FOLDERS=/lib/jdbc,/files/shared_jars \
     --name hop-example001-container \
     -v /opt/workspace/hop-workspace/docker/example001:/files \
     docker-hub-remote.rb-artifactory.bosch.com/apache/hop:latest
   ```
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@hop.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug]: can't load external jars when running hop pipeline in docker (hop)

Posted by "bamaer (via GitHub)" <gi...@apache.org>.
bamaer commented on issue #3691:
URL: https://github.com/apache/hop/issues/3691#issuecomment-1976860295

   you created a volume that maps `/opt/workspace/hop-workspace/docker/example001/shared_jars` (local) to `/files` in the container, and then you use the local path to set your `HOP_SHARED_JDBC_FOLDERS`.
   
   try with `--env HOP_SHARED_JDBC_FOLDERS=/lib/jdbc,/files \` and see if that makes a difference 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@hop.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org