5 Replies Latest reply: Dec 18, 2012 11:17 AM by 978495 RSS

    Cause: java.net.MalformedURLException: Unsupported protocol: t3

    978495
      I suppose this is the correct forum to post this question. If not let me know.

      I have Weblogic, Tomcat 7.0, PHP, Java, and PHP/Java Bridge installed on Windows 7.

      I used this ->http://docs.oracle.com/cd/E13222_01/wls/docs90/jmx/accessWLS.html
      to create a PHP script to call the Weblogic/Java classes to add/delete users/groups etc. However, I cannot get passed the "Unsupported protocol: t3" error.

      In the Oracle docs it clearly states that you have to add the wljmxclient.jar classpath. I have added it to my Windows classpath and I even copied the jar file to the JavaBridge/WEB-INF/lib directory on Tomcat. I still get the error.

      I tried switching the protocol to iiop but then I got new errors about not being bound to the context etc. I want to fix the t3 error. I can write a script with the WLS Tool and use t3 and it works. I access the console with t3 and it works.

      I have seen that others have had the issue but didn't see a solution.

      Any help would be appreciated.

      HTTP Status 500 - java.lang.RuntimeException: PHP Fatal error: Uncaught [[o:Exception]:"java.lang.Exception: Invoke failed: [[c:JMXConnectorFactory]]->connect((o:JMXServiceURL)[o:JMXServiceURL], (i:Map)[o:Hashtable]). Cause: java.net.MalformedURLException: Unsupported protocol: t3 VM: 1.7.0_01@http://java.oracle.com/" at:
        • 1. Re: Cause: java.net.MalformedURLException: Unsupported protocol: t3
          Kalyan Pasupuleti-Oracle
          Hi,

          Try to use Wlfullclient.jar into the classpath and try again.

          When you try to access through PHP it unable identified t3 it protocol violation.

          Try to keep that jar in classpath and test again.

          Regards,
          Kal
          • 2. Re: Cause: java.net.MalformedURLException: Unsupported protocol: t3
            978495
            Thanks but where do I find the wlfullclient.jar? I am using Oracle WL 12c and I do not see that jar and can't find it in a search. I do see a wlclient.jar. I tried it and still didn't work.
            • 3. Re: Cause: java.net.MalformedURLException: Unsupported protocol: t3
              978495
              OK. So I found on weblogic wonders that you can do the following to create the wlfullclient.jar file:
              1) navigate to
              C:\Oracle\Middleware\wlserver_12.1\server\lib
              2) issue the following command
              java -jar wljarbuilder.jar -profile wlfullclient

              Then I added the classpath="C:\Oracle\Middleware\wlserver_12.1\server\lib. I removed the line from my code that calls the setWLSEnv.cmd to avoid ovewriting anything. I even copied the newly created wlfullclient.jar to the C:\Program Files\Apache Software Foundation\Tomcat 7.0\webapps\JavaBridge\WEB-INF\lib dirrectory to make sure it was still available to my script.

              I restart Tomcat. And still . . . the same error:

              HTTP Status 500 - java.lang.RuntimeException: PHP Fatal error: Uncaught [[o:Exception]:"java.lang.Exception: Invoke failed: [[c:JMXConnectorFactory]]->connect((o:JMXServiceURL)[o:JMXServiceURL], (i:Map)[o:Hashtable]). Cause: java.net.MalformedURLException: Unsupported protocol: t3 VM: 1.7.0_01@http://java.oracle.com/" at:

              So what am I doing wrong here?
              • 4. Re: Cause: java.net.MalformedURLException: Unsupported protocol: t3
                978495
                OK. 4 days later and I am still stuck. Surely someone on this Forum knows what i am doing incorrectly.

                I am using Weblogic 12c, Tomcat 7.0, PHP 5.4, PHP/Java Bridge on Windows 7. All localhost.

                I set up Weblogic. I can run the console at http://localhost:7001/console and create users and groups and delete them. I can even start the WLS command line tool and connect via t3://localhost:7001. I even pinged it. All works.

                My Tomcat works. I am install the PHP/Java Bridge examples and they work.

                I created a test.php file using this-> http://docs.oracle.com/cd/E24329_01/web.1211/e24415/accesswls.htm#JMXCU153

                I made sure that my classpath pointed to the wljmxclient.jar file. The guy above said to create the wlfullclient.jar file. Someone else pointed me to the wlthint3client.jar file. And yet another pointed me to weblogic.jar. I have added all of them and then individually to the classpath. Tried and I still get the same error. I

                I created the wlfullclient.jar file with, first, the following ant build.xml file:
                http://middlewaremagic.com/weblogic/?p=558
                and then with the weblogic jarbuilder as described here:
                http://docs.oracle.com/cd/E11035_01/wls100/client/jarbuilder.html#wp1077742
                Still got the same error . . . unsupported protocol.

                I even added them to the \Tomcat 7.0\webapps\[myapp]\WEB-INF\lib directory to make sure that they were accessible. Still, same error.

                I logged into the Weblogic console and enabled tunneling in the protocols tab for t3 and set up the user ID/pwd for IIOP. Still, same error.

                I tried http and iiop and get the same unsupported protocol/malformed URL message.

                So I am missing something. And this is after looking over the docs, the forums and the net plus trying all combinations.

                So does this work? Or what am I doing wrong that it is not working for me?

                The entire error is:

                HTTP Status 500 - java.lang.RuntimeException: PHP Fatal error: Uncaught [[o:Exception]:"java.lang.Exception: Invoke failed: [[c:JMXConnectorFactory]]->connect((o:JMXServiceURL)[o:JMXServiceURL], (i:Map)[o:Hashtable]). Cause: java.net.MalformedURLException: Unsupported protocol: t3 VM: 1.7.0_09@http://java.oracle.com/" at:

                type Exception report

                message java.lang.RuntimeException: PHP Fatal error: Uncaught [[o:Exception]:"java.lang.Exception: Invoke failed: [[c:JMXConnectorFactory]]->connect((o:JMXServiceURL)[o:JMXServiceURL], (i:Map)[o:Hashtable]). Cause: java.net.MalformedURLException: Unsupported protocol: t3 VM: 1.7.0_09@http://java.oracle.com/" at:

                description The server encountered an internal error that prevented it from fulfilling this request.

                exception

                javax.servlet.ServletException: java.lang.RuntimeException: PHP Fatal error: Uncaught [[o:Exception]:"java.lang.Exception: Invoke failed: [[c:JMXConnectorFactory]]->connect((o:JMXServiceURL)[o:JMXServiceURL], (i:Map)[o:Hashtable]). Cause: java.net.MalformedURLException: Unsupported protocol: t3 VM: 1.7.0_09@http://java.oracle.com/" at:
                #-11 javax.management.remote.JMXConnectorFactory.newJMXConnector(Unknown Source)
                #-10 javax.management.remote.JMXConnectorFactory.connect(Unknown Source)
                #-9 sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                #-8 sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
                #-7 sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
                #-6 java.lang.reflect.Method.invoke(Unknown Source)
                #-5 php.java.bridge.JavaBridge.Invoke(JavaBridge.java:1044)
                #-4 php.java.bridge.Request.handleRequest(Request.java:417)
                #-3 php.java.bridge.Request.handleRequests(Request.java:500)
                #-2 php.java.bridge.http.ContextRunner.run(ContextRunner.java:145)
                #-1 php.java.bridge.ThreadPool$Delegate.run(ThreadPool.java:60)
                #0 C:\Program Files (x86)\Apache Software Foundat in C:\Program Files (x86)\Apache Software Foundation\Tomcat 7.0\webapps\ops_land\java\Java.inc on line 195

                     php.java.servlet.fastcgi.FastCGIServlet.handle(FastCGIServlet.java:499)
                     php.java.servlet.fastcgi.FastCGIServlet.doGet(FastCGIServlet.java:521)
                     javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
                     javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
                     php.java.servlet.PhpCGIFilter.doFilter(PhpCGIFilter.java:126)

                root cause

                java.lang.RuntimeException: PHP Fatal error: Uncaught [[o:Exception]:"java.lang.Exception: Invoke failed: [[c:JMXConnectorFactory]]->connect((o:JMXServiceURL)[o:JMXServiceURL], (i:Map)[o:Hashtable]). Cause: java.net.MalformedURLException: Unsupported protocol: t3 VM: 1.7.0_09@http://java.oracle.com/" at:
                #-11 javax.management.remote.JMXConnectorFactory.newJMXConnector(Unknown Source)
                #-10 javax.management.remote.JMXConnectorFactory.connect(Unknown Source)
                #-9 sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                #-8 sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
                #-7 sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
                #-6 java.lang.reflect.Method.invoke(Unknown Source)
                #-5 php.java.bridge.JavaBridge.Invoke(JavaBridge.java:1044)
                #-4 php.java.bridge.Request.handleRequest(Request.java:417)
                #-3 php.java.bridge.Request.handleRequests(Request.java:500)
                #-2 php.java.bridge.http.ContextRunner.run(ContextRunner.java:145)
                #-1 php.java.bridge.ThreadPool$Delegate.run(ThreadPool.java:60)
                #0 C:\Program Files (x86)\Apache Software Foundat in C:\Program Files (x86)\Apache Software Foundation\Tomcat 7.0\webapps\ops_land\java\Java.inc on line 195

                     php.java.servlet.fastcgi.FastCGIServlet.parseBody(FastCGIServlet.java:409)
                     php.java.servlet.fastcgi.FastCGIServlet.execute(FastCGIServlet.java:433)
                     php.java.servlet.fastcgi.FastCGIServlet.handle(FastCGIServlet.java:481)
                     php.java.servlet.fastcgi.FastCGIServlet.doGet(FastCGIServlet.java:521)
                     javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
                     javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
                     php.java.servlet.PhpCGIFilter.doFilter(PhpCGIFilter.java:126)

                note The full stack trace of the root cause is available in the Apache Tomcat/7.0.33 logs.
                • 5. Re: Cause: java.net.MalformedURLException: Unsupported protocol: t3
                  978495
                  This is how I FINALLY connected to my Weblogic:

                  1) I installed Tomcat 7.0 zip file instead of the installer and set it up manually. In my setenv.bat file it looks like:
                  set CATALINA_HOME=C:\Program Files (x86)\Apache Software Foundation\apache-tomcat-7.0.34
                  set CATALINA_BASE=C:\Program Files (x86)\Apache Software Foundation\apache-tomcat-7.0.34
                  set JAVA_HOME=C:\Program Files (x86)\Java\jdk1.7.0_09
                  set JRE_HOME=C:\Program Files (x86)\Java\jdk1.7.0_09\jre
                  set JAVA_OPTS=-Djava.ext.dirs=C:\Oracle\Middleware\wlserver_12.1\server\lib
                  set CLASSPATH=.;C:\Oracle\Middleware\wlserver_12.1\server\lib\wljmxclient.jar

                  exit /b 0

                  2) I enabled IIOP protocol in weblogic through the weblogic console and added a userid/password which I used in num 3 for the userID/password


                  3) My php script on Tomcat 7 with the PHP/Java Bridge (not the JMXServerURL . . . nowhere did I find that you had to use "rmi" as the protocol")

                  $serviceURL = new java("javax.management.remote.JMXServiceURL","rmi","localhost","7001","/jndi/iiop://localhost:7001/weblogic.management.mbeanservers.edit");

                  //"service:jmx:iiop://localhost:7001/jndi/weblogic.management.mbeanservers.edit");

                  $env = new java("java.util.Hashtable");
                  $env->put("javax.management.remote.JMXConnectorFactory.PROTOCOL_PROVIDER_PACKAGES","weblogic.management.remote");
                  $env->put("javax.naming.Context.SECURITY_PRINCIPAL", "myuserID");
                  $env->put("javax.naming.Context.SECURITY_CREDENTIALS", "mypassword");

                  $jmxCon = java("javax.management.remote.JMXConnectorFactory")->newJMXConnector($serviceURL, $env);
                  $jmxCon->connect();
                  $connection = $jmxCon->getMBeanServerConnection();

                  $mbeans = $connection->queryNames(null,null);

                  foreach($mbeans as $key=>$value) {
                  echo $key. "=". $value;
                  }

                  It connected and printed out all the mbeans for my admin server and my two managed servers that I created for testing.