Hi Ivy team,

I use axon ivy version 7.3.1(Designer and Engine), maven 3.6.2 I've create a dialog form with "add new" button, when user click that button, it will call a method in Java class.

after run and build with maven, I have a "xxx-app-1.0.0-SNAPSHOT.iar".

I copy this file to deploy folder of "AxonIvyEngine7.3.1.1904101154_All_x64" and run Engine and then run web app . everything is ok when I click "add new" button

But when I copy that file :"xxx-app-1.0.0-SNAPSHOT.iar" in docker file :

   FROM axonivy/axonivy-engine:7.3.1
   LABEL maintainer="xxxx@abc.com"
   COPY --chown=ivy:ivy target/xxx-app-1.0.0-SNAPSHOT.iar deploy/    ( this command will copy xxx-app-1.0.0-SNAPSHOT.iar to deploy folder on container )
   EXPOSE 8080

and then I create a docker-compose file

version: '3.3'
 services:
  axonivy-engine:
    image: my-app-test    
    build: .
    ports:
     - 8082:8080
    restart: always
  • Run docker-compose up
  • Run web app and then click "add new" button. I've get a errors:

Errorrs:

Caused by: ch.ivyteam.ivy.scripting.exceptions.classDef.ReferencedClassNotFoundException: Referenced class 'com/axonivy/persistence/beans/GenericEntity' not found for class 'controller.AddNew'

I don't why with same a file IAR but when I run it on local it run well and doesn't through any errors .But after run from docker container the UI still appear ok, but when user click button, it call method in java class then through errors

I've check in zip file on "work" folder in Engine in docker container it still exist all file java class

can you guy help me please

my iar file:

link text

asked 27.11.2019 at 02:44

tuannv's gravatar image

tuannv
(suspended)
accept rate: 0%

edited 27.11.2019 at 04:02

1

don't copy everything of your target/* directory in deploy folder. only copy the iar project.

(27.11.2019 at 02:58) Alex Suter ♦♦ Alex%20Suter's gravatar image

yes, I've tested with only copy IAR project , but it same result of errors

(27.11.2019 at 03:00) tuannv tuannv's gravatar image
1

please send your iar to the support.

(27.11.2019 at 03:26) Alex Suter ♦♦ Alex%20Suter's gravatar image
1

Is the mentioned class com/axonivy/persistence/beans/GenericEntity part ot the IAR you are deploying? or is it in a dependency project? Can you see the binary file packed in the IAR?

(27.11.2019 at 03:28) Reguel Werme... ♦♦ Reguel%20Wermelinger's gravatar image

Hi Reguel Werme,

I don't mentioned GenericEntity class, I think the error relative to GenericEntity class because the genericEntity can't find a "AddNew" java class

so the cause is axon ivy engine can't find java class in docker container. that's my question

(27.11.2019 at 03:57) tuannv tuannv's gravatar image

Hi Alex Suter , I've added my IAR file to you, but the tool don't support upload file iar, so I change the file from iar to "png" file. please get it and change the file extension to iar file again to get the source code. thank you a lot for support

(27.11.2019 at 04:05) tuannv tuannv's gravatar image

I just want to outline, that this issue has absolutly nothing todo with docker. It just shows that your iar will not run on a brand new engine. Please fix your dependency mgmt. as prposed by Reguel.

(27.11.2019 at 12:06) Alex Suter ♦♦ Alex%20Suter's gravatar image
showing 5 of 7 show 2 more comments

You're IAR defines additional deps:

<dependencies> 
<dependency> 
<groupid>com.axonivy</groupid> 
<artifactid>persistence</artifactid> 
<version>0.0.1</version> 
</dependency>
</dependencies>

You must add JAR dependencies from maven with your IAR: otherwise they will not be accessible to the engine

https://answers.axonivy.com/questions/2089/add-library-with-pom-xml

link

answered 27.11.2019 at 04:23

Reguel%20Wermelinger's gravatar image

Reguel Werme... ♦♦
9.4k31958
accept rate: 70%

edited 27.11.2019 at 04:24

I added before deployed, the problem only happen after I run web app through docker container

(27.11.2019 at 05:07) tuannv tuannv's gravatar image
1

Well the docker deployment must be self contained. I don't know how you added it - but the logs show that the engine class loader can't find your artifacts that you have "added before".

However, I do not see any advantage in somehow copying necessary artifacts in an non standard way. Just include in in the IAR as you should always do it. This is best practice , not only for docker engines. It leads to deterministic deployment scenarios.

(27.11.2019 at 05:23) Reguel Werme... ♦♦ Reguel%20Wermelinger's gravatar image

Hi Reguel Werme. thank you a lot for your answer. about how do I added persistent before --> I added dependency on Pom file and then use maven clean install to get dependency

(27.11.2019 at 20:44) tuannv tuannv's gravatar image

Hi Ivy team, today, I decided upgrade axon ivy to 7.4 and every thing is ok on this version

thank you guys for support

(27.11.2019 at 22:10) tuannv tuannv's gravatar image

dependent pom files must be include on the IAR file and added to it's classpath. It's good practice to resolve them from MAVEN (pom.xml dep declaration), copy them with maven-dependency-plugin into the project (but do not put them to SCM), add them to classpath manually. see the link posted: https://answers.axonivy.com/questions/2089/add-library-with-pom-xml

(28.11.2019 at 02:45) Reguel Werme... ♦♦ Reguel%20Wermelinger's gravatar image

@tuanvv why do you pretend that the issue is fixed by migrating to 7.4 and afterwards create a new answer to the same problem? Now we have 3 questions for one library maven issues. And you mix docker and version migration problem into it : but it starts as and stays a simple maven library missunderstanding.

(28.11.2019 at 03:09) Reguel Werme... ♦♦ Reguel%20Wermelinger's gravatar image
showing 5 of 6 show 1 more comments

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "Title")
  • image?![alt text](/path/img.jpg "Title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×20

Asked: 27.11.2019 at 02:44

Seen: 1,472 times

Last updated: 28.11.2019 at 03:53