My web app is getting a data source from JNDI with:
javax.naming.InitialContext ctx = new javax.naming.InitialContext();
javax.sql.DataSource ds = (javax.sql.DataSource)
ctx.lookup("java:comp/env/jdbc/db");
In the app's WEB-INF/web.xml, I have:
<resource-ref>
<description>DataSource</description>
<res-ref-name>jdbc/db</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
In the app's WEB-INF/ibm-web-bnd.xml, I have:
<web-bnd
xmlns="http://websphere.ibm.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://websphere.ibm.com/xml/ns/javaee http://websphere.ibm.com/xml/ns/javaee/ibm-web-bnd_1_0.xsd"
version="1.0">
<virtual-host name="default_host"/>
<resource-ref name="jdbc/db" binding-name="jdbc/db"/>
</web-bnd>
In WebSphere Liberty Profile's server.xml, I have (keeping on the relevant parts):
<server description="new server">
<featureManager>
<feature>jsp-2.2</feature>
<feature>jdbc-4.0</feature>
</featureManager>
<library id="oracle-lib">
<fileset dir="lib" includes="ojdbc5_g.jar"/>
</library>
<dataSource jndiName="jdbc/db" jdbcDriverRef="oracle-driver" type="javax.sql.DataSource">
<jdbcDriver libraryRef="oracle-lib" id="oracle-driver"/>
<connectionManager numConnectionsPerThreadLocal="10" id="ConnectionManager" minPoolSize="1"/>
<properties user="user" password="password"
url="jdbc:oracle:thin:#//db-server:1521/db"/>
</dataSource>
</server>
When the app attempts to get the datasource from JNDI, it fails with the following error:
CWNEN0030E: The #Resource factory encountered a problem getting
the object instance jdbc/oracle binding object. The exception message was:
failed to resolve jdbc/oracle to javax.sql.DataSource:
javax.naming.NameNotFoundException:
Intermediate context does not exist: jdbc/oracle
What I am missing here?
WebSphere server.xml
<server>
<featureManager>
<feature>jndi-1.0</feature>
<feature>jdbc-4.1</feature>
</featureManager>
<httpEndpoint id="defaultHttpEndpoint"
host="localhost"
httpPort="9080"
httpsPort="9443" />
<library id="oracle-lib">
<fileset dir="lib" includes="ojdbc6_g.jar"/>
</library>
<dataSource jndiName="jdbc/oracle">
<jdbcDriver libraryRef="oracle-lib"/>
<properties.oracle user="orbeon" password="password"
url="jdbc:oracle:thin:#//localhost:1521/orbeon"/>
</dataSource>
<application name="orbeon" location="war/orbeon" type="war">
<classloader commonLibraryRef="oracle-lib"/>
</application>
</server>
WEB-INF/ibm-web-bnd.xml
<web-bnd version="1.0"
xmlns="http://websphere.ibm.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://websphere.ibm.com/xml/ns/javaee http://websphere.ibm.com/xml/ns/javaee/ibm-web-bnd_1_0.xsd">
<virtual-host name="default_host"/>
<resource-ref name="jdbc/oracle" binding-name="jdbc/oracle"/>
</web-bnd>
WEB-INF/web.xml
<resource-ref>
<res-ref-name>jdbc/oracle</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
Resource injection (instead of web.xml + ibm-web-bnd.xml):
#Resource(lookup = "jdbc/oracle")
DataSource ds;
we use DB2 on Liberty 8.5.5 and we have in server.xml
<dataSource id="db2" isolationLevel="TRANSACTION_READ_COMMITTED" jndiName="jdbc/db2" type="javax.sql.DataSource">
<jdbcDriver>
<library>
<fileset dir="/usr/lib/java/ibm-db2-universal-driver" includes="db2jcc4.jar, db2jcc_license_cisuz.jar, db2jcc_license_cu.jar"/>
</library>
</jdbcDriver>
<properties.db2.jcc databaseName="DB2T" portNumber="21020" serverName="db2t.lvm.de"/>
<containerAuthData password="{xor}KzspMC04" user="tdvorg"/>
</dataSource>
Maybe helps that.
Robert
In my case, the solution below works fine for me.
I created a "Generic project" in Eclipse called "Resources". Inside this project I created a file dataSource.xml with following content:
<server>
<dataSource id="ccm" jndiName="jdbc/ccm" type="javax.sql.DataSource">
<jdbcDriver id="oracle-driver" libraryRef="oracle-lib"/>
<connectionManager id="ConnectionManager" minPoolSize="1" numConnectionsPerThreadLocal="10"/>
<properties.oracle password="password" url="jdbc:oracle:thin:#128.1.30.150:1521:ccmdes" user="ccm"/>
</dataSource>
<library id="oracle-lib">
<fileset dir="C:\Oracle\product\10.1.0\Client_1\jdbc\lib" includes="ojdbc14_g.jar"/>
</library>
<jdbcDriver id="oracle" libraryRef="oracle-lib"/>
</server>
And I drag and drop this file for server configuration in Eclipse or create the line in server.xml:
<include location="${shared.config.dir}/dataSource.xml"/>
The file server.xml was like this:
<server description="new server">
<!-- Enable features -->
<featureManager>
<feature>jsp-2.3</feature>
<feature>adminCenter-1.0</feature>
<feature>jdbc-4.1</feature>
<feature>jndi-1.0</feature>
<feature>servlet-3.1</feature>
</featureManager>
<httpEndpoint host="localhost" httpPort="9080" httpsPort="9443" id="defaultHttpEndpoint"/>
<applicationMonitor updateTrigger="mbean"/>
<!-- Define your admin user name and password -->
<quickStartSecurity userName="admin" userPassword="password"/>
<!-- Define a keystore for the HTTPS port -->
<keyStore id="defaultKeyStore" password="Liberty"/>
<!-- Allows remote file access for config changes -->
<remoteFileAccess>
<writeDir>${server.config.dir}</writeDir>
</remoteFileAccess>
<!-- <applicationMonitor updateTrigger="mbean"/> -->
<webApplication id="TestPage" location="TestPage.war" name="TestPage"/>
<webApplication id="MonitoriaAtendimento" location="MonitoriaAtendimento.war" name="MonitoriaAtendimento"/>
<include location="${shared.config.dir}/dataSource.xml"/>
</server>
Related
I want to redirect Http to Https. So for that I created a certificate using 'keytool -genkey -alias mydomain -keyalg RSA -keystore keystore.jks -storepass password' this command.
pom.xml
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.0</version>
<configuration>
<warSourceDirectory>${webappDirectory}</warSourceDirectory>
<path>bigdata</path>
<stopPort>9966</stopPort>
<stopKey>foo</stopKey>
<httpsPort>8443</httpsPort>
<keystoreFile>/usr/local/Keystorefiles/keystore.jks</keystoreFile>
<keystorePass>arya123</keystorePass>
<password>arya123</password>
</configuration>
</plugin>
web.xml
<security-constraint>
<web-resource-collection>
<web-resource-name>securedapp</web-resource-name>
<url-pattern>/*</url-pattern>
</web-resource-collection>
<user-data-constraint>
<transport-guarantee>CONFIDENTIAL</transport-guarantee>
</user-data-constraint>
</security-constraint>
Server.xml
<?xml version="1.0" encoding="UTF-8"?>
<Server address="localhost" port="8005" shutdown="SHUTDOWN">
<Listener className="org.apache.catalina.core.JasperListener"/>
<Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener"/>
<Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener"/>
<Listener className="org.apache.catalina.core.ThreadLocalLeakPreventionListener"/>
<GlobalNamingResources>
<Resource auth="Container" description="User database that can be updated and saved" factory="org.apache.catalina.users.MemoryUserDatabaseFactory" name="UserDatabase" pathname="conf/tomcat-users.xml" type="org.apache.catalina.UserDatabase"/>
</GlobalNamingResources>
<Service name="Catalina">
<Connector address="dt" connectionTimeout="20000" port="8080" protocol="HTTP/1.1" redirectPort="8443"/>
<!-- <Connector executor="tomcatThreadPool"
port="8080" protocol="HTTP/1.1"
connectionTimeout="20000" redirectPort="8443" />-->
<Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true"
maxThreads="150" scheme="https" secure="true"
clientAuth="false" sslProtocol="TLS"
keystoreFile="/usr/local/Keystorefiles/keystore.jks"
keystorePass="arya123" />
<Connector port="8009" protocol="AJP/1.3" redirectPort="8443"/>
<Engine defaultHost="dt" name="Catalina">
<Realm className="org.apache.catalina.realm.UserDatabaseRealm" resourceName="UserDatabase"/>
</Realm>
<Host appBase="webapps" autoDeploy="true" name="dt" unpackWARs="true">
<Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs" pattern="%h %l %u %t "%r" %s %b" prefix="localhost_access_log." suffix=".txt"/>
<Context docBase="HelloWeb" path="/HelloWeb" reloadable="true" source="org.eclipse.jst.jee.server:HelloWeb"/><Context docBase="SpringMVCExample" path="/SpringMVCExample" reloadable="true" source="org.eclipse.jst.jee.server:SpringMVCExample"/><Context docBase="TrialApp" path="/TrialApp" reloadable="true" source="org.eclipse.jst.jee.server:TrialApp"/><Context docBase="ABDFver3" path="/bigdata" reloadable="true" source="org.eclipse.jst.jee.server:ABDFver3"/></Host>
</Engine>
</Service>
</Server>
This much I did. But when I gave URL it doesn't redirect to Https. Could anyone help me?
I assume you don't want to manually do the 'redirect-thing'. Normally this is done by the server for you - and that's the reason why you don't just have to edit settings within your application but also on your server!
One of many tutorials for Tomcat can be found here: https://www.mulesoft.com/tcat/tomcat-ssl
Ia m using jboss 6eap .when i try to configure datasource for oracle DB i getting the below exception
JBAS014775: New missing/unsatisfied dependencies:
service jboss.jdbc-driver.oracle_jdbc_driver_OracleDriver (missing)
dependents: [service jboss.data-source.java:jboss/datasources/DefaultDS,
service jboss.driver-demander.java:jboss/datasources/DefaultDS]
config:
<module xmlns="urn:jboss:module:1.0" name="com.oracle.ojdbc6">
<resources>
<resource-root path="ojdbc6.jar"/>
</resources>
<dependencies>
<module name="javax.api"/>
<module name="javax.transaction.api"/>
</dependencies>
</module>
Here is my standalone.xml
<datasources>
<datasource enabled="true" jndi-name="java:jboss/datasources/ExampleDS"
pool-name="ExampleDS" use-java-context="true">
<connection-url>jdbc:h2:mem:test;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE</connection-url>
<driver>h2</driver>
<security>
<user-name>sa</user-name>
<password>sa</password>
</security>
</datasource>
<datasource enabled="true" jndi-name="java:jboss/datasources/DefaultDS" jta="true"
pool-name="DefaultDS_pool" use-ccm="true" use-java-context="true">
<connection-url>jdbc:oracle:thin:#10.236.190.54:1521</connection-url>
<driver>oracle.jdbc.driver.OracleDriver</driver>
<pool>
<prefill>false</prefill>
<use-strict-min>false</use-strict-min>
<flush-strategy>FailingConnectionOnly</flush-strategy>
</pool>
<security>
<user-name>*</user-name>
<password>*</password>
</security>
</datasource>
<drivers>
<driver module="com.h2database.h2" name="h2">
<xa-datasource-class>org.h2.jdbcx.JdbcDataSource</xa-datasource-class>
</driver>
<driver module="com.oracle.ojdbc6" name="ojdbc6">
<driver-class>oracle.jdbc.driver.OracleDriver</driver-class>
<xa-datasource-class>oracle.jdbc.xa.client.OracleXADataSource</xa-datasource-class>
</driver>
</drivers>
</datasources>
I tried out even stackoverflow .it seems to be everything is fine.
I think following things need to be checked on your side.
Copy your downloaded jar to following defined location or create a dir structure if not present.
JBOSS_HOME/modules/com/mysql/main
You can find a very good tutorial here : How to
I've configured JBOSS datasource with a new module:
<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="urn:jboss:module:1.0" name="com.oracle.jdbc">
<resources>
<resource-root path="ojdbc6.jar"/>
</resources>
<dependencies>
<module name="javax.api"/>
</dependencies>
</module>
in the folder %JBOSS_HOME%\modules\com\oracle\jdbc\main
I put in the "main" folder also the driver itself: ojdbc6.jar
Then i configure a datasource with driver:
<datasource jndi-name="java:/jdbc/MyPool" pool-name="MyPool" enabled="true" jta="true" use-java-context="true" use-ccm="true">
<connection-url>jdbc:oracle:thin:#my.server.com:1521:mydbname</connection-url>
<driver>oracle</driver>
<security>
<user-name>myusername</user-name>
<password>mypassword</password>
</security>
</datasource>
<drivers>
<driver name="oracle" module="com.oracle.jdbc"><xa-datasource-class>oracle.jdbc.OracleDriver</xa-datasource-class></driver>
</drivers>
When I start the application server i receive the error:
New missing/unsatisfied dependencies:
service jboss.jdbc-driver.oracle (missing)
The configuration seems to be good to the documentation, may be there is problem with the version of JBOSS or Oracle Driver?
Thanks
I am new to JBOSS and m stuck at basic deployment of app in JBOSS 7.1.1
I have created a webapp with persistent.xml as
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="1.0"
xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd">
<persistence-unit name="mydummy-jpa" transaction-type="RESOURCE_LOCAL">
<provider>org.apache.openjpa.persistence.PersistenceProviderImpl</provider>
<jta-data-source>java:jboss/datasources/mydummyexample</jta-data-source>
<class>com.nsn.caobusiness.selfcare.entity.DummyTable</class>
<properties>
<property name="jboss.as.jpa.providerModule" value="org.jboss.as.jpa.openjpa" />
<property name="openjpa.Log" value="DefaultLevel=WARN,SQL=TRACE" />
<property name="openjpa.jdbc.DBDictionary" value="mysql(UseClobs=true)"/>
</properties>
</persistence-unit>
</persistence>
Datasource in my standalone.xml looks like :
<datasource jndi-name="java:jboss/datasources/mydummyexample" pool-name="mydummyexample" enabled="true" use-java-context="true" use-ccm="true" jta="true">
<connection-url>jdbc:mysql://localhost:3306/worldonstreet</connection-url>
<driver>mysql</driver>
<security>
<user-name>root</user-name>
<password></password>
</security>
<statement>
<prepared-statement-cache-size>100</prepared-statement-cache-size>
<share-prepared-statements/>
</statement>
</datasource>
When i deploy the application, i get following exception :
23:48:06,656 INFO [org.jboss.as.jpa] (MSC service thread 1-5) JBAS011401: Read persistence.xml for mydummy-jpa
23:48:08,000 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-1) MSC00001: Failed to start service jboss.deployment.unit."SpringDatabaseTransaction.war".INSTALL: org.jboss.msc.service.StartException in service jboss.deployment.unit."SpringDatabaseTransaction.war".INSTALL: Failed to process phase INSTALL of deployment "SpringDatabaseTransaction.war"
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:119) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [rt.jar:1.6.0_26]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [rt.jar:1.6.0_26]
at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_26]
**Caused by: javax.persistence.PersistenceException: JBAS011466:
PersistenceProvider
'org.apache.openjpa.persistence.PersistenceProviderImpl' not found**
at org.jboss.as.jpa.processor.PersistenceUnitDeploymentProcessor.lookupProvider(PersistenceUnitDeploymentProcessor.java:555)
at org.jboss.as.jpa.processor.PersistenceUnitDeploymentProcessor.deployPersistenceUnit(PersistenceUnitDeploymentProcessor.java:295)
at org.jboss.as.jpa.processor.PersistenceUnitDeploymentProcessor.addPuService(PersistenceUnitDeploymentProcessor.java:258)
at org.jboss.as.jpa.processor.PersistenceUnitDeploymentProcessor.handleWarDeployment(PersistenceUnitDeploymentProcessor.java:194)
at org.jboss.as.jpa.processor.PersistenceUnitDeploymentProcessor.deploy(PersistenceUnitDeploymentProcessor.java:118)
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:113) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]
I am stuck from entire day at this. Would appreciate any help from this forum.
Regards,
Legolas
I downloaded Apache Openjpa, extracted the jars, created a module in jboss under \JBOSS_HOME>\modules\org\apache\openjpa and changed my property in persistent.xml to
<property name="jboss.as.jpa.providerModule" value="org.apache.openjpa" />
module.xml looks like :
<module xmlns="urn:jboss:module:1.1" name="org.apache.openjpa">
<resources>
<resource-root path="openjpa-2.2.0.jar"/>
<resource-root path="serp-1.13.1.jar"/>
</resources>
<dependencies>
<module name="javax.persistence.api"/>
<module name="javax.transaction.api"/>
<module name="javax.validation.api"/>
<module name="org.apache.commons.lang"/>
<module name="org.apache.commons.collections"/>
<module name="org.apache.log4j"/>
</dependencies>
</module>
it finally worked. :)
Thanks #lurscher for ur comments. It motivated me to carry on.
i am having issues deploying my spring app to tomcat 7 with the following error:
C:\Users\xxxxxx\Work\Online Racing
League\build.xml:61: Problem creating
war: C:\Program Files\Apache Software
Foundation\Tomcat 7.0\webapps\Online
Racing League.war (Access is denied)
(and the archive is probably corrupt
but I could not delete it)
Here is what my build.properties looks like:
# Ant properties for building the springapp
appserver.home=C:/Program Files/Apache Software Foundation/Tomcat 7.0
# for Tomcat 5 use $appserver.home}/server/lib
# for Tomcat 6 use $appserver.home}/lib
appserver.lib=${appserver.home}/lib/
deploy.path=${appserver.home}/webapps
tomcat.manager.url=http://localhost:8080/manager
tomcat.manager.username=
tomcat.manager.password=
Build file:
<?xml version="1.0"?>
<project name="Online Racing League" basedir="." default="usage">
<property file="build.properties"/>
<property name="src.dir" value="src"/>
<property name="web.dir" value="war"/>
<property name="build.dir" value="${web.dir}/WEB-INF/classes"/>
<property name="name" value="Online Racing League"/>
<path id="master-classpath">
<fileset dir="${web.dir}/WEB-INF/lib">
<include name="*.jar"/>
</fileset>
<!-- We need the servlet API classes: -->
<!-- * for Tomcat 5/6 use servlet-api.jar -->
<!-- * for other app servers - check the docs -->
<fileset dir="${appserver.lib}">
<include name="servlet*.jar"/>
</fileset>
<pathelement path="${build.dir}"/>
</path>
<target name="usage">
<echo message=""/>
<echo message="${name} build file"/>
<echo message="-----------------------------------"/>
<echo message=""/>
<echo message="Available targets are:"/>
<echo message=""/>
<echo message="build --> Build the application"/>
<echo message="deploy --> Deploy application as directory"/>
<echo message="deploywar --> Deploy application as a WAR file"/>
<echo message="install --> Install application in Tomcat"/>
<echo message="reload --> Reload application in Tomcat"/>
<echo message="start --> Start Tomcat application"/>
<echo message="stop --> Stop Tomcat application"/>
<echo message="list --> List Tomcat applications"/>
<echo message=""/>
</target>
<target name="build" description="Compile main source tree java files">
<mkdir dir="${build.dir}"/>
<javac destdir="${build.dir}" source="1.5" target="1.5" debug="true"
deprecation="false" optimize="false" failonerror="true">
<src path="${src.dir}"/>
<classpath refid="master-classpath"/>
</javac>
</target>
<target name="deploy" depends="build" description="Deploy application">
<copy todir="${deploy.path}/${name}" preservelastmodified="true">
<fileset dir="${web.dir}">
<include name="**/*.*"/>
</fileset>
</copy>
</target>
<target name="deploywar" depends="build" description="Deploy application as a WAR file">
<war destfile="${deploy.path}/${name}.war"
webxml="${web.dir}/WEB-INF/web.xml">
<fileset dir="${web.dir}">
<include name="**/*.*"/>
</fileset>
</war>
<copy todir="${deploy.path}" preservelastmodified="true">
<fileset dir=".">
<include name="*.war"/>
</fileset>
</copy>
</target>
<!-- ============================================================== -->
<!-- Tomcat tasks - remove these if you don't have Tomcat installed -->
<!-- ============================================================== -->
<path id="catalina-ant-classpath">
<!-- We need the Catalina jars for Tomcat -->
<!-- * for other app servers - check the docs -->
<fileset dir="${appserver.lib}">
<include name="catalina-ant.jar"/>
</fileset>
</path>
<taskdef name="install" classname="org.apache.catalina.ant.DeployTask">
<classpath refid="catalina-ant-classpath"/>
</taskdef>
<taskdef name="reload" classname="org.apache.catalina.ant.ReloadTask">
<classpath refid="catalina-ant-classpath"/>
</taskdef>
<taskdef name="list" classname="org.apache.catalina.ant.ListTask">
<classpath refid="catalina-ant-classpath"/>
</taskdef>
<taskdef name="start" classname="org.apache.catalina.ant.StartTask">
<classpath refid="catalina-ant-classpath"/>
</taskdef>
<taskdef name="stop" classname="org.apache.catalina.ant.StopTask">
<classpath refid="catalina-ant-classpath"/>
</taskdef>
<target name="install" description="Install application in Tomcat">
<install url="${tomcat.manager.url}"
username="${tomcat.manager.username}"
password="${tomcat.manager.password}"
path="/${name}"
war="${name}"/>
</target>
<target name="reload" description="Reload application in Tomcat">
<reload url="${tomcat.manager.url}"
username="${tomcat.manager.username}"
password="${tomcat.manager.password}"
path="/${name}"/>
</target>
<target name="start" description="Start Tomcat application">
<start url="${tomcat.manager.url}"
username="${tomcat.manager.username}"
password="${tomcat.manager.password}"
path="/${name}"/>
</target>
<target name="stop" description="Stop Tomcat application">
<stop url="${tomcat.manager.url}"
username="${tomcat.manager.username}"
password="${tomcat.manager.password}"
path="/${name}"/>
</target>
<target name="list" description="List Tomcat applications">
<list url="${tomcat.manager.url}"
username="${tomcat.manager.username}"
password="${tomcat.manager.password}"/>
</target>
<!-- End Tomcat tasks -->
</project>
servlett:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xsi:schemaLocation="http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd">
<mvc:annotation-driven />
<bean
class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="prefix" value="/WEB-INF/jsp/" />
<property name="suffix" value=".jsp" />
</bean>
<context:component-scan base-package="com.jr" />
</beans>
and finally the web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
version="2.5">
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<!-- index.htm web page -->
<welcome-file-list>
<welcome-file>
index.jsp
</welcome-file>
</welcome-file-list>
<!-- Register and setup my servlet xml files here -->
<servlet>
<servlet-name>raceLeague</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>raceLeague</servlet-name>
<url-pattern>*.htm</url-pattern>
</servlet-mapping>
</web-app>
It looks like you are on Windows Vista or Windows 7 with User Account Control (UAC) enabled.