Retrive IP address in tomcat or JBoss

Pls let me know the implementation for retrieving the IP address of a remote user accessing the web application running under tomcat server.
The IP address should be displayed on tomcat server upon his entry into the application .
Is it possible to implement using getRemoteAddr() method.
I would appreciate any support and ideas from the other end.
Thanks in advance.

Umm.. yes getRemoteAddr() would do the trick. Why didn't you try it before you posted?

Similar Messages

  • Tomcat and JBoss

    Hello! I'm not that new to web programming in Java but there are some things that I think I need to fully understand. Can anyone here give me a comparison between Tomcat and JBoss? What are the similarities and key differences between the two? Tomcat is a servlet container while JBoss is an application container(?? not sure about that, still haven't read enough about it).
    Thanks in advance,
    Romaine

    Hi Romaine,
    Tomcat is not only a servelet container...its actually the webserver which is a servlet container and jsp engine as well.
    Where as JBOSS is one of the application servers where it provides the run time environment for the business components( the ejbs) in addition to the support environment for servlets and jsps.
    examples of application servers: JBOSS, WEBLOGIC, WEBSPHERE

  • What are the steps to Migrate a Web Service from Tomcat to JBoss

    Hi,
    I am totally new to JBoss and need some help. I mostly worked on BEA and Oracle. I have a web service deployed on Tomcat that needs to be now migrated to JBoss. What are the steps in moving a web service from Tomcat to JBoss.
    Is there some step by step tutorial on developing and deploying a web service on JBoss along with sample build script.
    Any help is really appreciated.
    Thanks

    R u using axis. If you want to stick with axis and don't want to use JBossWS there is nothing else you need to do. Move all the axis to Jboss. If you plan to reimplement all ur services in JBossWS here it is:
    http://jbws.dyndns.org/mediawiki/index.php?title=Quick_Start
    http://jbws.dyndns.org/mediawiki/index.php?title=User_Guide
    Let me know if you need anything else.

  • Distinguishing between Tomcat and JBoss

    I have a servlet that does a JNDI lookup, and I need that servlet to be able to figure out whether it's being served by Tomcat or JBoss (because the JNDI lookup is done differently depending on which servlet container it is). Using getServletContext().getServerInfo() doesn't help because it returns tomcat in both cases, since JBoss uses Tomcat as the servlet container. Does anyone know another way of determining whether it's Tomcat or JBoss?
    Thanks!
    --vlb1

    http://dinoch.dyndns.org:7070/axis1.2/AboutArrays2.jsp

  • Tomcat to jboss

    i have a web application using struts deployed under tomcat server i have another web application(based onservlets) deloyed under jboss both of them have their respective login pages. i am accessing the login page of 2nd application by giving its local url address in a jsp of first appication, now i want to pass the username and password of login page my first application into the login pag of second application.........how can i do that......how can i pass the username and password? plz help

    In web.xml making the following entry:
    <web-app>
    <description>MySQL Test App</description>
    <resource-ref>
    <description>DB Connection</description>
    <res-ref-name>jdbc/test</res-ref-name>
    <res-type>javax.sql.DataSource</res-type>
    <res-auth>Container</res-auth>
    </resource-ref>
    </web-app>
    Next, add a file jboss-web.xml under WEB-INF/ folder of the web-application. This file should contain entry as:
    <jboss-web>
    <resource-ref>
    <description>DB Connection</description>
    <res-ref-name>jdbc/test</res-ref-name>
    <res-type>javax.sql.DataSource</res-type>
    <jndi-name>java:/jdbc/test</jndi-name>
    <res-auth>Container</res-auth>
    </resource-ref>
    </jboss-web>
    Next, in JBOSS_HOME/server/default/deploy folder make a xx-ds.xml file or else, a similiar file can be found in that same folder with the name hsqldb-ds.xml. Make following entries in that xml file:
    <datasources>
    <local-tx-datasource>
    <jndi-name>/jdbc/test</jndi-name>
    <type-mapping>MySQL</type-mapping>
    <connection-url>jdbc:mysql://localhost:3306/shopping_cart</connection-url>
    <driver-class>com.mysql.jdbc.Driver</driver-class>
    <user-name>root</user-name>
    <password>root123</password>
    <min-pool-size>1</min-pool-size>
    <max-pool-size>5</max-pool-size>
    </local-tx-datasource>
    This should bind the jndi name.
    In our client application, we need to look up as:
    Context ctx = new InitialContext();
    DataSource ds = (DataSource)ctx.lookup("java:/jdbc/test");
    Connection conn = ds.getConnection();
    This works perfectly.

  • Tomcat client + JBOSS server

    Regarding to JBossIDE-Tutorial.pdf I worked through this tutorial and I reached my first EJB
    Now I�m trying to deploy the application as clent and server using Tomcat 5.5 and JBOSS 4.2.0GA ( on two different host placed in the same lan )
    I have the same project on the JBOSS and the new one in Tomcat
    In Tomcat I copied only the interfaces and servlet because I want to call the EJB method from Tomcat application container
    I modified the code of ComputeServlet.java in this way
    Hashtable env = new Hashtable();
    env.put(Context.INITIAL_CONTEXT_FACTORY,"org.jnp.interfaces.NamingCotextFactory");
    env.put(Context.PROVIDER_URL, "jnp://192.168.0.13:1099");
    Context context = new InitialContext(env);
    Object ref = context.lookup("ejb/Fibo");
    home = (FiboHome) PortableRemoteObject.narrow(ref, FiboHome.class);during the lookup method I reach the same error message
    --------javax.naming.CommunicationException: Could not obtain connection to any of these urls: 192.168.0.13:1099 and discovery failed with error: javax.naming.CommunicationException: Receive timed out [Root exception is java.net.SocketTimeoutException: Receive timed out] [Root exception is javax.naming.CommunicationException: Failed to connect to server 192.168.0.13:1099 [Root exception is javax.naming.ServiceUnavailableException: Failed to connect to server 192.168.0.13:1099 [Root exception is java.net.ConnectException: Connection refused: connect]]]
    it seams that the Tomcat client doesn�t reach the JBOSS server
    I wonder if anyone could give me any suggestion
    Many many thanks

    ok many thanks
    now all work properly
    the real problem was the ip address of JBOSS Server
    I found interesting faq at this link
    -> http://wiki.jboss.org/wiki/Wiki.jsp?page=JBoss42FAQ
    Frequently Asked Questions about the JBoss4.2 Release
    1. . Why can't I connect to the server remotely? All the services appear to be bound to localhost only.
    * That's correct before 4.2.0.GA jboss always bound to the any address "0.0.0.0". You wouldn't believe how many people would put unprotected instances of JBoss on the internet, or even on their own local LAN. Now you have to explicitly choose to do that, so it takes some thinking about before you revert to the old default behaviour with the "-b' option of jboss. e.g.
    ./run.sh -b 0.0.0.0
    For Windows, use
    run.bat -b 0.0.0.0

  • Migrating application from tomcat to jboss

    My application is working on tomcat but when try to deploy the same application war file it gives the following error
    no valid JNDI binding. Check the jboss-web/resource-ref.
    My web.xml is like this(only giving few lines here)
    <resource-ref>
    Inventory Source
    <res-ref-name>jdbc/InventorySource</res-ref-name>
    <res-type>javax.sql.DataSource</res-type>
    <res-auth>Container</res-auth>
    </resource-ref>
    Jboss-web.xml
    <?xml version="1.0" encoding="UTF-8"?>
    <jboss-web>
    <!-- Uncomment the security-domain to enable security. You will
    need to edit the htmladaptor login configuration to setup the
    login modules used to authentication users.
    <security-domain>java:/jaas/jmx-console</Dsecurity-domain>
    -->
    <reference-ref>
    <res-ref-name>jdbc/InventorySource</res-ref-name>
    <jndi-name>java:jdbc/InventorySource</jndi-name>
    </reference-ref>
    </jboss-web>
    postgres-ds.xml
    <?xml version="1.0" encoding="UTF-8"?>
    <!-- Example of the pointbase 4.8 datasource configuration -->
    <!-- $Id: pointbase-ds.xml 23720 2004-09-15 14:37:40Z loubyansky $ -->
    <local-tx-datasource>
    <jndi-name>jdbc/InventorySource</jndi-name>
    <use-java-context>false</use-java-context>
    <connection-url>jdbc:postgresql://localhost:5432/demo</connection-url>
    <driver-class>org.postgresql.Driver</driver-class>
    <user-name>admin</user-name>
    admin
    <type-mapping>PointBase</type-mapping>
    </local-tx-datasource>
    Please help me
    Thanks
    Parimoj

    In web.xml making the following entry:
    <web-app>
    <description>MySQL Test App</description>
    <resource-ref>
    <description>DB Connection</description>
    <res-ref-name>jdbc/test</res-ref-name>
    <res-type>javax.sql.DataSource</res-type>
    <res-auth>Container</res-auth>
    </resource-ref>
    </web-app>
    Next, add a file jboss-web.xml under WEB-INF/ folder of the web-application. This file should contain entry as:
    <jboss-web>
    <resource-ref>
    <description>DB Connection</description>
    <res-ref-name>jdbc/test</res-ref-name>
    <res-type>javax.sql.DataSource</res-type>
    <jndi-name>java:/jdbc/test</jndi-name>
    <res-auth>Container</res-auth>
    </resource-ref>
    </jboss-web>
    Next, in JBOSS_HOME/server/default/deploy folder make a xx-ds.xml file or else, a similiar file can be found in that same folder with the name hsqldb-ds.xml. Make following entries in that xml file:
    <datasources>
    <local-tx-datasource>
    <jndi-name>/jdbc/test</jndi-name>
    <type-mapping>MySQL</type-mapping>
    <connection-url>jdbc:mysql://localhost:3306/shopping_cart</connection-url>
    <driver-class>com.mysql.jdbc.Driver</driver-class>
    <user-name>root</user-name>
    <password>root123</password>
    <min-pool-size>1</min-pool-size>
    <max-pool-size>5</max-pool-size>
    </local-tx-datasource>
    This should bind the jndi name.
    In our client application, we need to look up as:
    Context ctx = new InitialContext();
    DataSource ds = (DataSource)ctx.lookup("java:/jdbc/test");
    Connection conn = ds.getConnection();
    This works perfectly.

  • Tomcat vs jboss

    Hello,
    Could any one tell me what are the advantages of using jboss instead of tomcat as my application server.
    I am not interested in the ejb part at all, but from my understanding jboss can bring a lot of advantages when creating web apps such as jaas and other modules ..
    Another question is what are the advantages of using tomcat instead of jboss for JSP/SERVLET web apps ..
    Thanks.

    Your server admin has no clue what he is talking about, he is probably used to PHP nonsense. A servlet will run when it is mapped in your web.xml file like it is described here:
    http://e-docs.bea.com/wls/docs70/webapp/components.html#120130
    (it is the same for all webservers).

  • What is net step for tomcat? jboss

    Hi all,
    I have almost two years experience in tomcat, I want to continue developer my skills on j2ee, hope that is not a stupid Ideal.
    recently, I try WebLogic by myself . but I am not sure Weblogic is free or not ? some said the licence is one year, I am new in java developer, my next hire, problem still not a big company, for the cost reason, may still need to chose a free software, is jboss is the next step I should try?
    right now my server have tomcat + MS sql , can I install jboss in the same server(Windows 2003) without any bad effect on Tomcat? before master jboss, I still need let tomcat work smoontly.
    by the way j2ee also a server. which one is best? j2ee server or Jboss?
    Thank you

    hi,
    Weblogic is not free. But, Jboss is avail for free download. You can download it and install in your system and that wont affect your tomcat in anyway. (unless you run the both simultaneously !! )
    j2ee server or jboss?
    I assume you mean 'Sun application server' by the term 'j2ee server'. But, jboss is very popular, so you can go for it.
    Also, recently JbossIDE became very popular, as it provides rich user interface for j2ee application development using jboss.
    Good luck! :)

  • How to retrive ip address of connected device in shell script or applescript

    Hi all,
    From Mac PC, how to get ip address of connected device in shell script or applescript.
    there is any way to launch an app on ipad in shell script or applescript.
    thank you in advance for your help
    Mickael

    Hi all,
    From Mac PC, how to get ip address of connected device in shell script or applescript.
    there is any way to launch an app on ipad in shell script or applescript.
    thank you in advance for your help
    Mickael

  • Unable to retrive the address in MEAN

    Hi,
    we have maintained delivery addresses in mean. when i am trying to pull the address via mean transaction code system is showing "No records Found" but the address is exist in the system in adrcTable.
    I have a entry in adrc table with address number 2000000 having validity till 2099 with address group ME02.
    But when i am trying to display it in mean transaction it is not picking the address from adrc .
    Please suggest is there any way i can pull that address and modify it?
    Thanks in advance

    adress group ME02 is a manually changed delivery address in PO item EKPO-ADRNR
    so this is not master data that can be found in MEAN transaction, it is trasactional data for just one single purchase order.

  • JMX Problem - Retriving Physical Address (MAC)

    Hello Everybody,
    I am working in a class that has to poll information from a router using SNMP protocol and I am using JMX's API
    specification, for all the scalars and values that have a string representation works well, but when I am polling
    the information from the MAC address - which is represented in Hexadecimal format I retrieve a Variable Binding
    with IOD and Value, where the value is complete wired, I do not know why I can not represent the value since the
    method I am trying to use cast it to String, I really tried different appoaches and also other clases like Vector
    or List for solve the problem but seems that the value has not been interpreted in the correct way, and that's why
    I would like to hear if someboday has been experienced the same situation and what suggestions you can offer to me
    for solve the problem.
    Thanks,
    Al
    //Code definitions for variables and declarations
    final SnmpVarBindList Iteratorlist = new SnmpVarBindList("SyncManager varbind list");
    for (int j=1; j<=i; j++)
    Iteratorlist.addVarBind("1.3.6.1.2.1.2.2.1.6." + j);
    SnmpRequest requestIterator = session1.snmpGetRequest(null, Iteratorlist);
    //... Code for validate complete request and errors, etc.
    final SnmpVarBindList resultIterator = requestIterator.getResponseVarBindList();
    for (int j=0; j<resultIterator.getVarBindCount(); j++)
    SnmpVarBind bind2 = resultIterator.getVarBindAt(j);
    println(">>Val " + bind2.getStringValue());
    println(">>ValStr " + bind2.getStringValue().toString());
    println(">>Length " + bind2.getStringValue().length());
    // ... code for other manipulations

    Just to be sure ....you know bytes are NOT characters in java?
    From your posting it is not clear if you are having a problem converting a binary value to a string value, or if you are having trouble getting to the value at all.
    Keep in mind that the "SNMP protocol" in of itself is almost worthless in describing the format of the data that you will get back. A MIB of course is much more useful.
    Normally I would expect an octet string for a MAC address.

  • Jboss/tomcat mapping configuration error

    I can't even get the combination to serve a .jsp file or .html file. Regardless of the URL that I attempt, I only get a No Context configured to process this request error from tomcat and INFO [Engine] StandardHost[localhost]: MAPPING configuration error for request URI from JBoss. I've tried to access all of the various webapps under the catalina directory and can't get to any of them. I know that catalina is started because the log file shows
    <Service name="JBoss-Tomcat">
    <Engine name="MainEngine" defaultHost="localhost">
    <Logger className="org.jboss.web.catalina.Log4jLogger" verbosityLevel="trace" category="org.jboss.web.localhost.Engine" />
    <Host name="localhost">
    <Valve className="org.apache.catalina.valves.AccessLogValve" prefix="localhost_access" suffix=".log" pattern="common" directory="../server/default/log" />
    <DefaultContext cookies="true" crossContext="true" override="true" />
    </Host>
    </Engine>
    <!-- A HTTP Connector on port 8080 -->
    <Connector className="org.apache.catalina.connector.http.HttpConnector" port="8080" minProcessors="3" maxProcessors="10" enableLookups="true" acceptCount="10" debug="0" connectionTimeout="60000" />
    </Service>
    </Server> in jboss.web:service=EmbeddedCatalinaSX
    2002-06-12 23:29:44,760 INFO [org.jboss.web.catalina.EmbeddedCatalinaServiceSX] Creating
    2002-06-12 23:29:44,760 INFO [org.jboss.web.catalina.EmbeddedCatalinaServiceSX] Created
    2002-06-12 23:29:44,760 DEBUG [org.jboss.deployment.MainDeployer] Done with create step of deploying tomcat4-service.xml
    2002-06-12 23:29:44,760 DEBUG [org.jboss.deployment.MainDeployer] start step for deployment file:/D:/JBoss3.0/jboss-3.0.0_tomcat-4.0.3/server/default/deploy/tomcat4-service.xml
    2002-06-12 23:29:44,760 DEBUG [org.jboss.deployment.SARDeployer] Deploying SAR, start step: url file:/D:/JBoss3.0/jboss-3.0.0_tomcat-4.0.3/server/default/deploy/tomcat4-service.xml
    2002-06-12 23:29:44,760 INFO [org.jboss.web.catalina.EmbeddedCatalinaServiceSX] Starting
    2002-06-12 23:29:44,760 INFO [org.jboss.deployment.MainDeployer] Adding deployer: org.jboss.web.catalina.EmbeddedCatalinaServiceSX@7dadcd
    2002-06-12 23:29:44,760 DEBUG [org.jboss.web.catalina.EmbeddedCatalinaServiceSX] Setting catalina debug level to: 0
    2002-06-12 23:29:44,760 DEBUG [org.jboss.web.catalina.EmbeddedCatalinaServiceSX] Setting catalina.home to: ../catalina
    2002-06-12 23:29:44,760 DEBUG [org.jboss.web.catalina.EmbeddedCatalinaServiceSX] Setting catalina.base to: ../catalina
    with no errors. I'm confused because I was able to consistently work with previous versions of JBoss with no problem. The configuration seems to have changed radically, is this some recent change that I just can't find a reference to? Thanks for any help.

    Hi
    For Tomcat 3.x you need to use one of the following options:
    (Note: this is with JBoss/Tomcat OR JBoss/Jetty)
    Place you .war files in the following location:
    C:\jboss-3.0.3\server\default\deploy and the app is automatically available.
    If my app's name is DavidOnline.war, when deployed, I can access it at
    http://localhost:8080/DavidOnline..
    OR
    Copy your entire development directory to the deploy direction above, RENAME your
    directory from say C:\JspApps to C:\JspApps.war and you can work from that location and see your changes immeadiatly.
    There is a file called jboss-service.xml that has some config options, also for the Tomcat bundle there is a file named tomcat-service.xml that has the standard server.xml section.. I suggest you check out the JBoss website, free docs and forums.. http://www.jboss.org.
    Thanks, Hope this helps.

  • Tomcat&JBoss VS ORACLE10g AS(urgent.....)

    Hi everybody,
    am having an application which was running in the TOMCAT and JBOSS environment but now i have migrated it with ORACLE 10g Application server but here my problem is its not running smoothly but it was working properly in Tomcat+JBoss
    if more Number of users increases then (Active Sessions and Active Requests) the Application server has to restart once in peak time its the case when am in JBoss Tomcat Env. but Now am with ORACLE 10g so now i have to restart the instance 7 or 10 times to move my application correclty otherwise its not running its hanged
    So if anyyone knows how to configure ORACLE10g correctly then plz help me..
    Its very URGENT
    Thanks in Advance ;-)
    Jagan.M

    hi everyone,
    i'm new to Java web development and would like to
    seek for some of your experience...
    before i had use Tomcat along to develop my
    JSP/Servlet...a few years later now...i am about to
    get into a new project...and i heard about JBoss...
    my questions are:
    - is JBoss good? Good for what?
    You realize, of course, that JBoss and Tomcat are two different animals. JBoss is a Java EE app server, and Tomcat is a servlet/JSP engine. JBoss has a servlet/JSP engine, just like all Java EE app servers do. It's likely to USE Tomcat.
    The biggest thing that JBoss gives you in addition to servlets and JSPs is EJBs. Do you know what those are? Is that why you're interested in JBoss?
    What are you planning to do with EJBs?
    How easy is it to setup as compared to Tomcat standalone?It's harder, because there are potentially more moving pieces.
    - is JBoss integrating Apache and Tomcat such that i
    can directly use Apache as the web server without
    much extra setup?You don't need an Apache web server to use Tomcat or JBoss. Both have HTTP servers built in.
    - if i am getting my website hosted by some hosting
    company...do i need to know whether they support
    JBoss before i start my development?If you plan on using JBoss, I'd say yes.
    %

  • Delay in AJP Connector jBoss/TomCat Solaris 10

    I have:
    - IIS 6, Windows 2003 Server on dual PIII with jk 1.2.15 installed and working
    - Solaris 10 on Sun E420R with Quad Processors with jBoss / Tomcat version 4.0.3SP1
    There is a significant delay in page loading that occurs randomly (every 10-20 clicks) which lasts for 10-18 or so seconds.
    I've traced it to the read method in ChannelSocket.java. The delay always occurs while receive() is reading the header portion of the message. The length of the header that the read is trying to read is 4 bytes. The call to BufferedInputStream will block until it gets these 4 bytes of the header (10-18 seconds). I've modified the code and put a call in to available() before and after the read. The before returns 0 and the after returns 1138 or so.
    I've tried every imaginable combination of configs on the IIS side to get around the problem ... and then some kernel TCP/IP configs on the Solaris side ... too many to list here.
    The problem seems to be isolated to Solaris ... because Linux, XP, Windows 2003 server all work without this problem.
    My question is this ... is there any thing that I can configure to have this read return faster? Changes to the Solaris kernel ... some config parameter ... ?? Anyone experience this before?
    I'll gladly list the things I've tried to get some idea of how to solve this.
    I think ultimately this is my problem: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4479751
    Thanks in advance!

    Hi
    For Tomcat 3.x you need to use one of the following options:
    (Note: this is with JBoss/Tomcat OR JBoss/Jetty)
    Place you .war files in the following location:
    C:\jboss-3.0.3\server\default\deploy and the app is automatically available.
    If my app's name is DavidOnline.war, when deployed, I can access it at
    http://localhost:8080/DavidOnline..
    OR
    Copy your entire development directory to the deploy direction above, RENAME your
    directory from say C:\JspApps to C:\JspApps.war and you can work from that location and see your changes immeadiatly.
    There is a file called jboss-service.xml that has some config options, also for the Tomcat bundle there is a file named tomcat-service.xml that has the standard server.xml section.. I suggest you check out the JBoss website, free docs and forums.. http://www.jboss.org.
    Thanks, Hope this helps.

