Will two httpclusterservlet in same web app (web.xml) work

I want to load balance multple web services (running on different weblogic managed servers) using  multiple instance of httpclusterservlet.
I did experiment with defining two instances of httpclusterservlet but only the last one worked.
I want to work this with root context (/)

I want to load balance multple web services (running on different weblogic managed servers) using  multiple instance of httpclusterservlet.
I did experiment with defining two instances of httpclusterservlet but only the last one worked.
I want to work this with root context (/)

Similar Messages

  • How to set two different welcome-file to different servlets in web.xml

    Hi friends,
    Can some one help with web.xml file
    I have to different servlets in applications.
    I want to set two different welcome files for my two different
    servlets in web.xml
    Please, can some one give me sample code to achieve this.
    Here web.xml code:
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <!DOCTYPE web-app PUBLIC
    "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
    "http://java.sun.com/dtd/web-app_2_3.dtd">
    <web-app>     
         <servlet>
              <servlet-name>reports</servlet-name>
              <servlet-class>com.caremark.ivr.servlet.IvrReportsServlet</servlet-class>
         </servlet>
         <servlet-mapping>
              <servlet-name>reports</servlet-name>
              <url-pattern>/reports</url-pattern>
         </servlet-mapping>
         <session-config>
              <session-timeout>30</session-timeout>
         </session-config>
         <welcome-file-list>
              <welcome-file>reportsindex.jsp</welcome-file>
         </welcome-file-list>
         <servlet>
              <servlet-name>calldetails</servlet-name>
              <servlet-class>com.caremark.ivr.servlet.IvrCallDetailsServlet</servlet-class>
         </servlet>
         <servlet-mapping>
              <servlet-name>calldetails</servlet-name>
              <url-pattern>/calldetails</url-pattern>
         </servlet-mapping>
    <welcome-file-list>
              <welcome-file>calldetailsindex.jsp</welcome-file>
         </welcome-file-list>
    </web-app>
    I need this fix immediately. Your help will be really appreciated. Thanks in advance.

    First of all, my understanding is that you need to have a Servlet 2.4 complaint server to do this...Given that, you're supposed to be able to simply specify the Name of the servlet as the welcome-file to get it to work. For example:
    Your servlet section:
    <servlet>
      <servlet-name>Controller</servlet-name>
      <servlet-class>com.company.ControllerServlet</servlet-class>
    </servlet>Now you would add the following to your welcome file list:
    <welcome-file-list>
      <welcome-file>Controller</welcome-file>
    </welcome-file-list>Note that you use the servlet-name value from the servlet definition, NOT the url-mapping from the servlet-mapping section.
    Please note that I cannot verify this as I am running a 2.3 server at home. When I get to work Friday I can test on a 2.4 machine. However this shouldn't take you more than a minute to test.
    Note that I did try this on the 2.3 compliant server and it did NOT work (as I expected)...
    HTH.

  • Web.xml  configured correctly(I think),  but still getting '404...resource

    not found error' from tomcat. Here is my web.xml:
    <servlet>
    <servlet-name>HelloServlet</servlet-name>
    <servlet-class>HelloServlet</servlet-class>
    </servlet>
    <servlet>
    <servlet-name>HelloServlet2</servlet-name>
    <servlet-class>coreservlets.HelloServlet2</servlet-class>
    </servlet>
    <servlet-mapping>
    <servlet-name>HelloServlet</servlet-name>
    <url-pattern>/classes/HelloServlet</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
    <servlet-name>HelloServlet2</servlet-name>
    <url-pattern>/classes/coreservlets.HelloServlet2</url-pattern>
    </servlet-mapping>
    </web-app>
    when I went to the following urls after I had edited web.xml to the above,
    http://localhost:8080/cucoweb/classes/coreservlets.HelloServlet2
    http://localhost:8080/cucoweb/classes/HelloServlet
    I go the expected results, ie, 'Hello(2)' and 'Hello'. Then I shutdown tomcat and restarted it.
    And when i tried to access those 2 urls again, I got the above error.
    (Actually I had the same web.xml before except that it didnt have the /classes in front in the
    url-pattern. I was able to access it by the same url - without the /classes - and then the next day
    when started tomcat and tried to access it, it didnt work, same error.)
    In this example, cucoweb is the context root, correct ? Shouldn't the url-pattern be relative to the
    context root ? Thats how I have it now, I think.
    Would adding my webapp directory, ie cucoweb/classes, to my CLASSPATH help ?
    I'm in ubuntu, when I do echo $CLASSPATH, I get :
    .:/usr/lib/jvm/java-6-sun-1.6.0.00/lib:/usr/lib/jvm/java-6-sun-1.6.0.00/imq/lib/:/usr/lib/jvm/java-6-sun-1.6.0.00/jre/lib
    I havent tried this yet because doing this is kind of tricky in ubuntu. (You have etc/environment and
    bash.bashrc, for ex.) But if I try that and it works I will post about it. I suspect its something else,
    though, because it worked once, before restarting tomcat, thats why I'm posting here first.
    Any info, even educated guesses, would be greatly appreciated. Thanks in advance.

    Thanks for the reply. Here is my web structure :
    /usr/local/tomcat/apache-tomcat-6.0.14/webapps/cucoweb/WEB-INF/classes
    From my understanding you are supposed to have your own webapp deployment directory
    under webapps, ie, cucoweb, and not use webapps/ROOT. (I'm not sure what /ROOT is even for)
    My web.xml is in WEB-INF. My /classes directory contains HelloServlet.class and a directory
    called coreservlets which contains HelloServlet2.class.
    I'm not sure what you mean by 'better you to delete under tomcat/work/catalina/localhost folder'.
    Can you please clarify ?
    FYI, my work/catalina/localhost contains the following :
    cucoweb docs examples host-manager manager
    Here cucoweb just contains a SESSIONS.ser file. Are you saying i should delete that ?

  • Can a web.xml include another web.xml ?

    The application i am working at has alot of servlets and i was wondering if i can put some order in my web-app by separating my web.xml in different smaller web.xml's ?

    I can sympathize with you as far as the readability goes.
    I know that Tomcat 4 provides a GUI that's intended to make editing server and container level XML files a lot easier, but I'm not certain if it handles application level XMLs too. I think it's safe to say that version 5 will probably either support modifying web.xml files through the GUI or someone will make that feature available through an add-on module.
    In the meantime, the length of the XML doesn't affect Tomcat. I would just put up with it until the tool comes along.

  • Error deploying when web.xml contains similiar security-constraint elements

    I am receiving an error when I include similiar security constraints in my web.xml descriptor.  I actually have many security-constraint elements defined but I have narrowed it down to the following two that appear kind of similiar which are causing the problem:
    <security-constraint>
    <web-resource-collection>
         <web-resource-name>ProcessesPosts</web-resource-name>
         <url-pattern>/processPost/*</url-pattern>
    </web-resource-collection>
    </security-constraint>
    <security-constraint>
    <web-resource-collection>
         <web-resource-name>Processes</web-resource-name>
         <url-pattern>/process/*</url-pattern>
    </web-resource-collection>
    </security-constraint>
    The error I receive is:
    #1#com.sap.engine.services.deploy.exceptions.ServerDeploymentException: Exception during generating components of sap.com/s25qoie_1_SAP application in servlet_jsp container.
         at com.sap.engine.services.deploy.server.application.DeploymentTransaction.makeComponents(DeploymentTransaction.java:512)
         at com.sap.engine.services.deploy.server.application.DeployUtilTransaction.commonBegin(DeployUtilTransaction.java:248)
         at com.sap.engine.services.deploy.server.application.DeploymentTransaction.begin(DeploymentTransaction.java:215)
         at com.sap.engine.services.deploy.server.application.ApplicationTransaction.makeAllPhasesOnOneServer(ApplicationTransaction.java:371)
         at com.sap.engine.services.deploy.server.application.ApplicationTransaction.makeAllPhases(ApplicationTransaction.java:405)
         at com.sap.engine.services.deploy.server.DeployServiceImpl.makeGlobalTransaction(DeployServiceImpl.java:2298)
         at com.sap.engine.services.deploy.server.DeployServiceImpl.deploy(DeployServiceImpl.java:286)
         at com.sap.engine.services.deploy.server.DeployServiceImplp4_Skel.dispatch(DeployServiceImplp4_Skel.java:2636)
         at com.sap.engine.services.rmi_p4.P4Message.process(P4Message.java:253)
         at com.sap.engine.services.rmi_p4.P4Message.execute(P4Message.java:109)
         at com.sap.engine.services.cross.fca.FCAConnectorImpl.executeRequest(FCAConnectorImpl.java:841)
         at com.sap.engine.services.rmi_p4.P4Message.process(P4Message.java:125)
         at com.sap.engine.services.cross.fca.MessageReader.run(MessageReader.java:59)
         at com.sap.engine.core.thread.execution.Executable.run(Executable.java:108)
         at com.sap.engine.core.thread.execution.CentralExecutor$SingleThread.run(CentralExecutor.java:168)
    Caused by: java.lang.IllegalArgumentException: Invalid prefix pattern in URLPatternList
         at javax.security.jacc.URLPatternSpec.setURLPatternArray(URLPatternSpec.java:329)
         at javax.security.jacc.URLPatternSpec.<init>(URLPatternSpec.java:106)
         at javax.security.jacc.WebResourcePermission.<init>(WebResourcePermission.java:188)
         at com.sap.engine.services.servlets_jsp.server.deploy.util.jacc.JACCRulesGenerator.generatePermissionsUnchecked(JACCRulesGenerator.java:311)
         at com.sap.engine.services.servlets_jsp.server.deploy.util.jacc.JACCRulesGenerator.generateAndAddPermissionsIntoPolicyConfiguration(JACCRulesGenerator.java:132)
         at com.sap.engine.services.servlets_jsp.server.deploy.util.jacc.SecurityConstraintParser.processAllSecurityConstraints(SecurityConstraintParser.java:151)
         at com.sap.engine.services.servlets_jsp.server.deploy.util.jacc.SecurityConstraintParser.createSecurityResourcesJACC(SecurityConstraintParser.java:57)
         at com.sap.engine.services.servlets_jsp.server.deploy.util.SecurityUtils.createSecurityResources(SecurityUtils.java:122)
         at com.sap.engine.services.servlets_jsp.server.deploy.DeployAction.initXmls(DeployAction.java:722)
         at com.sap.engine.services.servlets_jsp.server.deploy.DeployAction.deploy(DeployAction.java:276)
         at com.sap.engine.services.servlets_jsp.server.deploy.WebContainer.deploy(WebContainer.java:181)
         at com.sap.engine.services.deploy.server.application.DeploymentTransaction.makeComponents(DeploymentTransaction.java:506)
         ... 14 more
    Has anyone seen anything like this?  Have I defined something wrong in my web.xml?  The exact same web.xml file does work in several other application servers.

    Hi Jay,
    I am not aware of such document for the preview release.
    About the concrete problem your investigation was enough detailed so we managed to reproduce and fix it.
    Thanks and regards

  • 2 web.xml

    can a single appication have 2 web.xml ?
    means first servlet will get entry into one web.xml and second servlet will get entry into another servlet...is that possible ?

    Hello,
    I don't think its possible to have two web.xml file for a single web application, but what you can have is another config.xml file. This becomes equivalent to having STRUTS ................
    Regards
    Gigi Mathew

  • Security in my web.xml in Tomcat 4

    Hello,
    I was using this application on Tomcat 3 and my web.xml worked perfectly well.
    However when I tried to start it on Tomcat 4 there is something wrong with the
    security part of my web.xml . If I leave out the security constraint for this application, it
    works. However if I make my application secure I am unable to view it in the browser.
    It does not try to connect to the login.jsp page for log in , but simply displays the message that the page is unavailable and that I have to refresh my browser. Please help me with that because I am stuck.
    Here is my web.xml :
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <!DOCTYPE web-app
    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
    "http://java.sun.com/dtd/web-app_2_3.dtd">
    <web-app>
    <servlet>
    <servlet-name>UploadServlet</servlet-name>
    <servlet-class>UploadServlet</servlet-class>
    <init-param>
    <param-name>SaveDirectory</param-name>
    <param-value>C:\Homeworks\</param-value>
    </init-param>
    <init-param>
    <param-name>Proffesors</param-name>
    <param-value>Clayton,Douglass,Guruvado</param-value>
    </init-param>
    </servlet>
    <security-constraint>
    <display-name>Protected Homework Upload</display-name>
    <web-resource-collection>
    <web-resource-name>Protected Area</web-resource-name>
         <!-- Define the context-relative URL(s) to be protected -->
    <!--<url-pattern>/servlet/Upload</url-pattern>-->
         <url-pattern>/servlet/UploadServlet</url-pattern>
         <!-- If you list http methods, only those methods are protected -->
         <http-method>DELETE</http-method>
    <http-method>GET</http-method>
    <http-method>POST</http-method>
         <http-method>PUT</http-method>
    </web-resource-collection>
    <auth-constraint>
    <!-- Anyone with one of the listed roles may access this area -->
    <role-name>student</role-name>
    <role-name>proffesor</role-name>
    </auth-constraint>
    </security-constraint>
    <login-config>
    <auth-method>FORM</auth-method>
    <realm-name>Example Form-Based Authentication Area</realm-name>
    <form-login-config>
    <form-login-page>/login.jsp</form-login-page>
    <form-error-page>/error.jsp</form-error-page>
    </form-login-config>
    </login-config>
    </web-app>
    Thank you very much for your time and advise. I appreciate it very much
    Martin

    hi,slice
    I donot really find exactly what is wrong in your config file. But I have some suggestions:
    1.Please use servlet URL mapping in "servlet" tag (for example: "/security/upload") instead of using default servlet URL(just like "/servlet/UploadServlet").
    2. In the "url-pattern" tag inside "web-resource-name" ,please using "/security/*", if you are using my suggestion above.
    3.Make sure that your "login.jsp" page is in the right place of the application's doc-root.
    Make a try and good luck!
    Wang Yu
    Developer Technical Support
    Sun Microsystems
    http://sun.com/developers/support

  • Bug when specifying url-pattern in web.xml

    Hi
              I have been using Weblogic 6.0 Beta and managed to specify the following
              security constraint
              <security-constraint>
              <web-resource-collection>
              <web-resource-name>SecurePages</web-resource-name>
              <description>no description</description>
              <url-pattern>/control/signin</url-pattern>
              <url-pattern>/control/refreshUser</url-pattern>
              <url-pattern>/control/updateUser</url-pattern>
              <url-pattern>/control/deleteaddress</url-pattern>
              <url-pattern>/control/updateaddress</url-pattern>
              <url-pattern>/control/refreshcontacts</url-pattern>
              <url-pattern>/control/updatecard</url-pattern>
              <http-method>POST</http-method>
              <http-method>GET</http-method>
              </web-resource-collection>
              </security-constraint>
              This works fine as you would expect. I have upgraded to Weblogic 6.0 Service
              Pack 1 Rolling Patch 1 and the same web.xml file no longer works. When you
              try and start the server Weblogic hangs just after loading the Oracle driver
              that I use.
              The odd behaviour is that if I change the order of the url-pattern elements
              so that the updatecard URL is above the refreshUser URL the server starts!
              (shown below)
              <url-pattern>/control/signin</url-pattern>
              <url-pattern>/control/updatecard</url-pattern>
              <url-pattern>/control/refreshUser</url-pattern>
              <url-pattern>/control/updateUser</url-pattern>
              <url-pattern>/control/deleteaddress</url-pattern>
              <url-pattern>/control/updateaddress</url-pattern>
              <url-pattern>/control/refreshcontacts</url-pattern>
              A deadlock condition appears to occur, a section of the thread dump looks
              like:
              "Reference Handler" daemon prio=10 tid=0x8990b20 nid=0x7dc waiting on
              monitor [0
              x8c0f000..0x8c0fdc4]
              at java.lang.Object.wait(Native Method)
              at java.lang.Object.wait(Object.java:420)
              at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110)
              "main" prio=5 tid=0x234ce0 nid=0x6cc runnable [0x6e000..0x6fc3c]
              at weblogic.servlet.utils.URLMatchMap.put(URLMatchMap.java:156)
              at
              weblogic.servlet.security.internal.WebAppSecurity.setConstraints(WebA
              ppSecurity.java:77)
              Looking at the weblogic.jar file the URLMatchMap class is a new addition
              over the original Weblogic 6.0. It seems that the put method of the
              URLMatchMap may be going into an infinite loop, dependant on the URLs that
              are being entered. The fact that changing the order of the URLs overcomes
              the bug seems to suggest there may be some coding error in this new class.
              A fix would be great if anyone has one.
              Chris Mein
              

              Just wondering if anyone ever came up with the solution to the bug with WL 6.0
              sp1, mentioned by Chris, below. Any information on this would be greatly appreciated.
              Tony
              "Chris Mein" <[email protected]> wrote:
              >Hi
              >
              >I have been using Weblogic 6.0 Beta and managed to specify the following
              >security constraint
              >
              ><security-constraint>
              > <web-resource-collection>
              > <web-resource-name>SecurePages</web-resource-name>
              > <description>no description</description>
              > <url-pattern>/control/signin</url-pattern>
              > <url-pattern>/control/refreshUser</url-pattern>
              > <url-pattern>/control/updateUser</url-pattern>
              > <url-pattern>/control/deleteaddress</url-pattern>
              > <url-pattern>/control/updateaddress</url-pattern>
              > <url-pattern>/control/refreshcontacts</url-pattern>
              > <url-pattern>/control/updatecard</url-pattern>
              > <http-method>POST</http-method>
              > <http-method>GET</http-method>
              > </web-resource-collection>
              > </security-constraint>
              >
              >This works fine as you would expect. I have upgraded to Weblogic 6.0
              >Service
              >Pack 1 Rolling Patch 1 and the same web.xml file no longer works. When
              >you
              >try and start the server Weblogic hangs just after loading the Oracle
              >driver
              >that I use.
              >
              >The odd behaviour is that if I change the order of the url-pattern elements
              >so that the updatecard URL is above the refreshUser URL the server starts!
              >(shown below)
              >
              ><url-pattern>/control/signin</url-pattern>
              ><url-pattern>/control/updatecard</url-pattern>
              ><url-pattern>/control/refreshUser</url-pattern>
              ><url-pattern>/control/updateUser</url-pattern>
              ><url-pattern>/control/deleteaddress</url-pattern>
              ><url-pattern>/control/updateaddress</url-pattern>
              ><url-pattern>/control/refreshcontacts</url-pattern>
              >
              >A deadlock condition appears to occur, a section of the thread dump looks
              >like:
              >
              >"Reference Handler" daemon prio=10 tid=0x8990b20 nid=0x7dc waiting on
              >monitor [0
              >x8c0f000..0x8c0fdc4]
              > at java.lang.Object.wait(Native Method)
              > at java.lang.Object.wait(Object.java:420)
              > at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110)
              >
              >"main" prio=5 tid=0x234ce0 nid=0x6cc runnable [0x6e000..0x6fc3c]
              > at weblogic.servlet.utils.URLMatchMap.put(URLMatchMap.java:156)
              > at
              >weblogic.servlet.security.internal.WebAppSecurity.setConstraints(WebA
              >ppSecurity.java:77)
              >
              >Looking at the weblogic.jar file the URLMatchMap class is a new addition
              >over the original Weblogic 6.0. It seems that the put method of the
              >URLMatchMap may be going into an infinite loop, dependant on the URLs
              >that
              >are being entered. The fact that changing the order of the URLs overcomes
              >the bug seems to suggest there may be some coding error in this new class.
              >
              >A fix would be great if anyone has one.
              >
              >Chris Mein
              >
              >
              

  • Modifying web.xml in Weblogic

    Hi, I'm deploying an application written in JDeveloper 11.1.1.2.0 to Weblogic 10.3.2.
    I'm trying to edit the web.xml file of the application. I tried to edit it here:
    c:\Oracle\Middleware\user_projects\domains\uat_domain\servers\AdminServer\tmp\_WL_user\DrawingManagement\2ubcsw\war\WEB-INF\web.xml
    However, any changes are not reflected in the application even though I have restarted Weblogic. However, when I change the values in JDeveloper and then deploy to Weblogic, the values are reflected in the web.xml defined above.
    Is Weblogic caching this web.xml? If so, how do I modify it?
    Edited by: Sean Ong on Aug 8, 2010 9:11 PM

    Hi,
    If you will try to edit the "web.xml" from the following Location: c:\Oracle\Middleware\user_projects\domains\uat_domain\servers\AdminServer\tmp\_WL_user\DrawingManagement\2ubcsw\war\WEB-INF\web.xml
    Then it will not be reflected. Because as soon as you deploy your Application on WebLogic it Reads the "web.xml" *(At Deploy time Once)* and keeps it in Memory. So if you really want to change the Deployment descriptor then You will need to redeploy the Application after editing it inside your JDeveloper project it self.
    Or as an alternative you can use the "plan.xml" feature of weblogic to change the DDs...like: http://forums.oracle.com/forums/thread.jspa?threadID=1107834&tstart=0
    Thanks
    Jay SenSharma
    http://weblogic-wonders.com/weblogic (WebLogic Wonders Are Here)

  • How to avoid inserting CheckSessionFilter in to the web.xml file?

    Mobile Server modifies the web.xml during adding a .war-file to the publication. A new entry- CheckSessionFilter will be inserted inside the web.xml after uploading to the mobile server:
    ****************** inserted part **********************
    <filter>
    <filter-name>CheckSessionFilter</filter-name>
    <filter-class>oracle.lite.web.CheckSessionFilter</filter-class>
    </filter>
    <filter-mapping>
    <filter-name>CheckSessionFilter</filter-name>
    <url-pattern>/*</url-pattern>
    </filter-mapping>
    ****************** inserted part **********************
    Our application has own security-concept and don’t need this additional session checking.
    How can we avoid including of CheckSessionFilter in to our web.xml?

    Don't do "add a war option" Instead, package your application using packaging wizard omitting the filter. Or, you can edit the WEB-INF/web.xml file on the mobile server after you deploy it.
    Make you update the APPLICATIONS table
    UPDATE APPLICATIONS
    SET PUBLISH_TIME = SYSDATE
    WHERE NAME = 'you application';
    You application will be uploaded to:
    STANDALONE
    ORACLE_HOME/mobile_oc4j/j2ee/application/mobileserver/applications/yourapplication/WEB-INF/web.xml
    IAS
    ORACLE_HOME/j2ee/application/mobileserver/applications/yourapplication/WEB-INF/web.xml

  • ejb-name into web.xml automatically

    Hello all,
    I follow the OC4J's tutorial in >>Servlet Developer's Guide<< using Jdeveloper 903.
    there is an EJB session bean named HelloBean.
    From UML Diagram, I can get it, and write the HelloServlet.java to invoke session bean.
    now it is Ok. Jdeveloper online help says that EJB reference <ejb-ref> can be written into web.xml file,
    but it doesn't do it. I manually insert <ejb-ref>...</ejb-ref> into web.xml.
    and change <ejb-name> and <ejb-ref-name> in ejb/HelloBean.
    I want to know how to do this automatically by Jdeveloper 903.
    and how to change session bean's <ejb-name> from HelloBean into ejb/HelloBean?
    Thanks.
    Wu JianHua.

    Automatic insertion of ejb-ref in web.xml whenever EJB dependencies are included in WAR deployment profile.
    Select Tools | Preferences
    Select Deployment in the left hand tree
    Select the check box for "Automatically Fill in <ejb-ref> elements in web.xml
    You can hit F1 hel on the above panel to view the help.
    From help system
    Automatically Fill In <ejb-ref> Elements in web.xmlBy default, JDeveloper automatically inserts corresponding elements to the web module deployment descriptor file, web.xml, whenever EJB dependencies are included in the WAR profile. If an EJB dependency is subsequently removed, however, JDeveloper will leave the elements in web.xml instead of removing them. Clear this checkbox to disable automatic insertion of elements in the web.xml file. Clearing this field prevents extraneous <ejb-ref> elements from appearing in the web.xml. However, do this with caution, since you'll have to make sure that the web.xml file is complete and accurate before deployment.
    raghu
    JDev Team

  • Data source needs to be specified in context.xml instead of web.xml - why?

    Hi,
    I'm using a Spring JndiObjectFactoryBean to create my JNDI data source in my code:
    <bean id="jndiDataSource" class="org.springframework.jndi.JndiObjectFactoryBean" lazy-init="true">
              <property name="jndiName" value="java:comp/env/jdbc/DS_OURDB_DB2" />
              <property name="lookupOnStartup" value="false"/>
              <property name="proxyInterface" value="javax.sql.DataSource"/>
         </bean>I have the necessary Resource added to my Tomcat's server.xml:
    <Resource accessToUnderlyingConnectionAllowed="false"
                defaultAutoCommit="true" defaultReadOnly="false"
                driverClassName="com.ibm.db2.jcc.DB2Driver"
                factory="org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory"
                initialSize="0" logAbandoned="false" maxActive="8"
                maxIdle="8" maxOpenPreparedStatements="0" maxWait="-1"
                minEvictableIdleTimeMillis="1800000" minIdle="0"
                name="jdbc/DS_OURDB_DB2" numTestsPerEvictionRun="3"
                password="ourpass" poolPreparedStatements="false"
                removeAbandoned="false" removeAbandonedTimeout="300"
                testOnBorrow="true" testOnReturn="false"
                testWhileIdle="false" timeBetweenEvictionRunsMillis="-1"
                type="javax.sql.DataSource"
                url="jdbc:db2://machine1:60056/DBD1" username="ouruser"
                   validationQuery="SELECT current date FROM sysibm.sysdummy1"/>I then have the resource referenced in my web.xml:
    <resource-ref>
              <res-ref-name>jdbc/DS_OURDB_DB2</res-ref-name>
              <res-type>javax.sql.DataSource</res-type>
              <res-auth>Container</res-auth>
              <res-sharing-scope>Shareable</res-sharing-scope>
         </resource-ref>However, I'm getting JndiLookupFailureExceptions when I attempt to use this JNDI resource.
    I can resolve it by specifying the following in my META-INF/context.xml:
    <Context>
         <ResourceLink global="jdbc/DS_OURDB_DB2" name="jdbc/DS_OURDB_DB2" type="javax.sql.Datasource"/>
    </Context>I've read some of the JNDI/Tomcat documentation. However, I still do not understand why it doesn't work with the web.xml. Can anyone explain please? Thanks

    Can answer this myself after some more investigation. The reason I required the entry in the META-INF/context.xml was because I had specified the Resource as a Global Reference in the server.xml. By adding this Resource to my application's Context in the server.xml the configuration in the web.xml worked as expected.

  • Can two urls map to same servlet in web.xml

    Hello All,
    I need to map the two urls in my web application with the same servlet.
    I tried as follows:
    <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee">
    <description>Empty web.xml file for Web Application</description>
    <servlet>
    <servlet-name>TestServlet</servlet-name>
    <servlet-class>fileredirectsolution.TestServlet</servlet-class>
    </servlet>
    <servlet-mapping>
    <servlet-name>TestServlet</servlet-name>
    <url-pattern>/testservlet</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
    <servlet-name>TestServlet</servlet-name>
    <url-pattern>/filerepository/*</url-pattern>
    </servlet-mapping>
    </web-app>
    However, I am getting an error while accessing the TestServlet.
    When I remove the second servlet-mapping tag..it is working fine.
    How can I map the two urls with the same servlet.
    Thanks
    Saikrishna

    it is not ur requirement. but
    i think it will help 2 u.
    <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"; version="2.4"; xmlns="http://java.sun.com/xml/ns/j2ee">
    <description>Empty web.xml file for Web Application</description>
    <servlet>
    <servlet-name>TestServlet</servlet-name>
    <servlet-class>fileredirectsolution.TestServlet<;/servlet-class>
    </servlet>
    <servlet-mapping>
    <servlet-name>TestServlet</servlet-name>
    <url-pattern>*.xxx</url-pattern>
    </servlet-mapping>
    </web-app>
    if ur configure web.xml like above.
    any request that ends with .xxx call the TestServlet.
    ex:
    1)http://ip:port/contextpath/abc.xxx
    2) http://ip:port/contextpath/xyz.xxx
    here both urls calls the same servlet.
    -lakshman.
    save a life by sending information.
    www.help2patients.wordpress.com.

  • Will Office Web Apps Server 2013 work with SharePoint 2013 sites hosted in SP2010 compatibility mode?

    We are planning a upgrade of a SP2010 farm to 2013. There has been a bit of customization so we wish to run the old sites on the new SP2013 platform in SP2010 compatibility mode.
    So my question is will Office Web Apps Server 2013 work with the old sites hosted in compatibility mode?
    I found a similar query from March 2014 found here 
    http://sharepoint.stackexchange.com/questions/93101/office-web-apps-2010-running-on-sharepoint-2013-for-compatibility-mode-sites/116281#116281 
    Has there been an update released to resolve this
    Cheers D

    Hi  ,
    According to your description, my understanding is that you need to know whether Office Web Apps 2013 is working with SharePoint 2013 sites which is in SharePoint 2010 compatibility mode.
    For my test, Office Web Apps 2013 with SharePoint 2013 sites which is in SharePoint 2010 compatibility mode is working fine.
    Thanks,
    Eric
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Eric Tao
    TechNet Community Support

  • Enabling CLIENT-CERT and FORM authentication in same web-app

    Hi!
    I try to enable same behaviour in WLS 8.1 SP4 as is available in WLS 9.2 (one can define in web.xml to have many <auth-method>s, for example <auth-method>CLIENT-CERT,FORM<auth-method>, which states that first one tries authentication with token (Single Sign On case, for example) and if it is not successful then go to log-in page.
    My steps are as follows in my custom Servlet. We are using IE 6.0 as our web-client. We have configured our auth-method to be FORM, and in the <form-login-page> we have direction to that custom Servlet, which does the handling described below.
    1. If client does not send tokens in request, then set response header:
    response.setHeader("WWW-Authenticate", "Negotiate");
    response.sendError(response.SC_UNAUTHORIZED);
    This works fine and client starts to send his tokens
    2. Now check token, if it is valid, let user in, if not forward him to custom log-in page, for example:
    RequestDispatcher dispatcher = request.getRequestDispatcher("/login/login.html");
    dispatcher.forward(request, response);
    3. Client is forwarded to a log-in page as requested and he gives his credentials. Pushes OK
    log-in page is as defined in edocs:
    <form method="POST" action="j_security_check">
         <table border=1>
              <tr>
                   <td>Username:</td>
                   <td><input type="text" name="j_username"></td>
              </tr>
              <tr>
                   <td>Password:</td>
                   <td><input type="password" name="j_password"></td>
              </tr>
              <tr>
                   <td colspan=2 align=right><input type=submit value="Submit"></td>
              </tr>
         </table>
    </form>
    Now the interesting thing happens (I have investigated TCP traffic at server machine): client (in this case IE) seems to override somehow the credentials (j_password and j_username for HTTP headers, does not send them at all) but keeps on sending this 'Authorize'-field with invalid token instead.
    I have tried a Servlet that does not request WWW-Authenticate at all (in which case client does not start to send 'Authorize'-field). In this case those values are put to HTTP header OK and authentication is able to take place.
    Anyone has any ideas how can I force my clients to send those values from the HTML FORM described above? SHould I set something at response while I do the forward to the custom log-in page. I have tried virtually everything I can imagine (which seems to be not too much :-))...

    Solution found:
    The trick is to return "401" in response if ticket is not valid (do nothing else). This will end the negotiate between client and server
    In your web.xml, forward your 401 code to login page:
    <error-page>
    <error-code>401</error-code>
    <location>/form_login_page.html</location>
    </error-page>
    There might be a more straightforward way to do this (have all the page management within servlet), but I did not have time to investigate it further. This one at least works

Maybe you are looking for

  • How to fix aSun Studio 9 bug running on a Solaris 10 ?

    Hi all I have Sun Studio 9 installed on a Sun Solaris 10 and when I try to run the debug tools I receive this Issue (dbx) cd /users/****/ISMD_V10_integration/MMI/IHM/SCHEMA/bin (dbx) debug /users/***/ISMD_V10_integration/MMI/IHM/SCHEMA/bin/dbtool.Sol

  • Not able to run the SSIS package in SQL Server Agent Job in SQL 2012

    Hi, I scheduled a job (SQL SERVER AGENT) which will call my SSIS package. This package will execute 5 packages in loop. When I execute this job I am getting error as below ============================================================ Started  : 12:30:

  • We cannot load firefox due to settings changed by speedy pc company

    our computer had slowed a lot, and I found a company that promised to fix it. however, in cleaning up our computer they removed some setting that apparently is needed for firefox. we contacted them to get this reset, and they could not do it, for som

  • How to reset buffer pointer for analog output generation?

    I am doing a finite analog output generation on a USB-6216 Sequence of events: DAQmx Create Task DAQmx Timing (finite samples, 1000Hz) Use DAQmx timing property SampQuantamples per channel to set buffer size Write buffer with DAQmx Write Repeat   DAQ

  • Grey screen on startup, erratic mouse: help!

    I have a new iMac 2.8 intel, after encountering many bugs getting logic 8 to run smoothly, I now find it starts just leaving a grey blank screen. I have to restart e few times before it wants to boot fully. I managed to start it with the fireire devi