WebLogic integration with custom security provider - WeblogicAgent9 classpath

Hi,

I am attempting to integrate WebLogic 12.1.3.0.0 into IntelliJ 2017.1.2 and I'm getting a WrappedException (ultimately culminating in a ClassNotFound exception) regarding a custom security provider we've developed for WebLogic. The server actually starts without issues; I can access resources deployed on it no problem, the admin console works, etc. The problem arises whenever I try to do something that has IntelliJ try to access the server through WeblogicAgent9. The startup script for this agent occurs during the server startup and it does not have the same classpath as the WebLogic server.

Is there a way to add to the classpath of the WeblogicAgent9? I have tried adding the jar containing the class to the application server as a library in Settings -> Build, Execution, Deployment -> Application Servers to no avail. I've also tried starting the server locally through the command line (which works) and setting it up as a remote server in IntelliJ, but the exception also occurs when trying to test the connection.

 

Full stacktrace from the log during an attempt to stop the server:

2017-05-10 09:27:35,381 [3117609] WARN - erver.JavaeeServerInstanceImpl - java.io.IOException: ; nested exception is:
weblogic.utils.NestedException: java.lang.AssertionError: Exception creating response stream
java.io.IOException: ; nested exception is:
weblogic.utils.NestedException: java.lang.AssertionError: Exception creating response stream
at weblogic.management.remote.common.ClientProviderBase.makeConnection(ClientProviderBase.java:237)
at weblogic.management.remote.common.ClientProviderBase.newJMXConnector(ClientProviderBase.java:120)
at javax.management.remote.JMXConnectorFactory.newJMXConnector(JMXConnectorFactory.java:369)
at javax.management.remote.JMXConnectorFactory.connect(JMXConnectorFactory.java:267)
at com.intellij.javaee.weblogic.agent.version9.WeblogicJMXConnector.connect(WeblogicJMXConnector.java:49)
at com.intellij.javaee.weblogic.agent.WebLogicAgent9.connectBean(WebLogicAgent9.java:89)
at com.intellij.javaee.weblogic.agent.WebLogicAgent9.initConnection(WebLogicAgent9.java:107)
at com.intellij.javaee.weblogic.agent.WebLogicAgent9.doConnect(WebLogicAgent9.java:82)
at com.intellij.javaee.oss.agent.SimpleAgentBase$1.doJob(SimpleAgentBase.java:21)
at com.intellij.javaee.oss.agent.SimpleAgentBase$1.doJob(SimpleAgentBase.java:17)
at com.intellij.javaee.oss.agent.SimpleAgentJob.perform(SimpleAgentJob.java:16)
at com.intellij.javaee.oss.agent.SimpleAgentBase.connect(SimpleAgentBase.java:29)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at com.intellij.javaee.process.common.MethodInvocator.invoke(MethodInvocator.java:45)
at com.intellij.javaee.oss.process.JavaeeProcess.processRequest(JavaeeProcess.java:116)
at com.intellij.javaee.oss.process.JavaeeProcess.run(JavaeeProcess.java:56)
at com.intellij.javaee.oss.process.JavaeeProcess.main(JavaeeProcess.java:35)
Caused by: javax.naming.CommunicationException: ; nested exception is:
weblogic.utils.NestedException: java.lang.AssertionError: Exception creating response stream [Root exception is weblogic.rjvm.PeerGoneException: ; nested exception is:
weblogic.utils.NestedException: java.lang.AssertionError: Exception creating response stream]
at weblogic.jndi.internal.ExceptionTranslator.toNamingException(ExceptionTranslator.java:74)
at weblogic.jndi.internal.WLContextImpl.translateException(WLContextImpl.java:531)
at weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:444)
at weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:426)
at javax.naming.InitialContext.lookup(InitialContext.java:411)
at weblogic.management.remote.common.ClientProviderBase.makeConnection(ClientProviderBase.java:222)
... 19 more
Caused by: weblogic.rjvm.PeerGoneException: ; nested exception is:
weblogic.utils.NestedException: java.lang.AssertionError: Exception creating response stream
at weblogic.rjvm.RJVMImpl.gotExceptionReceiving(RJVMImpl.java:1002)
at weblogic.rjvm.ConnectionManager.gotExceptionReceiving(ConnectionManager.java:1099)
at weblogic.rjvm.MsgAbbrevJVMConnection.gotExceptionReceiving(MsgAbbrevJVMConnection.java:527)
at weblogic.rjvm.t3.MuxableSocketT3.hasException(MuxableSocketT3.java:494)
at weblogic.socket.SocketMuxer.deliverExceptionAndCleanup(SocketMuxer.java:837)
at weblogic.socket.SocketMuxer.deliverHasException(SocketMuxer.java:777)
at weblogic.socket.JavaSocketMuxer.processSockets(JavaSocketMuxer.java:368)
at weblogic.socket.SocketReaderRequest.run(SocketReaderRequest.java:30)
at weblogic.work.ExecuteRequestAdapter.execute(ExecuteRequestAdapter.java:21)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:147)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:119)
Caused by: weblogic.utils.NestedException: java.lang.AssertionError: Exception creating response stream
at weblogic.rjvm.RJVMImpl.gotExceptionReceiving(RJVMImpl.java:999)
... 10 more
Caused by: java.lang.AssertionError: Exception creating response stream
at weblogic.rjvm.MsgAbbrevJVMConnection.readMsgAbbrevs(MsgAbbrevJVMConnection.java:298)
at weblogic.rjvm.MsgAbbrevInputStream.init(MsgAbbrevInputStream.java:212)
at weblogic.rjvm.MsgAbbrevJVMConnection.dispatch(MsgAbbrevJVMConnection.java:507)
at weblogic.rjvm.t3.MuxableSocketT3.dispatch(MuxableSocketT3.java:489)
at weblogic.socket.BaseAbstractMuxableSocket.dispatch(BaseAbstractMuxableSocket.java:359)
at weblogic.socket.SocketMuxer.readReadySocketOnce(SocketMuxer.java:970)
at weblogic.socket.SocketMuxer.readReadySocket(SocketMuxer.java:897)
at weblogic.socket.JavaSocketMuxer.processSockets(JavaSocketMuxer.java:344)
... 4 more
Caused by: java.lang.ClassNotFoundException: our.custom.security.principal.CustomPrincipalImpl
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:270)
at java.io.ObjectInputStream.resolveClass(ObjectInputStream.java:625)
at weblogic.rjvm.InboundMsgAbbrev$ServerChannelInputStream.resolveClass(InboundMsgAbbrev.java:109)
at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1612)
at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1517)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1771)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1350)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:370)
at java.util.LinkedList.readObject(LinkedList.java:1136)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:1017)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1893)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1798)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1350)
at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1990)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1915)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1798)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1350)
at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1990)
at java.io.ObjectInputStream.defaultReadObject(ObjectInputStream.java:500)
at weblogic.security.acl.internal.AuthenticatedSubject.readObject(AuthenticatedSubject.java:406)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:1017)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1893)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1798)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1350)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:370)
at weblogic.rjvm.InboundMsgAbbrev.readObject(InboundMsgAbbrev.java:67)
at weblogic.rjvm.InboundMsgAbbrev.read(InboundMsgAbbrev.java:39)
at weblogic.rjvm.MsgAbbrevJVMConnection.readMsgAbbrevs(MsgAbbrevJVMConnection.java:287)
... 11 more

