Solved
Spring scheduled method
I have a Spring scheduled method in Windchill and want to call some methods, but i get the erro that there is no active method context. So I tried to call the method via RemoteMethodServer.invoke(). This actually works but i always get the following error in the log:
2023-12-07 10:44:13,675 ERROR [pool-14-thread-1] wt.method.client - RemoteMethodServer.invoke() called on default method server from within method server! Probable bad loopback code! java.lang.Exception
at wt.method.RemoteMethodServer.logQuestionableOrBadInvokeCall(RemoteMethodServer.java:1581)
at wt.method.RemoteMethodServer.invoke(RemoteMethodServer.java:647)
at at.techsoft.ifactory.worker.components.QueueRetryMechanism.doRetry(QueueRetryMechanism.java:51)
at at.techsoft.ifactory.worker.components.QueueRetryMechanism.retryFailedEntries(QueueRetryMechanism.java:31)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.springframework.scheduling.support.ScheduledMethodRunnable.run(ScheduledMethodRunnable.java:84)
at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:54)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at java.base/java.util.concurrent.FutureTask.runAndReset(FutureTask.java:305)
at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:305)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:834)
Is there a way to get the active method context without calling RemoteMethodServer.inoke()?
The code runs in the ServerManager I think.
Thanks!