Maybe you are looking for

  • Scale based pricing for multiple Sales Orders

    Hi All, I have tried to search the forum but somehow wasn't able to get the proper answer of my query. So putting up my below requirement. The price say PR00 of material M1 will be in scale basis like : 1st 20 items it would be 1000 USD 21 to 50 item

  • HP Pavilion starts up in hibernate/sleep mode and remains there - there is nothing on the monitor

    I have an HP Pavilion Elite HPE-250f (Core i7) desktop computer. I was using the internet. Suddenly, the computer made some sound, and the screen went blank. The computer seemed to go into its usual hibernate/sleep mode. Usually, when the computer go

  • Where do the current iMac G5 iSights come from?

    Anyone buy an iMac G5 online from the Apple store in the month of December? Where did yours ship from (origination)? ie: Shanghai, Elk Grove, Kentucky If you ordered the wired keyboard instead of Bluetooth keyboard model G5 iSight, what is the suffix

  • "Adobe AIR 15 Beta Sept 18, 2014" doesn't support iphone6 launch images

    I entered [email protected] for iphone 6 , [email protected] for iphone 6+ I see firstly launch time and immediately thereafter (mean AIR load time)  launch image is disappear (black screen, mean AIR doesn't see). Secondly, Air is working only "ios 7

  • Equipment no in MIGO

    MY client wants when they do migo of any machine spares they want to see the equipment no how can i do that i found in material field there is equipment but i could not slove the issue