1
4 comments

Also, startup of the agent:

C:\dev\jdk\bin\java -Dfile.encoding=windows-1252 -classpath C:\dev\oracle\wlserver\server\lib\weblogic.jar;C:\dev\oracle\wlserver\server\lib\wljmxclient.jar;C:\Users\nheiden\AppData\Local\JetBrains\Toolbox\apps\IDEA-U\ch-0\171.4249.39\plugins\weblogicIntegration\lib\weblogicIntegration.jar;C:\Users\nheiden\AppData\Local\JetBrains\Toolbox\apps\IDEA-U\ch-0\171.4249.39\plugins\JavaEE\lib\javaee-impl.jar;C:\Users\nheiden\AppData\Local\JetBrains\Toolbox\apps\IDEA-U\ch-0\171.4249.39\lib\openapi.jar;C:\Users\nheiden\AppData\Local\JetBrains\Toolbox\apps\IDEA-U\ch-0\171.4249.39\lib\util.jar;C:\Users\nheiden\AppData\Local\JetBrains\Toolbox\apps\IDEA-U\ch-0\171.4249.39\plugins\weblogicIntegration\lib\specifics\weblogicSpecifics.jar com.intellij.javaee.oss.process.JavaeeProcess 59701 com.intellij.javaee.weblogic.agent.WebLogicAgent9

1

I've asked the responsible developer to comment. Submitting an issue at https://youtrack.jetbrains.com/issues/IDEA is recommended.

1
Good catch, thanks. Right now there are no ways to externally modify the agent's classpath so I don't see any workarounds in the current codebase.
 
I suggested some workaround for 2017.2 stream in youtrack, lets continue discussion there to make the possible future solution better discoverable.
 
Thanks 
 
1

Please sign in to leave a comment.