HI Scott,

As u said i used the system property MyJMXUrl and added it to the
http-invoker.sar/meta-inf/jboss-service.xml file as shown below. Here i
guess after the dollar sign and in the flower brackets the system property
should lie.


<attribute name="InvokerURL">${MyJMXUrl}</attribute>

And i am setting this system property in the client start up before calling
this servlet or making this invocation and i get the following error. As i
analysed the property its self is not read and replaced . But if i use the
complete URL as u said explicitly it works

<attribute
name="InvokerURL">http://thehostiwant:8080/invoker/EJBInvokerServlet</attrib
ute>

but i want the system property to be working as some of my clients are in
the local network and some are out side and both has differetn host names.
So for different clients i can set at the start up this system property if
it works.

I thought there was some problem in the code of the class Util and added the
else clause as follows but no use

   /** Validate that the invokerURL is set, and if not build it from
    * the invokerURLPrefix + host + invokerURLSuffix.
    */
   protected void checkInvokerURL() throws UnknownHostException
   {
      if( invokerURL == null )
      {
         InetAddress addr = InetAddress.getLocalHost();
         String host = useHostName ? addr.getHostName() :
addr.getHostAddress();
         String url = invokerURLPrefix + host + invokerURLSuffix;
         setInvokerURL(url);
      }
      else setInvokerURL(invokerURL);
   }

can u pls help me out as ur the author of this code ..

thanks jani.

Error code in the client is as follows



java.naming.factory.initial=org.jboss.naming.HttpNamingContextFactory}
javax.naming.NamingException: Failed to retrieve Naming interface [Root
exception is java.net.MalformedURLException: no protocol: null]
        at
org.jboss.naming.HttpNamingContextFactory.getInitialContext(HttpNamingContex
tFactory.java:68)
        at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)
        at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
        at javax.naming.InitialContext.init(Unknown Source)
        at javax.naming.InitialContext.<init>(Unknown Source)
        at
de.sepp.util.EJBServiceLocator.initInitialContext(EJBServiceLocator.java:256
)
        at de.sepp.util.EJBServiceLocator.getInstance(EJBServiceLocator.java:297)
        at
de.sepp.client.support.WorkClientSupportProvider.<init>(WorkClientSupportPro
vider.java:49)
        at de.sepp.client.MainApplication.main(MainApplication.java:51)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at com.sun.javaws.Launcher.executeApplication(Unknown Source)
        at com.sun.javaws.Launcher.executeMainClass(Unknown Source)
        at com.sun.javaws.Launcher.continueLaunch(Unknown Source)
        at com.sun.javaws.Launcher.handleApplicationDesc(Unknown Source)
        at com.sun.javaws.Launcher.handleLaunchFile(Unknown Source)
        at com.sun.javaws.Launcher.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)
Caused by: java.net.MalformedURLException: no protocol: null
        at java.net.URL.<init>(Unknown Source)
        at java.net.URL.<init>(Unknown Source)
        at java.net.URL.<init>(Unknown Source)
        at org.jboss.invocation.http.interfaces.Util.resolveURL(Util.java:137)
        at
org.jboss.invocation.http.interfaces.HttpInvokerProxy.readExternal(HttpInvok
erProxy.java:121)
        at java.io.ObjectInputStream.readExternalData(Unknown Source)
        at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
        at java.io.ObjectInputStream.readObject0(Unknown Source)
        at java.io.ObjectInputStream.readObject(Unknown Source)
        at java.util.HashMap.readObject(Unknown Source)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at java.io.ObjectStreamClass.invokeReadObject(Unknown Source)
        at java.io.ObjectInputStream.readSerialData(Unknown Source)
        at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
        at java.io.ObjectInputStream.readObject0(Unknown Source)
        at java.io.ObjectInputStream.defaultReadFields(Unknown Source)
        at java.io.ObjectInputStream.readSerialData(Unknown Source)
        at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
        at java.io.ObjectInputStream.readObject0(Unknown Source)
        at java.io.ObjectInputStream.readObject(Unknown Source)
        at org.jboss.proxy.ClientContainer.readExternal(ClientContainer.java:111)
        at java.io.ObjectInputStream.readExternalData(Unknown Source)
        at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
        at java.io.ObjectInputStream.readObject0(Unknown Source)
        at java.io.ObjectInputStream.defaultReadFields(Unknown Source)
        at java.io.ObjectInputStream.readSerialData(Unknown Source)
        at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
        at java.io.ObjectInputStream.readObject0(Unknown Source)
        at java.io.ObjectInputStream.readObject(Unknown Source)
        at org.jboss.invocation.MarshalledValue.get(MarshalledValue.java:78)
        at
