grehon / wlsagent

Automatically exported from code.google.com/p/wlsagent
GNU General Public License v3.0
0 stars 0 forks source link

java.lang.ClassCastException on Weblogic 12.1.2 #24

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?

1. Install and configure WLS 12.1.2
2. follow the install steps provided
3. run the commands

What is the expected output? What do you see instead?

Instead of printing the information i get

java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Long|

What version of the product are you using? On what operating system?

OS:   Red Hat Enterprise Linux Server release 6.3 (Santiago)
WLS:  12.1.2.0.0
JAVA: java-1.7.0-oracle-1.7.0.17-1jpp.1.el6_4.x86_64

Please provide any additional information below.

If i provoke an error (no authentication, wrong port, wrong/no username) 
everything works as expected - means i get the corresponding documented error.

Original issue reported on code.google.com by ampers...@googlemail.com on 22 Jan 2014 at 9:31

GoogleCodeExporter commented 8 years ago
Need help with that too!

Original comment by laravoro...@gmail.com on 15 May 2014 at 8:42

GoogleCodeExporter commented 8 years ago
Any update on above issue...I am also trying exactly same thing and got 
exception as above ... Is this something related to SDK version ??? or this is 
bug in plugin ... help will be appreciated ... Thanks in advance ...

Original comment by hazim.s...@gmail.com on 23 Aug 2014 at 8:22

GoogleCodeExporter commented 8 years ago
I also have this problem testing wlsagent-r185 on WLS 12.1.3 running on JDK8. I 
will see the code and try to help on this issue... I'm guessing maybe now the 
MBean attribute values obtained from JMX calls are not numeric anymore.

$ wget -q -O - 'http://localhost:5677/wlsagent/WlsAgent' 
--post-data='hostname=localhost&port=7001&username=weblogic&password=Pa$$&jvm=Us
edMemory,80,90'
java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Long

Original comment by tiago.j....@gmail.com on 5 Dec 2014 at 12:01

GoogleCodeExporter commented 8 years ago
I am also facing the same issue..
WLS-12.1.3
Java-jdk1.7.0_71
wlsagent-r185
Any help would be appreciated..

Original comment by chaitany...@gmail.com on 5 Dec 2014 at 7:05

GoogleCodeExporter commented 8 years ago
I don't think this a problem getting the MBean attribute values... apparently 
it is a problem during the creation of WLS JMX Connector:

java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Long
        at weblogic.management.remote.common.WLSRMIConnector.doConnect(WLSRMIConnector.java:202)
        at weblogic.management.remote.common.WLSRMIConnector.access$200(WLSRMIConnector.java:38)
        at weblogic.management.remote.common.WLSRMIConnector$4.run(WLSRMIConnector.java:184)
        at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
        at weblogic.security.subject.SubjectManager.runAs(SubjectManager.java:286)
        at weblogic.security.Security.runAs(Security.java:67)
        at weblogic.management.remote.common.WLSRMIConnector.connect(WLSRMIConnector.java:182)
        at javax.management.remote.JMXConnectorFactory.connect(JMXConnectorFactory.java:270)
        at net.wait4it.nagios.wlsagent.core.WLSProxy.init(Unknown Source)
        at net.wait4it.nagios.wlsagent.core.WLSStatsManager.process(Unknown Source)
        at net.wait4it.nagios.wlsagent.core.WLSServlet.doGet(Unknown Source)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
        at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:565)
        at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:479)
        at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:225)
        at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1031)
        at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:406)
        at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:186)
        at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:965)
        at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117)
        at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:111)
        at org.eclipse.jetty.server.Server.handle(Server.java:349)
        at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:452)
        at org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:884)
        at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:938)
        at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:634)
        at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:230)
        at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:77)
        at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:609)
        at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:45)
        at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:599)
        at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:534)
        at java.lang.Thread.run(Thread.java:745)

Original comment by tiago.j....@gmail.com on 19 Jan 2015 at 8:33

GoogleCodeExporter commented 8 years ago
I agree with tiago.j....@gmail.com findings.. looks like values are still 
returned as long but connecting MBean value is changed..

I am really from admin side, don't know much about the code..

if anyone has worked on this to fix issue or any work around, please do share 
so that others can get benefit... even comments or suggestions welcome, we may 
get some idea to fix it..

this tool is really awesome but does not work on WLS 12...

Thanks in advance 

Original comment by hazim.s...@gmail.com on 4 Apr 2015 at 6:39

GoogleCodeExporter commented 8 years ago
Hi everybody!
I've just figure out how to fix problem: need to modify init() method in 
WLSProxy class:
1. change Map<String, String> map = new HashMap<String,String>() to Map<String, 
Object> map = new HashMap<String,Object>()
2. change map.put("jmx.remote.x.request.waiting.timeout", "20000") to 
map.put("jmx.remote.x.request.waiting.timeout", 20000L)
3. build application with ant (perhaps, you should rename jar file from 
wlsagent.jar to wlsagent-r185.jar)
4. run application and use
After these modifications it worked on Weblogic 12c

Original comment by CABA1...@gmail.com on 14 Aug 2015 at 10:15