Questions asked by Lars Tuchelhttps://answers.axonivy.com/questions/asked-by/41/lars-tuchel/?type=rssQuestions asked by <a href="/users/41/lars-tuchel" >Lars Tuchel</a>enTue, 09 Jul 2019 07:31:24 -0400Loading classes from WEB-INF/libhttps://answers.axonivy.com/questions/3879/loading-classes-from-web-inf-lib<p>Dear ivyteam</p> <p>In our project we'd like to have the following structure: Our ivy project contains a jar which has some Java interfaces. Then we'd like the implementations for these interfaces in another external jar that we can deploy independently. Our idea was to put into the WEB-INF/lib folder. </p> <p><img alt="alt text" src="https://answers.axonivy.com/upfiles/example.png"></p> <p>But if we try to load the class from the jar (using <code>ClassLoader#loadClass</code>) we get a <code>NoClassDefFound</code> exception. Is there any way to get such a structure to work? Maybe with some class loader magic?</p> <p>Best regards Lars</p>Lars TuchelTue, 09 Jul 2019 07:31:24 -0400https://answers.axonivy.com/questions/3879/loading-classes-from-web-inf-libclassloaderivyDeployment options for application ziphttps://answers.axonivy.com/questions/3657/deployment-options-for-application-zip<p>Dear ivyteam</p> <p>According to the <a href="https://developer.axonivy.com/doc/latest/EngineGuideHtml/administration.html#administration-deployment-advanced">documentation</a> we can configure additional behaviour for the automatic deployment with a <em>deploy.options.yaml</em> file. Our package currently looks as follows:</p> <pre><code>application.zip projectA-1.0.iar ... deploy.options.yaml projectB-2.4.iar ... deploy.options.yaml </code></pre> <p>In the yaml files we configured properties like <code>fileFormat: EXPANDED</code>. Unfortunately this did not work and the iars were deployed packed. Only after we added a <em>deploy.options.yaml</em> file to the zip the iar were deployed expanded. Is this expected behaviour? The documentation is not very clear about that. (We're using ivy 7.1.x by the way)</p> <p>We would like to have a yaml file per iar as the target version may be different for each iar. Is this supported?</p> <p>Best regards, Lars</p>Lars TuchelTue, 05 Feb 2019 12:04:16 -0500https://answers.axonivy.com/questions/3657/deployment-options-for-application-zipdeploymentCan I use a WebSocket in Axon.ivy 6.x?https://answers.axonivy.com/questions/2838/can-i-use-a-websocket-in-axon-ivy-6-x<p>Hi ivyTeam</p> <p>I need to have a WebSocket in an ivyProject. I thought about using Primefaces Push Endpoints for this. I know about <a href="https://answers.axonivy.com/questions/10/can-i-use-primepush-in-xpert-ivy">this solution for ivy 4.x and 5.x</a> but this doesn't seem to work anymore. I get the following errors and no endpoints are available:</p> <pre><code>13:56:58.687 WARN [org.atmosphere.cpr.AsynchronousProcessor] [http-nio-8081-exec-3] [requestId=3] Websocket protocol not supported 13:57:09.974 WARN [org.apache.catalina.loader.WebappClassLoaderBase] [localhost-startStop-2] [] The web application [ivy] appears to have started a thread named [Atmosphere-Scheduler-4] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread: sun.misc.Unsafe.park(Native Method) java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:215) java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2078) java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.poll(ScheduledThreadPoolExecutor.java:1134) java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.poll(ScheduledThreadPoolExecutor.java:809) java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1066) java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1127) java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) java.lang.Thread.run(Thread.java:745) 13:57:09.975 WARN [org.apache.catalina.loader.WebappClassLoaderBase] [localhost-startStop-2] [] The web application [ivy] appears to have started a thread named [Atmosphere-Scheduler-5] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread: sun.misc.Unsafe.park(Native Method) java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:215) java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2078) java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.poll(ScheduledThreadPoolExecutor.java:1129) java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.poll(ScheduledThreadPoolExecutor.java:809) java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1066) java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1127) java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) java.lang.Thread.run(Thread.java:745) 13:57:46.830 WARN [] [main] [executionContext=SYSTEM] the logger can't be the child of org.eclipse.birt 13:59:28.618 WARN [org.atmosphere.cpr.DefaultAsyncSupportResolver] [http-nio-8081-exec-2] [requestId=1] Found multiple containers, please specify which one to use: org.atmosphere.container.Tomcat7CometSupport, org.atmosphere.container.TomcatCometSupport, until you do, Atmosphere will use:class org.atmosphere.container.Tomcat7CometSupport 13:59:28.638 ERROR [org.primefaces.push.PushServlet] [http-nio-8081-exec-2] [requestId=1] No Annotated class using @PushEndpoint found. Push will not work. 13:59:28.664 WARN [org.atmosphere.cpr.AsynchronousProcessor] [http-nio-8081-exec-2] [requestId=1] Websocket protocol not supported 14:02:04.718 WARN [org.apache.catalina.loader.WebappClassLoaderBase] [localhost-startStop-2] [] The web application [ivy] appears to have started a thread named [Atmosphere-Scheduler-0] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread: sun.misc.Unsafe.park(Native Method) java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:215) java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2078) java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.poll(ScheduledThreadPoolExecutor.java:1134) java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.poll(ScheduledThreadPoolExecutor.java:809) java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1066) java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1127) java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) java.lang.Thread.run(Thread.java:745) 14:02:04.720 WARN [org.apache.catalina.loader.WebappClassLoaderBase] [localhost-startStop-2] [] The web application [ivy] appears to have started a thread named [Atmosphere-Scheduler-6] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread: sun.misc.Unsafe.park(Native Method) java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:215) java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2078) java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.poll(ScheduledThreadPoolExecutor.java:1129) java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.poll(ScheduledThreadPoolExecutor.java:809) java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1066) java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1127) java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) java.lang.Thread.run(Thread.java:745) 14:03:26.818 WARN [] [main] [executionContext=SYSTEM] the logger can't be the child of org.eclipse.birt 14:04:38.170 WARN [org.atmosphere.cpr.DefaultAsyncSupportResolver] [http-nio-8081-exec-2] [requestId=2] Found multiple containers, please specify which one to use: org.atmosphere.container.Tomcat7CometSupport, org.atmosphere.container.TomcatCometSupport, until you do, Atmosphere will use:class org.atmosphere.container.Tomcat7CometSupport 14:04:38.189 ERROR [org.primefaces.push.PushServlet] [http-nio-8081-exec-2] [requestId=2] No Annotated class using @PushEndpoint found. Push will not work. 14:04:38.209 WARN [org.atmosphere.cpr.AsynchronousProcessor] [http-nio-8081-exec-2] [requestId=2] Websocket protocol not supported 14:09:54.778 WARN [org.apache.catalina.loader.WebappClassLoaderBase] [localhost-startStop-2] [] The web application [ivy] appears to have started a thread named [Atmosphere-Scheduler-1] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread: sun.misc.Unsafe.park(Native Method) java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:215) java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2078) java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.poll(ScheduledThreadPoolExecutor.java:1134) java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.poll(ScheduledThreadPoolExecutor.java:809) java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1066) java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1127) java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) java.lang.Thread.run(Thread.java:745) 14:09:54.779 WARN [org.apache.catalina.loader.WebappClassLoaderBase] [localhost-startStop-2] [] The web application [ivy] appears to have started a thread named [Atmosphere-Scheduler-11] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread: sun.misc.Unsafe.park(Native Method) java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:215) java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2078) java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.poll(ScheduledThreadPoolExecutor.java:1129) java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.poll(ScheduledThreadPoolExecutor.java:809) java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1066) java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1127) java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) java.lang.Thread.run(Thread.java:745) 14:10:30.830 WARN [] [Worker-0] [executionContext=SYSTEM] the logger can't be the child of org.eclipse.birt </code></pre> <p>Here's what I added to the web.xml:</p> <pre><code> &lt;servlet&gt; &lt;servlet-name&gt;Push Servlet&lt;/servlet-name&gt; &lt;servlet-class&gt;org.primefaces.push.PushServlet&lt;/servlet-class&gt; &lt;async-supported&gt;true&lt;/async-supported&gt; &lt;init-param&gt; &lt;param-name&gt;org.atmosphere.useWebSocketAndServlet3&lt;/param-name&gt; &lt;param-value&gt;true&lt;/param-value&gt; &lt;/init-param&gt; &lt;init-param&gt; &lt;param-name&gt;org.atmosphere.websocket.suppressJSR356&lt;/param-name&gt; &lt;param-value&gt;true&lt;/param-value&gt; &lt;/init-param&gt; &lt;/servlet&gt; &lt;servlet-mapping&gt; &lt;servlet-name&gt;Push Servlet&lt;/servlet-name&gt; &lt;url-pattern&gt;/primepush/*&lt;/url-pattern&gt; &lt;/servlet-mapping&gt; </code></pre> <p>And what I added to the webapps/ivy/WEB-INF/lib directory:</p> <pre><code>atmosphere-runtime-native-2.4.14.jar atmosphere-compat-tomcat-2.0.1.jar atmosphere-compat-jbossweb-2.0.1.jar atmosphere-compat-tomcat7-2.0.1.jar </code></pre> <p>I saw that you implemented a websocket for the chat feature in the Portal (XIVY-519) so it should still work. But in the Portal project, the atmosphere jar is directly in the project so the old way in the question linked above probably doesn't work anymore... </p> <p>TLDR; Could you give me a hint how I can create my own WebSocket endpoints in ivy 6.x?</p>Lars TuchelThu, 31 Aug 2017 08:55:55 -0400https://answers.axonivy.com/questions/2838/can-i-use-a-websocket-in-axon-ivy-6-xprimepushivy6x-migrationwebsocketIssue with receiving and sending the same signal in a processhttps://answers.axonivy.com/questions/1869/issue-with-receiving-and-sending-the-same-signal-in-a-process<p>Hi everyone</p> <p>So I have a process with a User Task that has a signal boundary event that listens to a certain signal X. After the user task is finished I check some values and depending on that I want to send the same signal X. See the image below: </p> <p><img alt="no alt text" src="http://answers.axonivy.com/upfiles/signals.png"></p> <p>But when that signal is sent I get the following exception:</p> <pre><code>java.lang.IllegalStateException: State of Task must be one of the following values CREATED, RESUMED but is DESTROYED at ch.ivyteam.api.API.checkObjectState(API.java:323) at ch.ivyteam.ivy.workflow.internal.Task.end(Task.java:2642) at ch.ivyteam.ivy.workflow.internal.Task$49.execute(Task.java:2618) at ch.ivyteam.ivy.persistence.base.AbstractPersistencyService.execute(AbstractPersistencyService.java:176) at ch.ivyteam.ivy.persistence.base.AbstractPersistencyService.execute(AbstractPersistencyService.java:233) at ch.ivyteam.ivy.persistence.base.ClassPersistencyService.execute(ClassPersistencyService.java:660) [...] </code></pre> <p>I uploaded a demo project here: <a href="https://drive.google.com/file/d/0B3V8Sh7Fl7FXR3dzMFhzVzJlTEk/view?usp=sharing">https://drive.google.com/file/d/0B3V8Sh7Fl7FXR3dzMFhzVzJlTEk/view?usp=sharing</a></p> <p>Thanks in advance</p>Lars TuchelTue, 05 Jul 2016 14:08:11 -0400https://answers.axonivy.com/questions/1869/issue-with-receiving-and-sending-the-same-signal-in-a-processsignalsprocessivyHow can I get the ClassLoader of a specific PMVhttps://answers.axonivy.com/questions/1391/how-can-i-get-the-classloader-of-a-specific-pmv<p>Hi everyone</p> <p>Is it possible to receive the ClassLoader of a specific Process Model/Process Model Version (if I already have an <code>IProcessModelVersion</code> instance)?</p> <p>Best regards Lars</p>Lars TuchelTue, 07 Jul 2015 14:36:24 -0400https://answers.axonivy.com/questions/1391/how-can-i-get-the-classloader-of-a-specific-pmvjavaFailed to load Resources in Composite Componentshttps://answers.axonivy.com/questions/1357/failed-to-load-resources-in-composite-components<p>Hello </p> <p>We have two projects project A and project B.</p> <p>There's an ivy composite component in project A, which is used in a dialog in project B. If the composite component in project A uses a resource from the dialog directory, it can not be loaded an an error message is shown.</p> <pre><code> Error (Http Status Code 500) ServletException Html Dialog with id ch.tuchella.libdemo.CompositeComponent not found Caused by IvyRuntimeException: Html Dialog with id ch.tuchella.libdemo.CompositeComponent not found [...] </code></pre> <p>If the composite component is used in the same project, or if the composite component does not include resources no error occurs.</p> <p><a href="https://drive.google.com/file/d/0B3V8Sh7Fl7FXZ2Q5TmlsWnZQWE0/view?usp=sharing">Here</a>'s an example project.</p> <p>Do you have any idea about this? Is it a known issue? </p> <p>Best regards Lars Tuchel</p>Lars TuchelThu, 11 Jun 2015 10:07:24 -0400https://answers.axonivy.com/questions/1357/failed-to-load-resources-in-composite-componentshtmluserdialogjsfStart a process in plain Javahttps://answers.axonivy.com/questions/179/start-a-process-in-plain-java<p>Is there a possibility to start a Xpert.ivy process from a Java bean in my ivy project? Either by calling a request start or a sub process...</p> <p>Something like:</p> <pre><code>String signature = "myProcess()"; Set&lt;IProcessStart&gt; processes = ivy.wf.findProcessStartsBySignature(signature); if(!processes.isEmpty()){ IProcessStart process = processes.iterator().next(); IProcessRequest request = RequestFactory.createProcessRequest( ivy.request.getProcessModelVersion(), process.getRequestPath(), new HashMap&lt;String, Object&gt;() ); try{ // somehow send the request... }catch(Exception e){ // do some exception handling if process fails... } } </code></pre> <p>The main purpose is to be able to catch exceptions which may be thrown from the process. </p>Lars TuchelFri, 06 Dec 2013 14:38:35 -0500https://answers.axonivy.com/questions/179/start-a-process-in-plain-javajava