org.jboss.naming.HttpNamingContextFactory.getNamingServer(HttpNamingContextF
actory.java:115)
        at
org.jboss.naming.HttpNamingContextFactory.getInitialContext(HttpNamingContex
tFactory.java:64)
        ... 19 more

-----Ursprungliche Nachricht-----
Von: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Auftrag von Scott M
Stark
Gesendet: Donnerstag, 8. Januar 2004 17:16
An: [EMAIL PROTECTED]
Betreff: RE: [JBoss-user] problem with host name resolivng via http
invoker


Replace:

     <attribute name="InvokerURLPrefix">http://</attribute>
     <attribute
name="InvokerURLSuffix">:8080/invoker/EJBInvokerServlet</attribute>
     <attribute name="UseHostName">true</attribute>

with the explict url the client should use:
     <attribute
name="InvokerURL">http://thehostiwant:8080/invoker/EJBInvokerServlet</at
tribute>

this can also be system property name that is resolved at runtime
in the client vm for the situation that the server does not
know the external path the client takes to get to the server.

xxxxxxxxxxxxxxxxxxxxxxxx
Scott Stark
Chief Technology Officer
JBoss Group, LLC
xxxxxxxxxxxxxxxxxxxxxxxx
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Janardhan
Burugupalli
Sent: Thursday, January 08, 2004 2:10 AM
To: [EMAIL PROTECTED]
Subject: AW: [JBoss-user] problem with host name resolivng via http
invoker


HI all,

I have a problem , first look at the output i get

10:43:58,458 DEBUG [WorkClientEJBServiceLocator] Using the JNDI URL
:http://localhost:80/invoker/JNDIFactory 10:43:58,520 DEBUG
[HttpNamingContextFactory] Retrieving content from :
http://localhost:80/invoker/JNDIFactory 10:43:58,583 DEBUG
[HttpNamingContextFactory] ContentLength: -1
ContentType: application/x-java-serialized-object;
class=org.jboss.invocation.MarshalledValue 10:43:58,989 INFO  [Util] The
URL value obtained from
cleint:http://192.168.0.146:80/invoker/JMXInvokerServlet
10:43:59,114 DEBUG [EJBServiceLocator] Singleton instance of
EJBServiceLocator class 'de.sepp.client.WorkClientEJBServiceLocator'
created. 10:43:59,130 INFO  [Util] The URL used is
:http://192.168.0.146:80/invoker/JMXInvokerServlet


At the first time the JNDI invocation is done withe same URL as i have
provided

but later while accessing the JMXInvokerServlet its resolving the IP
address and instead of the host name

well i can change this in the
http-invoker.sar/meta-inf/jboss-service.xml by setting USeHostName
property to true

but what it does is it takes the InetAddress.getHostName   which is
nothing
but the computer name

in my case i am using a reverse proxy and there are two different ways
of accessing this machine. From local lan it is called xx1 and from
outside it is called xx2. So my request is in the second instance also
it should whatever hostname i gave it in the JNDI url...is it possible

any suggestions or solutions

thanks in advace
jani




-------------------------------------------------------
This SF.net email is sponsored by: Perforce Software.
Perforce is the Fast Software Configuration Management System offering
advanced branching capabilities and atomic changes on 50+ platforms.
Free Eval! http://www.perforce.com/perforce/loadprog.html
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user



-------------------------------------------------------
This SF.net email is sponsored by: Perforce Software.
Perforce is the Fast Software Configuration Management System offering
advanced branching capabilities and atomic changes on 50+ platforms.
Free Eval! http://www.perforce.com/perforce/loadprog.html
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to