|
|
|
|
|
|
Re: Scout application in single war [message #1848964 is a reply to message #1848937] |
Mon, 27 December 2021 05:05   |
Eclipse User |
|
|
|
The message "Session not of the expected type" you posted earlier suggests that you do somehow call server code from within a client context. Unfortunately, the debug log does not help, and it does not contain the method "execLoadPermission" you mentioned.
A point you have to keep in mind: When you put the client and server code in the same application, all of the bean classes are on the same class path. This means that when resolving an instance for an interface, you might get a different implementation than before. Example: assume there is an interface IFoo in the shared module, a ClientFoo implementation in the client module and a ServerFoo implementation in the server module. Naturally BEANS.get(IFoo.class) can only return one of the the implementations. If there are two WAR files, each part of the application only contains one implementation. But when merged, the bean manager will choose one of them. This can lead to errors when the implementation does not support this situation correcly. So if ServerFoo calls Sessions.currentSession(IServerSession.class), this may fail when called from within a client context. To fix it, you need an implementation that can handle both cases, e.g. "if (ISession.CURRENT.get() instanceof IClientSession) { ... }".
Long story short: If you need class isolation, stick to the setup with two separate WAR files (both application can't "see" each other). When deployed in a single WAR file, the bean implementations might have to be adjusted to work with different runtime contexts.
Regards,
Beat
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.29014 seconds