Java, Maven and Spring (Classpath)
Hello everybody,
after having created a maven java-project (using eclipse Ganymed), I try to access a text file resource (that I already saved in src/main/resources) using the spring framework 3.0. For that I write the following:
Resource template = ctx.getResource("classpath:some/resource/path/myTemplate.txt);
But this intstruction fails with a File Not Found Exception. That probably means that the folder *src/main/resources* is not on the classpath??
The .classpath file generated by Maven looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/classes" path="src/main/java"/>
<classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
<classpathentry kind="output" path="target/classes"/>
</classpath>
1- One can see that the src/main/resources is not in the classpath.
Therefore trying to access to a resource in src/main/resources is not possible like this:
Resource template = ctx.getResource("classpath:some/resource/path/myTemplate.txt);
So my question: Is this a maven problem or a spring one? How should I solve this problem?
2- In the following instruction:
Resource template = ctx.getResource("classpath:some/resource/path/myTemplate.txt);
Does the classpath keyword refers to the classpath generated by maven or to another one??
3- What I also do not understand is, if the folders target/classes and target/test-classes are kind of aliases for src/main... and src/test...? In which hierarchy do they stand one another?
Please tell me if you do not undesrtand my question. I could then try to better explain it Any help would be appreciated.
Regards,
Hi,
First of all you need to check whether the '.txt' file is added in the resource folder under the build folder in you Spring project directory. As fas I understand, the text file is never added to the build folder.
1. try using the build folder path to access the resource. Add the .txt to "target/classes" or some other folder under /targert and then try to access the file.
2. the classpath is the defined for you spring project. Maven is a tool which assists in build process only. So whatever you find in maven xml files is nothing but the configuration of your spring project
3. This question is not clear. please clarify.
Thanks.
Similar Messages
-
Refering to jars from Java Embedding and Spring Context
Hi BPEL Experts
I have been trying to create a Agile PLM session and get data from Agile PLM using two jars AgileAPI.jar and agileclasses.jar. I have placed the jar in following location
C:\OracleSOA\Middleware\Oracle_SOA1\soa\modules\oracle.soa.ext_11.1.1\ext
then run build.xml, my MANIFEST.MF as follows
Manifest-Version: 1.0
Ant-Version: Apache Ant 1.7.1
Created-By: 20.10-b01 (Sun Microsystems Inc.)
Implementation-Vendor: Oracle
Implementation-Title: Oracle SOA EXT
Implementation-Version: 11.1.1
Product-Name: Oracle SOA EXT
Product-Version: 11.1.1.4.0
Specification-Version: 11.1.1
Extension-Name: oracle.soa.ext
Class-Path: ext/AgileAPI.jar ext/agileclasses.jar ext/log4j-1.2.17.jar
classes/
Then I updated BpelcClasspath From EM Console as follows
C:\OracleSOA\Middleware\Oracle_SOA1\soa\modules\oracle.soa.ext_11.1.1\ext\AgileAPI.jar;C:\OracleSOA\Middleware\Oracle_SOA1\soa\modules\oracle.soa.ext_11.1.1\ext\agileclasses.jar;C:\OracleSOA\Middleware\Oracle_SOA1\soa\modules\oracle.soa.ext_11.1.1\ext\log4j-1.2.17.jar
Then Restarted the server, but seems the jars not loading to classpath, and the bpel is unable to refer to the jar. Please find the logs from server during the start up
** Setting up SOA specific environment for win...
PATH=C:\ORACLE~2\MIDDLE~1\patch_wls1036\profiles\default\native;C:\ORACLE~2\MIDDLE~1\patch_ocp371\profiles\default\native;C:\ORACLE~2\MIDDLE~1\WLSERV~1.3\server\nati
ve\win\32;C:\ORACLE~2\MIDDLE~1\WLSERV~1.3\server\bin;C:\ORACLE~2\MIDDLE~1\modules\ORGAPA~1.1\bin;C:\ORACLE~2\MIDDLE~1\JDK160~1\jre\bin;C:\ORACLE~2\MIDDLE~1\JDK160~1\
bin;C:\oraclexe\app\oracle\product\11.2.0\server\bin;;C:\Program Files (x86)\Common Files\NetSarang;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Window
s\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Microsoft Application Virtualization Client;C:\Oracle\Middleware\jdk160_29\bin;C:\Program Files\Microsoft\W
eb Platform Installer\;C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET Web Pages\v1.0\;C:\Program Files (x86)\Windows Kits\8.0\Windows Performance Toolkit\;C:\Progr
am Files\Microsoft SQL Server\110\Tools\Binn\;C:\Program Files\Mot\Mot Data Protection\Encryption\;C:\OracleSOA\Middleware\modules\org.apache.ant_1.7.1\bin;C:\ORAC
LE~2\MIDDLE~1\WLSERV~1.3\server\native\win\32\oci920_8;C:\OracleSOA\Middleware\Oracle_SOA1\soa\thirdparty\edifecs\XEngine\bin
USER_MEM_ARGS=-Xms512m -Xmx1024m -XX:PermSize=128m -XX:MaxPermSize=512m
JAVA_OPTIONS= -Xverify:none
** End SOA Specific environment setup for win.
** SOA specific environment is already set. Skipping ...
"Rijesh CLASSPATH value is = C:\ORACLE~2\MIDDLE~1\ORACLE~1\modules\oracle.jdbc_11.1.1\ojdbc6dms.jar;C:\OracleSOA\Middleware\Oracle_SOA1\soa\modules\user-patch.jar;C
:\OracleSOA\Middleware\Oracle_SOA1\soa\modules\soa-startup.jar;;C:\ORACLE~2\MIDDLE~1\patch_wls1036\profiles\default\sys_manifest_classpath\weblogic_patch.jar;C:\ORAC
LE~2\MIDDLE~1\patch_ocp371\profiles\default\sys_manifest_classpath\weblogic_patch.jar;C:\ORACLE~2\MIDDLE~1\JDK160~1\lib\tools.jar;C:\ORACLE~2\MIDDLE~1\WLSERV~1.3\ser
ver\lib\weblogic_sp.jar;C:\ORACLE~2\MIDDLE~1\WLSERV~1.3\server\lib\weblogic.jar;C:\ORACLE~2\MIDDLE~1\modules\features\weblogic.server.modules_10.3.6.0.jar;C:\ORACLE~
2\MIDDLE~1\WLSERV~1.3\server\lib\webservices.jar;C:\ORACLE~2\MIDDLE~1\modules\ORGAPA~1.1/lib/ant-all.jar;C:\ORACLE~2\MIDDLE~1\modules\NETSFA~1.0_1/lib/ant-contrib.ja
r;C:\ORACLE~2\MIDDLE~1\ORACLE~1\soa\modules\commons-cli-1.1.jar;C:\ORACLE~2\MIDDLE~1\ORACLE~1\soa\modules\oracle.soa.mgmt_11.1.1\soa-infra-mgmt.jar;C:\OracleSOA\Midd
leware\Oracle_SOA1\soa\modules\oracle.soa.common.adapters_11.1.1\oracle.soa.common.adapters.jar;C:\OracleSOA\Middleware\Oracle_SOA1\communications\modules\usermessag
ing-config_11.1.1.jar;C:\ORACLE~2\MIDDLE~1\ORACLE~1\modules\oracle.xdk_11.1.0\xsu12.jar;C:\ORACLE~2\MIDDLE~1\modules\features\weblogic.server.modules.xquery_10.3.1.0
.jar;C:\OracleSOA\Middleware\Oracle_SOA1\soa\modules\db2jcc4.jar;C:\ORACLE~2\MIDDLE~1\USER_P~1\domains\SOA_DO~1\config\soa-infra;C:\OracleSOA\Middleware\Oracle_SOA1\
soa\modules\fabric-url-handler_11.1.1.jar;C:\OracleSOA\Middleware\Oracle_SOA1\soa\modules\quartz-all-1.6.5.jar;C:\OracleSOA\Middleware\Oracle_SOA1\soa\modules\oracle
.soa.fabric_11.1.1\oracle.soa.fabric.jar;C:\OracleSOA\Middleware\Oracle_SOA1\soa\modules\oracle.soa.fabric_11.1.1\fabric-runtime-ext-wls.jar;C:\OracleSOA\Middleware\
Oracle_SOA1\soa\modules\oracle.soa.adapter_11.1.1\oracle.soa.adapter.jar;C:\OracleSOA\Middleware\Oracle_SOA1\soa\modules\oracle.soa.b2b_11.1.1\oracle.soa.b2b.jar;C:\
ORACLE~2\MIDDLE~1\ORACLE~1\modules\oracle.jrf_11.1.1\jrf.jar;C:\ORACLE~2\MIDDLE~1\WLSERV~1.3\common\derby\lib\derbyclient.jar;C:\ORACLE~2\MIDDLE~1\WLSERV~1.3\server\
lib\xqrl.jar"
"Rijesh Classpath end"
JAVA Memory arguments: -Xms512m -Xmx1024m -XX:PermSize=128m -XX:MaxPermSize=512m
WLS Start Mode=Development
CLASSPATH=C:\ORACLE~2\MIDDLE~1\ORACLE~1\modules\oracle.jdbc_11.1.1\ojdbc6dms.jar;C:\OracleSOA\Middleware\Oracle_SOA1\soa\modules\user-patch.jar;C:\OracleSOA\Middlewa
re\Oracle_SOA1\soa\modules\soa-startup.jar;;C:\ORACLE~2\MIDDLE~1\patch_wls1036\profiles\default\sys_manifest_classpath\weblogic_patch.jar;C:\ORACLE~2\MIDDLE~1\patch_
ocp371\profiles\default\sys_manifest_classpath\weblogic_patch.jar;C:\ORACLE~2\MIDDLE~1\JDK160~1\lib\tools.jar;C:\ORACLE~2\MIDDLE~1\WLSERV~1.3\server\lib\weblogic_sp.
jar;C:\ORACLE~2\MIDDLE~1\WLSERV~1.3\server\lib\weblogic.jar;C:\ORACLE~2\MIDDLE~1\modules\features\weblogic.server.modules_10.3.6.0.jar;C:\ORACLE~2\MIDDLE~1\WLSERV~1.
3\server\lib\webservices.jar;C:\ORACLE~2\MIDDLE~1\modules\ORGAPA~1.1/lib/ant-all.jar;C:\ORACLE~2\MIDDLE~1\modules\NETSFA~1.0_1/lib/ant-contrib.jar;C:\ORACLE~2\MIDDLE
~1\ORACLE~1\soa\modules\commons-cli-1.1.jar;C:\ORACLE~2\MIDDLE~1\ORACLE~1\soa\modules\oracle.soa.mgmt_11.1.1\soa-infra-mgmt.jar;C:\OracleSOA\Middleware\Oracle_SOA1\s
oa\modules\oracle.soa.common.adapters_11.1.1\oracle.soa.common.adapters.jar;C:\OracleSOA\Middleware\Oracle_SOA1\communications\modules\usermessaging-config_11.1.1.ja
r;C:\ORACLE~2\MIDDLE~1\ORACLE~1\modules\oracle.xdk_11.1.0\xsu12.jar;C:\ORACLE~2\MIDDLE~1\modules\features\weblogic.server.modules.xquery_10.3.1.0.jar;C:\OracleSOA\Mi
ddleware\Oracle_SOA1\soa\modules\db2jcc4.jar;C:\ORACLE~2\MIDDLE~1\USER_P~1\domains\SOA_DO~1\config\soa-infra;C:\OracleSOA\Middleware\Oracle_SOA1\soa\modules\fabric-u
rl-handler_11.1.1.jar;C:\OracleSOA\Middleware\Oracle_SOA1\soa\modules\quartz-all-1.6.5.jar;C:\OracleSOA\Middleware\Oracle_SOA1\soa\modules\oracle.soa.fabric_11.1.1\o
racle.soa.fabric.jar;C:\OracleSOA\Middleware\Oracle_SOA1\soa\modules\oracle.soa.fabric_11.1.1\fabric-runtime-ext-wls.jar;C:\OracleSOA\Middleware\Oracle_SOA1\soa\modu
les\oracle.soa.adapter_11.1.1\oracle.soa.adapter.jar;C:\OracleSOA\Middleware\Oracle_SOA1\soa\modules\oracle.soa.b2b_11.1.1\oracle.soa.b2b.jar;C:\ORACLE~2\MIDDLE~1\OR
ACLE~1\modules\oracle.jrf_11.1.1\jrf.jar;C:\ORACLE~2\MIDDLE~1\WLSERV~1.3\common\derby\lib\derbyclient.jar;C:\ORACLE~2\MIDDLE~1\WLSERV~1.3\server\lib\xqrl.jar
PATH=C:\ORACLE~2\MIDDLE~1\patch_wls1036\profiles\default\native;C:\ORACLE~2\MIDDLE~1\patch_ocp371\profiles\default\native;C:\ORACLE~2\MIDDLE~1\WLSERV~1.3\server\nati
ve\win\32;C:\ORACLE~2\MIDDLE~1\WLSERV~1.3\server\bin;C:\ORACLE~2\MIDDLE~1\modules\ORGAPA~1.1\bin;C:\ORACLE~2\MIDDLE~1\JDK160~1\jre\bin;C:\ORACLE~2\MIDDLE~1\JDK160~1\
bin;C:\oraclexe\app\oracle\product\11.2.0\server\bin;;C:\Program Files (x86)\Common Files\NetSarang;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Window
s\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Microsoft Application Virtualization Client;C:\Oracle\Middleware\jdk160_29\bin;C:\Program Files\Microsoft\W
eb Platform Installer\;C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET Web Pages\v1.0\;C:\Program Files (x86)\Windows Kits\8.0\Windows Performance Toolkit\;C:\Progr
am Files\Microsoft SQL Server\110\Tools\Binn\;C:\Program Files\Mot\Mot Data Protection\Encryption\;C:\OracleSOA\Middleware\modules\org.apache.ant_1.7.1\bin;C:\ORAC
LE~2\MIDDLE~1\WLSERV~1.3\server\native\win\32\oci920_8;C:\OracleSOA\Middleware\Oracle_SOA1\soa\thirdparty\edifecs\XEngine\bin
* To start WebLogic Server, use a username and *
* password assigned to an admin-level user. For *
* server administration, use the WebLogic Server *
* console at http:\\hostname:port\console *
starting weblogic with Java version:
java version "1.6.0_29"
Java(TM) SE Runtime Environment (build 1.6.0_29-b11)
Java HotSpot(TM) Client VM (build 20.4-b02, mixed mode)
Starting WLS with line:
C:\ORACLE~2\MIDDLE~1\JDK160~1\bin\java -client -Xms512m -Xmx1024m -XX:PermSize=128m -XX:MaxPermSize=512m -Dweblogic.Name=AdminServer -Djava.security.policy=C:\ORAC
LE~2\MIDDLE~1\WLSERV~1.3\server\lib\weblogic.policy -Xverify:none -da -Dplatform.home=C:\ORACLE~2\MIDDLE~1\WLSERV~1.3 -Dwls.home=C:\ORACLE~2\MIDDLE~1\WLSERV~1.3\se
rver -Dweblogic.home=C:\ORACLE~2\MIDDLE~1\WLSERV~1.3\server -Dcommon.components.home=C:\ORACLE~2\MIDDLE~1\ORACLE~1 -Djrf.version=11.1.1 -Dorg.apache.commons.logging
.Log=org.apache.commons.logging.impl.Jdk14Logger -Ddomain.home=C:\ORACLE~2\MIDDLE~1\USER_P~1\domains\SOA_DO~1 -Djrockit.optfile=C:\ORACLE~2\MIDDLE~1\ORACLE~1\modules
\oracle.jrf_11.1.1\jrocket_optfile.txt -Doracle.server.config.dir=C:\ORACLE~2\MIDDLE~1\USER_P~1\domains\SOA_DO~1\config\FMWCON~1\servers\AdminServer -Doracle.domain.
config.dir=C:\ORACLE~2\MIDDLE~1\USER_P~1\domains\SOA_DO~1\config\FMWCON~1 -Digf.arisidbeans.carmlloc=C:\ORACLE~2\MIDDLE~1\USER_P~1\domains\SOA_DO~1\config\FMWCON~1\
carml -Digf.arisidstack.home=C:\ORACLE~2\MIDDLE~1\USER_P~1\domains\SOA_DO~1\config\FMWCON~1\arisidprovider -Doracle.security.jps.config=C:\ORACLE~2\MIDDLE~1\USER_P~
1\domains\SOA_DO~1\config\fmwconfig\jps-config.xml -Doracle.deployed.app.dir=C:\ORACLE~2\MIDDLE~1\USER_P~1\domains\SOA_DO~1\servers\AdminServer\tmp\_WL_user -Doracle
.deployed.app.ext=\- -Dweblogic.alternateTypesDirectory=C:\ORACLE~2\MIDDLE~1\ORACLE~1\modules\oracle.ossoiap_11.1.1,C:\ORACLE~2\MIDDLE~1\ORACLE~1\modules\oracle.oamp
rovider_11.1.1 -Djava.protocol.handler.pkgs=oracle.mds.net.protocol"|"oracle.fabric.common.classloaderurl.handler"|"oracle.fabric.common.uddiurl.handler"|"oracle.bpm
.io.fs.protocol -Dweblogic.jdbc.remoteEnabled=false -Doracle.security.jps.policy.migration.validate.principal=false -da:org.apache.xmlbeans... -Dsoa.archives.dir=C
:\OracleSOA\Middleware\Oracle_SOA1\soa -Dsoa.oracle.home=C:\OracleSOA\Middleware\Oracle_SOA1 -Dsoa.instance.home=C:\ORACLE~2\MIDDLE~1\USER_P~1\domains\SOA_DO~1 -Dtan
gosol.coherence.clusteraddress=227.7.7.9 -Dtangosol.coherence.clusterport=9778 -Dtangosol.coherence.log=jdk -Djavax.xml.soap.MessageFactory=oracle.j2ee.ws.saaj.soap.
MessageFactoryImpl -Dweblogic.transaction.blocking.commit=true -Dweblogic.transaction.blocking.rollback=true -Djavax.net.ssl.trustStore=C:\ORACLE~2\MIDDLE~1\WLSERV~1
.3\server\lib\DemoTrust.jks -Dem.oracle.home=C:\OracleSOA\Middleware\oracle_common -Djava.awt.headless=true -Dbam.oracle.home=C:\OracleSOA\Middleware\Oracle_SOA1 -Du
ms.oracle.home=C:\OracleSOA\Middleware\Oracle_SOA1 -Dweblogic.management.discover=true -Dwlw.iterativeDev= -Dwlw.testConsole= -Dwlw.logErrorsToConsole= -Dweblogic.e
xt.dirs=C:\ORACLE~2\MIDDLE~1\patch_wls1036\profiles\default\sysext_manifest_classpath;C:\ORACLE~2\MIDDLE~1\patch_ocp371\profiles\default\sysext_manifest_classpath w
eblogic.Server
<Sep 22, 2014 7:13:12 PM IST> <Info> <Security> <BEA-090905> <Disabling CryptoJ JCE Provider self-integrity check for better startup performance. To enable this chec
k, specify -Dweblogic.security.allowCryptoJDefaultJCEVerification=true>
<Sep 22, 2014 7:13:12 PM IST> <Info> <Security> <BEA-090906> <Changing the default Random Number Generator in RSA CryptoJ from ECDRBG to FIPS186PRNG. To disable this
change, specify -Dweblogic.security.allowCryptoJDefaultPRNG=true>
<Sep 22, 2014 7:13:12 PM IST> <Info> <WebLogicServer> <BEA-000377> <Starting WebLogic Server with Java HotSpot(TM) Client VM Version 20.4-b02 from Sun Microsystems I
nc.>
<Sep 22, 2014 7:13:12 PM IST> <Info> <Management> <BEA-141107> <Version: WebLogic Server 10.3.6.0 Tue Nov 15 08:52:36 PST 2011 1441050 >
<Sep 22, 2014 7:13:13 PM IST> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to STARTING>
<Sep 22, 2014 7:13:13 PM IST> <Info> <WorkManager> <BEA-002900> <Initializing self-tuning thread pool>
<Sep 22, 2014 7:13:14 PM IST> <Notice> <LoggingService> <BEA-320400> <The log file C:\OracleSOA\Middleware\user_projects\domains\soa_domain\servers\AdminServer\logs\
AdminServer.log will be rotated. Reopen the log file if tailing has stopped. This can happen on some platforms like Windows.>
<Sep 22, 2014 7:13:14 PM IST> <Notice> <LoggingService> <BEA-320401> <The log file has been rotated to C:\OracleSOA\Middleware\user_projects\domains\soa_domain\serve
rs\AdminServer\logs\AdminServer.log00064. Log messages will continue to be logged in C:\OracleSOA\Middleware\user_projects\domains\soa_domain\servers\AdminServer\log
s\AdminServer.log.>
<Sep 22, 2014 7:13:14 PM IST> <Notice> <Log Management> <BEA-170019> <The server log file C:\OracleSOA\Middleware\user_projects\domains\soa_domain\servers\AdminServe
r\logs\AdminServer.log is opened. All server side log events will be written to this file.>
<Sep 22, 2014 7:13:17 PM IST> <Notice> <Security> <BEA-090082> <Security initializing using security realm myrealm.>
<Sep 22, 2014 7:13:26 PM IST> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to STANDBY>
<Sep 22, 2014 7:13:26 PM IST> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to STARTING>again, another unanswered question.
BTW I'l keep bumping these until I get an answer that works. I have been up 3 hours now trying to get this sorted and it's something that netbeans is supposed to do on its own!?!?!?!?!
Hello, SUN, is there anyone there???
No, didn't think so. -
We can define the project structure in POM and then maven can
create the Eclipse project for that (
mvn eclipse:eclipse ). How can we write our pom.xml so that
after creating a project through
mvn eclipse:eclipse, we can do development in Java as well
as Flex?
For now, I am doing so by creating the base Java project
through maven and then editing the .project, .classpath files to
introduce build command and flex project nature. Also
.flexProperties and
.actionScriptProperties files have to be there in
place.Stephan in the Devnet I saw an article about it a few month ago, maybe there
aren't new articles because the workflow hasn't change since the authors
published those articles.
2009/4/22 Stéphan Lascar <[email protected]>
>
Good morning...
>
I'm looking for a good solution to work with flex and Maven. I've found
lots of tutorial on google, every topics are very old. Nothing really nice.
My main goal is to find an artifact to create a maven - blazeDs - Java.
>
Could you share some link or article with some working exemple....
>
Thanks a lot.
>
Have a nice day.
> -
Deployement problem in Oracle App Serv with hibernate + JPA and Spring
Dear All,
I am facing a problem in deployment of a web application in oracle application server 10g. but the same is working fine with Tomcat. The following Exception. Is being thrown.
Failed to deploy web application "OraTest". Failed to deploy web application OraTest". . Nested exception Resolution:
Base Exception:
java.rmi.RemoteException
deploy failed!: ; nested exception is:
oracle.oc4j.admin.internal.DeployerException: Unknown assembly root-tag attribute: version. deploy failed!: ; nested exception is:
oracle.oc4j.admin.internal.DeployerException: Unknown assembly root-tag attribute: version I am using the following technologies
1. Spring 2.0.7
2. Struts 2.0.9
3. Hibernate 3.3
4. JPA 1.0
5. Oracle App Server 10.1.2.0.2
Web.xml
<?xml version="1.0" encoding="UTF-8"?>
<!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>
<display-name>My Application</display-name>
<filter>
<filter-name>struts2</filter-name>
<filter-class>
org.apache.struts2.dispatcher.FilterDispatcher
</filter-class>
</filter>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<welcome-file-list>
<welcome-file>/index.jsp</welcome-file>
</welcome-file-list>
<servlet>
<servlet-name>dwr-invoker</servlet-name>
<servlet-class>
org.directwebremoting.servlet.DwrServlet
</servlet-class>
<init-param>
<param-name>debug</param-name>
<param-value>true</param-value>
</init-param>
</servlet>
<servlet-mapping>
<servlet-name>dwr-invoker</servlet-name>
<url-pattern>/dwr/*</url-pattern>
</servlet-mapping>
<listener>
<listener-class>
org.springframework.web.context.ContextLoaderListener
</listener-class>
</listener>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
/WEB-INF/conf/spring/datasource-context.xml,
/WEB-INF/conf/spring/aop-context.xml
</param-value>
</context-param>
</web-app>
/Datasource-context.xml
<?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:aop="http://www.springframework.org/schema/aop"
xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.0.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd">
<bean class="org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor" lazy-init="true"/>
<!-- following code is for using oracle -->
<bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource" lazy-init="true">
<property name="driverClassName">
<value>oracle.jdbc.driver.OracleDriver</value>
</property>
<property name="url">
<value>jdbc:oracle:thin:@//xxx.xxx.xxx.xxx/mydb</value>
</property>
<property name="username">
<value>admin</value>
</property>
<property name="password">
<value>admin</value>
</property>
</bean>
<!-- following code is for using mysql -->
<!--
<bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource" lazy-init="true">
<property name="driverClassName">
<value>org.gjt.mm.mysql.Driver</value>
</property>
<property name="url">
<value>jdbc:mysql://192.168.10.157:3306/tpsadmin</value>
</property>
<property name="username">
<value>tpsadmin</value>
</property>
<property name="password">
<value>tpsadmin</value>+
</property>
</bean>
-->
<bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean" lazy-init="true">
<property name="persistenceUnitName" value="mkclsetsPersistenceUnit"/>
<property name="dataSource" ref="dataSource"/>
<property name="jpaVendorAdapter">
<bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter" lazy-init="true">
<property name="database" value="ORACLE"/>
<property name="showSql" value="true"/>
</bean>
</property>
</bean>
<bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager" lazy-init="true">
<property name="entityManagerFactory" ref="entityManagerFactory"></property>
</bean>
<tx:annotation-driven transaction-manager="transactionManager"/>
</beans>Aop-context.xml
<?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:aop="http://www.springframework.org/schema/aop"
xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.0.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd">
<!-- Bean Definition of all the required Interceptors -->
<bean id="methodLoggingAdvice" class="com.mkcl.sets.common.interceptor.MehodLogInterceptor"/>
<!--
<bean id="appCacheManager" class="net.sf.ehcache.CacheManager">
<constructor-arg index="0" type="java.net.URL" value="classpath:country-ehcache.xml"/>
</bean>
-->
<!--bean id="methodCacheInterceptor" -->
<bean id="methodCachingAdvice"
class="com.mkcl.sets.common.interceptor.MethodCacheInterceptor">
<property name="cache">
<ref local="methodCache" />
</property>
</bean>
<bean id="cacheManager"
class="org.springframework.cache.ehcache.EhCacheManagerFactoryBean">
<property name="configLocation">
<value>WEB-INF/conf/other/ehcache.xml</value>
</property>
</bean>
<bean id="methodCache"
class="org.springframework.cache.ehcache.EhCacheFactoryBean">
<property name="cacheManager">
<ref local="cacheManager" />
</property>
<property name="cacheName">
<value>mkclSetsCache</value>
</property>
</bean>
<!--
<bean id="methodCachingAdvice" class="interceptor.MethodCachingInterceptor"/>
-->
<aop:config>
<aop:pointcut id="getCountriesPointCut" expression="execution(* com.mkcl.sets.dao.master.impl.LocationDAOImpl.getCountries())"/>
<!-- <aop:pointcut id="methodLogPointCut" expression="execution(* com.mkcl.sets.service.master.impl.CategoryServiceImpl.getAllCategories(..))"/> -->
<aop:pointcut id="methodLogPointCutDao" expression="execution(* com.mkcl.sets.dao..*.*(..))"/>
<aop:pointcut id="methodLogPointCutService" expression="execution(* com.mkcl.sets.service..*.*(..))"/>
<aop:advisor id="methodCachingAdvisor" advice-ref="methodCachingAdvice" pointcut-ref="getCountriesPointCut"/>
<aop:advisor id="methodLoggingAdvisorDao" advice-ref="methodLoggingAdvice" pointcut-ref="methodLogPointCutDao"/>
<aop:advisor id="methodLoggingAdvisorService" advice-ref="methodLoggingAdvice" pointcut-ref="methodLogPointCutService"/>
</aop:config>
</beans>Persistence.xml
<persistence 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"
version="1.0">
<persistence-unit name="mkclsetsPersistenceUnit" transaction-type="RESOURCE_LOCAL">
<!-- jta-data-source>mkclDS</jta-data-source-->
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<!-- properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.Oracle10gDialect"/>
<property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.OC4JTransactionManager"/>
</properties-->
</persistence-unit>
</persistence>Do I need to add some other configuration in the existing files or do I need to add some other configuration files ? Please help to deploy my application.
Thanks a lot in advance.
With Best Regards,
Ishaan
nullDid you ever find a solution to this Ishaan?
I imagine you ended up having to upgrade 10gR2 to 10gR3 at least. Correct? -
Java Platform and Technologies Take Center Stage at GIDS 2010
Great Indian Developer Summit 2010 u2013 India's Biggest Polyglot Conference and Workshops for IT Software Professionals
Bangalore, April 9, 2010: The GIDS.Java Conference and Workshops has announced the complete program of over 50 sessions on the present and future of the Java language and VM, how they are evolving to meet the community's ever-changing needs, and some of the cutting-edge tools, technologies & techniques used for building robust enterprise Java applications today. The GIDs.Java track at Great Indian Developer Summit takes place 22 and 23 April 2010, at the Indian Institute of Science in Bangalore.
As one of the longest running independent developer conferences in India, GIDS.Java at the Great Indian Developer Summit 2010 is uniquely positioned to provide a blend of practical, pragmatic and immediately applicable knowledge and a glimpse of the future of technology. During 22 and 23 April 2010, GIDS.Java offers a multi-track conference, workshops, expo show floor, and networking opportunities.
The first keynote at GIDS.Java "Pointy Haired Bosses and Pragmatic Programmers" is led by Dr. Venkat Subramaniam. He speaks about how each of us has a professional responsibility to be objective and make decisions that will help us and our teams be productive and deliver results. Venkat will pick on some fallacies, lay down facts, and discuss how to stay professional and objective in our daily efforts.
The second keynote of the day explains the practical features that make the Cloud so interesting, and why everyone should start using it in their everyday life. Simone Brunozzi, Amazon Web Services Technology Evangelist, will detail technical examples, business details all mixed with a lot of Italian humor to ensure audience enjoy this talk without a single line of code.
The third keynote of the day gives an exciting overview of directions in the Java space for Oracle, featuring concrete signs of Oracles heavy investment, a clear concise strategy overview, and deep dives into some of the most interesting pieces of technology being developed in the Java Platform Group today; such as JavaEE, JDK7, JavaFX, and our exciting new visual tools. Featuring demos by a Java evangelism team star, Simon Ritter, this talk takes you top to bottom in Java Technology.
Featured talks at GID.Web include:
Good, Bad, and Ugly of Java Generics, Venkat Subramaniam
Pure Java Ajax: An Overview of GWT 2.0, Marty Hall
How JPA 2.0 Makes a Good Thing Even Better, Mike Keith
Building Enterprise RIAs with Adobe Flex and Java, Sujit Reddy G
Integrated Ajax Support in JSF 2.0, Marty Hall
Design Patterns in Java and Groovy, Venkat Subramaniam
A Gentle Introduction to iPhone and Obj-C for Java Developers, Matthew McCullough
Cloud Computing: Azure for Java Developers, Janakiram MSV
Ajax Support in the Prototype JavaScript Library, Marty Hall
First steps to IT Heaven Through the Cloud. Part III: .Java, Simone Brunozi
Building Web 2.0 User Interfaces for Web Service Models using JSF, Frank Nimphius and Jobinesh P
Acceptance Test Driven Development, John Tobin and Mohammed Mohsinali
Architecting Your Java Applications for the Cloud, Praveen Srivatsa
Effective Java, Venkat Subramaniam
The Amazing Groovy Weight-loss Plan, Scott Davis
Enterprise Modeling - from Conceptual Planning to Technical Blueprints, J Sripad
Java Collections Renaissance, Donald Raab and Vlad Zakharov
Power 7 and IBM J9VM, Himanshu Goyal
A Whistle-stop Tour of Maven 3.0, Matthew McCullough
Mass Volume Opportunities for Java Developers, Jouko Nuottila
Emerging Technology Complex Event Processing, Duvvuri Srinivas
Agile ALM for Distributed Development, Karthi Swaminathan
Dim Sum Grails - A Sampler of Practical Non Database-Driven Grails Applications, Scott Davis
Diagnosing Performance Bottlenecks in J2EE, Deepak Kaul
Business Driven Identity Management, Suneet Agera
Combining Java EE with OSGi using Eclipse Gemini, Mike Keith
Workshop: Essence of Functional Programming, Venkat Subramaniam
Workshop: Agile Development, Tools, and Teams and Scrum Certification, Stephen Forte
Workshop: Cloud Computing Boot Camp on the Google App Engine, Matthew McCullough
Workshop: Building Your First Amazon App, Simone Brunozzi
Workshop: The 180-min AJAX and JSON Spike Class, Scott Davis
Workshop: PHP + Adobe Flex = Killer RIA, Shyamprasad P
Workshop: User Expereince Evaluation Model Walkthrough, Sanna Häiväläinen
Workshop: Building Data Centric Applications using Adobe Flex and Java, Prashant Singh
Workshop: Monetizing your Apps with PayPal X Payments Platform, Khurram Khan, Praveen Alavilli
Sponsors of Great Indian Developer Summit 2010 include: Platinum sponsors Microsoft, Oracle Forum Nokia and Adobe; Gold sponsors Intel and SAP; Silver sponsors Quest Software, PayPal, Telerik and AMT.
About Great Indian Developer Summit
Great Indian Developer Summit is the gold standard for India's software developer ecosystem for gaining exposure to and evaluating new projects, tools, services, platforms, languages, software and standards. Packed with premium knowledge, action plans and advise from been-there-done-it veterans, creators, and visionaries, the 2010 edition of Great Indian Developer Summit features focused sessions, case studies, workshops and power panels that will transform you into a force to reckon with. Featuring 3 co-located conferences: GIDS.NET, GIDS.Web, GIDS.Java and an exclusive day of in-depth tutorials - GIDS.Workshops, from 20 April to 24 April at the IISc campus in Bangalore.
At GIDS you'll participate in hundreds of sessions encompassing the full range of Microsoft computing, Java, Agile, RIA, Rich Web, open source/standards, languages, frameworks and platforms, practical tutorials that deep dive into technical skill and best practices, inspirational keynote presentations, an Expo Hall featuring dozens of the latest projects and products activities, engaging networking events, and the interact with the best and brightest of speakers from around the world.
For further information on GIDS 2010, please visit the summit on the web http://www.developersummit.com/
A Saltmarch Media Press Release
E: info AT saltmarch dot com
Ph: +91 80 4005 1000
Edited by: wonkim785 on Apr 14, 2010 8:23 AMIm not sure if this is the right place to post this, but anyway thanks for the info :)
-
Weblogic 10.3TP, JAX-WS and Spring integration
Hi all
We are using JAX-WS and Spring (2.0.6) and our target platform will be Weblogic 10.3. We would like to benefit from Spring injection in our web service classes. However I cannot get it to work. I follow the instructions described here: [url https://jax-ws-commons.dev.java.net/spring]https://jax-ws-commons.dev.java.net/spring and I use version 1.7 of jaxws-spring
When deploying the sample project I get the following error:
2007-12-06 09:28:42,238 ERROR [org.springframework.web.context.ContextLoader] - Context initialization failed
org.springframework.beans.factory.BeanCreationException:
Error creating bean with name 'com.sun.xml.ws.transport.http.servlet.SpringBinding' defined in ServletContext resource [WEB-INF/applicationContext.xml]:
Cannot create inner bean '(inner bean)' of type [org.jvnet.jax_ws_commons.spring.SpringService] while setting bean property 'service';
nested exception is org.springframework.beans.factory.BeanCreationException:
Error creating bean with name '(inner bean)': FactoryBean threw exception on object creation;
nested exception is java.lang.ClassCastException: org.jvnet.jax_ws_commons.spring.SpringService$ContainerWrapper cannot be cast to weblogic.wsee.jaxws.WLSContainer
Caused by:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)': FactoryBean threw exception on object creation;
nested exception is java.lang.ClassCastException: org.jvnet.jax_ws_commons.spring.SpringService$ContainerWrapper cannot be cast to weblogic.wsee.jaxws.WLSContainer
Caused by:
java.lang.ClassCastException: org.jvnet.jax_ws_commons.spring.SpringService$ContainerWrapper cannot be cast to weblogic.wsee.jaxws.WLSContainer
at weblogic.wsee.jaxws.framework.policy.WSDLGeneratorExtension.start(WSDLGeneratorExtension.java:113)
at com.sun.xml.ws.wsdl.writer.WSDLGeneratorExtensionFacade.start(WSDLGeneratorExtensionFacade.java:67)
at com.sun.xml.ws.wsdl.writer.WSDLGenerator.generateDocument(WSDLGenerator.java:353)
at com.sun.xml.ws.wsdl.writer.WSDLGenerator.doGeneration(WSDLGenerator.java:276)
at com.sun.xml.ws.server.EndpointFactory.generateWSDL(EndpointFactory.java:427)
at com.sun.xml.ws.server.EndpointFactory.createEndpoint(EndpointFactory.java:196)
at com.sun.xml.ws.api.server.WSEndpoint.create(WSEndpoint.java:467)
at org.jvnet.jax_ws_commons.spring.SpringService.getObject(SpringService.java:333)
at org.jvnet.jax_ws_commons.spring.SpringService.getObject(SpringService.java:45)
at org.springframework.beans.factory.support.AbstractBeanFactory.getObjectFromFactoryBean(AbstractBeanFactory.java:1236)
at org.springframework.beans.factory.support.AbstractBeanFactory.getObjectForBeanInstance(AbstractBeanFactory.java:1207)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveInnerBean(BeanDefinitionValueResolver.java:219)
...It sounds like JAX-WS - Spring integration is not supported in Weblogic 10.3TP.
Has anyone been able to get the sample project working?
Does anyone know if the final version of Weblogic 10.3 will have JAX-WS Spring injection support?
Thanks
Driesanybody can help?
thanks -
EAR and long CLASSPATH at JSP compilation time
Hi all,
we have an EAR-packaged application with over 260 jars (mainly
EJB) that is deployed to a managed server WL6.1SP3(AIX). Then
we hit a JSP page of this app. and Weblogic generates the
adecuate .java file that is passed as an argument to a forked
process for the javac compiler with a CLASSPATH that is more
than 22KB!! of length because of the EAR classloader schema
(it must include all the jars of the EJB level).
The problem is that the EAR deployment in WL6.1 generates a fixed and very long
path for every jar that it is composed of:
$WL_HOME/./config/DOMAIN/applications/.wl_notdelete_EARNAME
/wlap#####/ejbjarname.jar
and the invoke of the compiler fails with argument too long.
We can control the EJB jar name, EARNAME, WL_HOME
and DOMAIN to shorten the CLASSPATH, but that is not enough
giving that the fixed part of the PATH is very long, for example:
with DOMAIN=DOM1, WL_HOME=W, ejbjar name=EJB1, EARNAME=EAR1
you get:
/w/./config/DOM1/applications/.wl_notdelete_EAR1/wlap#####/EJB1.jar: that is
68 chars * 260 jars = more than 17KB only with the
EJB part of the CLASSPATH (plus the standard SYSTEM CLASSPATH
and WARS CLASSPATH.)
As workarounds we can:
1.- Use an "pseudo exploded" EAR with EJBREMOTE and EJBHOME in clientclasses path
with every jar and war by their own. Not very
clean and we've lost the benefits of EAR deployment.
2.- Consolidate a bunch of EJB in every jar. More administrative
tasks (common xml descriptors:ejb-jar.xml,...) and less isolation
between developer teams.
3.- Consolidate at functionality level (source) a bunch of EJB
in a few one. :(
4.- Precompile every JSP outside of WEBLOGIC and generate
the corresponding class and entries at web.xml and weblogic.xml
5.- ...?
or maybe:
6.- configure this very long directory of deployment
to a shorter deployer choosen and use relative paths.
Is this possible? :)
PacoG.
You may try to use JSP compiler class. Please specify 'compilerclass'
option in weblogic.xml. This option specifies name of a Java compiler
that is executed in WebLogic Servers's virtual machine. (Used in place of
an executable compiler such as javac or sj.)
Please see
http://e-docs.bea.com/wls/docs61/webapp/weblogic_xml.html#jsp-descriptor.
Paco Garcia wrote:
> oops!
>
> >$WL_HOME/./config/DOMAIN/applications/.wl_notdelete_EARNAME
> >/wlap#####/ejbjarname.jar
>
> >with DOMAIN=DOM1, WL_HOME=W, ejbjar name=EJB1, EARNAME=EAR1
> >you get:
> >/w/./config/DOM1/applications/.wl_notdelete_EAR1/wlap#####/EJB1.jar:
>
> please read SERVERNAME instead of EARNAME
>
> PacoG.
Regards,
Ann
Developer Relations Engineer
BEA Support
-
Need Help in JNDI Datasource using tomcat and spring
Hi,
I am trying to connect my local database using JNDI datasource in tomcat and spring
I have done the below configuration in Tomcat 7 server:
In tomcat server.xml (Path: E:\apache-tomcat-7.0.35\conf) I added the below configuration
<Resource name="UserDatabase" auth="Container"
type="org.apache.catalina.UserDatabase"
description="User database that can be updated and saved"
factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
pathname="conf/tomcat-users.xml" />
<Resource name="jdbc/myApp" auth="Container"
type="javax.sql.DataSource"
driverClassName="oracle.jdbc.OracleDriver"
url="jdbc:oracle:thin:hr@localhost:1521:XE>"
username="testUser" password="password"
maxActive="10" maxIdle="5"
maxWait="60000" removeAbandoned="true"
removeAbandonedTimeout="60" logAbandoned="true"/>
In web.xml, I have added the below config:
<resource-ref>
<description>Oracle Spring JNDI Datasource</description>
<res-ref-name>jdbc/myApp</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
And in my Spring context xml (ws-context.xml), added below config:
<bean name="myDataSourceInJndi" class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiName" value="java:comp/env/jdbc/myApp"/>
</bean>
<jee:jndi-lookup id="dataSource" jndi-name="/jdbc/myApp" resource-ref="true"/>
In my Java code, I am trying the below code to connect DataBase:
Context initCtx = new InitialContext();
Context envCtx = (Context) initCtx.lookup("java:comp/env");
DataSource ds = (DataSource) envCtx.lookup("jdbc/myApp");
ds.getConnection();
But I am getting the below exception while executing ****ds.getConnection();***
java.lang.IllegalStateException: Connection factory returned null from createConnection
at org.apache.tomcat.dbcp.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:584)
at org.apache.tomcat.dbcp.dbcp.BasicDataSource.validateConnectionFactory(BasicDataSource.java:1556)
at org.apache.tomcat.dbcp.dbcp.BasicDataSource.createPoolableConnectionFactory(BasicDataSource.java:1545)
at org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1388)
at org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:1044)
at com.wipro.spring.impl.EmployeeImpl.getDetails(EmployeeImpl.java:57)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.sun.xml.ws.api.server.InstanceResolver$1.invoke(InstanceResolver.java:246)
at com.sun.xml.ws.server.InvokerTube$2.invoke(InvokerTube.java:146)
at com.sun.xml.ws.server.sei.EndpointMethodHandler.invoke(EndpointMethodHandler.java:257)
at com.sun.xml.ws.server.sei.SEIInvokerTube.processRequest(SEIInvokerTube.java:93)
at com.sun.xml.ws.api.pipe.Fiber.__doRun(Fiber.java:598)
at com.sun.xml.ws.api.pipe.Fiber._doRun(Fiber.java:557)
at com.sun.xml.ws.api.pipe.Fiber.doRun(Fiber.java:542)
at com.sun.xml.ws.api.pipe.Fiber.runSync(Fiber.java:439)
at com.sun.xml.ws.server.WSEndpointImpl$2.process(WSEndpointImpl.java:243)
at com.sun.xml.ws.transport.http.HttpAdapter$HttpToolkit.handle(HttpAdapter.java:471)
at com.sun.xml.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:244)
at com.sun.xml.ws.transport.http.servlet.ServletAdapter.handle(ServletAdapter.java:135)
at com.sun.xml.ws.transport.http.servlet.WSServletDelegate.doGet(WSServletDelegate.java:129)
at com.sun.xml.ws.transport.http.servlet.WSServletDelegate.doPost(WSServletDelegate.java:160)
at com.sun.xml.ws.transport.http.servlet.WSSpringServlet.doPost(WSSpringServlet.java:52)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:647)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:936)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1004)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:1822)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
Can you please me to resolve this issue? Am I missing any configuration or any mistake in my java code please suggest your suggestions.
ThanksHi,
I am trying to connect my local database using JNDI datasource in tomcat and spring
I have done the below configuration in Tomcat 7 server:
In tomcat server.xml (Path: E:\apache-tomcat-7.0.35\conf) I added the below configuration
<Resource name="UserDatabase" auth="Container"
type="org.apache.catalina.UserDatabase"
description="User database that can be updated and saved"
factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
pathname="conf/tomcat-users.xml" />
<Resource name="jdbc/myApp" auth="Container"
type="javax.sql.DataSource"
driverClassName="oracle.jdbc.OracleDriver"
url="jdbc:oracle:thin:hr@localhost:1521:XE>"
username="testUser" password="password"
maxActive="10" maxIdle="5"
maxWait="60000" removeAbandoned="true"
removeAbandonedTimeout="60" logAbandoned="true"/>
In web.xml, I have added the below config:
<resource-ref>
<description>Oracle Spring JNDI Datasource</description>
<res-ref-name>jdbc/myApp</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
And in my Spring context xml (ws-context.xml), added below config:
<bean name="myDataSourceInJndi" class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiName" value="java:comp/env/jdbc/myApp"/>
</bean>
<jee:jndi-lookup id="dataSource" jndi-name="/jdbc/myApp" resource-ref="true"/>
In my Java code, I am trying the below code to connect DataBase:
Context initCtx = new InitialContext();
Context envCtx = (Context) initCtx.lookup("java:comp/env");
DataSource ds = (DataSource) envCtx.lookup("jdbc/myApp");
ds.getConnection();
But I am getting the below exception while executing ****ds.getConnection();***
java.lang.IllegalStateException: Connection factory returned null from createConnection
at org.apache.tomcat.dbcp.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:584)
at org.apache.tomcat.dbcp.dbcp.BasicDataSource.validateConnectionFactory(BasicDataSource.java:1556)
at org.apache.tomcat.dbcp.dbcp.BasicDataSource.createPoolableConnectionFactory(BasicDataSource.java:1545)
at org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1388)
at org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:1044)
at com.wipro.spring.impl.EmployeeImpl.getDetails(EmployeeImpl.java:57)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.sun.xml.ws.api.server.InstanceResolver$1.invoke(InstanceResolver.java:246)
at com.sun.xml.ws.server.InvokerTube$2.invoke(InvokerTube.java:146)
at com.sun.xml.ws.server.sei.EndpointMethodHandler.invoke(EndpointMethodHandler.java:257)
at com.sun.xml.ws.server.sei.SEIInvokerTube.processRequest(SEIInvokerTube.java:93)
at com.sun.xml.ws.api.pipe.Fiber.__doRun(Fiber.java:598)
at com.sun.xml.ws.api.pipe.Fiber._doRun(Fiber.java:557)
at com.sun.xml.ws.api.pipe.Fiber.doRun(Fiber.java:542)
at com.sun.xml.ws.api.pipe.Fiber.runSync(Fiber.java:439)
at com.sun.xml.ws.server.WSEndpointImpl$2.process(WSEndpointImpl.java:243)
at com.sun.xml.ws.transport.http.HttpAdapter$HttpToolkit.handle(HttpAdapter.java:471)
at com.sun.xml.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:244)
at com.sun.xml.ws.transport.http.servlet.ServletAdapter.handle(ServletAdapter.java:135)
at com.sun.xml.ws.transport.http.servlet.WSServletDelegate.doGet(WSServletDelegate.java:129)
at com.sun.xml.ws.transport.http.servlet.WSServletDelegate.doPost(WSServletDelegate.java:160)
at com.sun.xml.ws.transport.http.servlet.WSSpringServlet.doPost(WSSpringServlet.java:52)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:647)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:936)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1004)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:1822)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
Can you please me to resolve this issue? Am I missing any configuration or any mistake in my java code please suggest your suggestions.
Thanks -
Hi all ,
How we can work with JAVA APIs and MDM .
Please tell step by step ways.
thanks in advance.
Thnks
nmHi Man,
You have to specify the correct JAR files in the classpath of the Java Virtual Machine (JVM). The API consists of five JAR files:
1. mdm-admin.jar
2. mdm-common.jar
3. mdm-core.jar
4. mdm-data.jar
5. mdm-protocol.jar
These files in one single archive file with the name MDMJavaAPI_Ver<buildnumber>.zip. you can download this file from the service market place by using mentioned below link:
http://service.sap.com/swdc
then goto Download>Support Packages and Patches> Entry by application group -->SAP NetWeaver -->SAP MDM -->SAPMDM5.5 -->Java API
for the Java API documentation, you can download it from the link below:
http://help.sap.com/javadocs/MDM/current
But remember one thing that this JAVA API Version file must be compitable with your MDM Server version.you can verify this as per the build version.
Hope this will help you.
TNR,
Saurabh...
Edited by: Saurabh Kumar Sahu on Feb 1, 2008 8:09 AM
Edited by: Saurabh Kumar Sahu on Feb 4, 2008 7:49 AM -
Flash builder 4 compatible myeclipse and spring
Hi ,
i did a project using flex 3 , spring 2.5 and myeclipse 6.6 , i want to migrate it to new flash builder 4 .
can some one explain what are "compatible versions of myeclipse and spring " for flash builder 4WSDL is not on public domain.
Sending contents of wsdl
<?
xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!-- Generated by JAX-WS RI at http://jax-ws.dev.java.net. RI's version is JAX-WS RI 2.1.4-b01-. -->
<
definitions targetNamespace="http://webservice.flexsampleservlet.u0.deere.com/" name="CustomerWS" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://webservice.flexsampleservlet.u0.deere.com/" xmlns="http://schemas.xmlsoap.org/wsdl/">
<types>
<xsd:schema>
<xsd:import namespace="http://webservice.flexsampleservlet.u0.deere.com/" schemaLocation="CustomerWS_schema1.xsd"/>
</xsd:schema>
</types>
Is import of xsd supported by flex webservice connection wizard
Destination is configured correctly as I can make call to webservice using destination configured in LCDS from flex application -
Configuration of java extensions and applets
Hi,
I'm running IIS5.1/CFMX7.0.1 and once again have difficulty
configuring my extensions/applets:
- extension: cfx_pdf (easel.com)
- self-written richtexteditor applet (swing/jdk1.4) with
retrieval function
After some trouble both have been running on 6.1.
Now I'm upgrading to CFMX 7.0.1, set the class paths and
added both extensions but Java doesn't seem to get the job done.
1. It can't locate the cfx_pdf jar class
2. It is not retrieving the text from the richtexteditor
after a post
Is there any way to verify my settings besides the
webconfiguration tool?
Does CF have an alternative way to configure my extensions?
Each time I configure CF( 6.1 & 7.0) extensions (both C++/Java)
on some server (XP/MS2003 & IIS5.1/6.0) I run in to these
problems...
Cold Fusion is really getting on my nerves with this
issue...PimDor,
This should not be too hard to figure out. First, click on
the system information link in cfadmin. Check the classpath and
make sure your jar file is there for each cfx. Next, unzip the jar
file using winzip or similar. Just view the main classname and note
its capitalization. Java is case sensitive so when you enter the
java cfx classname it must be spelled correctly. Also, if it is
part of a package you must enter that using dot notation. So, if I
have a CFX_ken that uses Kenco.class in package com.adobe.ken I
enter the classname in cfadmin as: com.adobe.ken.Kenco . Note the
capital K in Kenco. If this package were in ken.jar, I should be
able to find ken.jar listed in the classpath on the sysinfo page.
Finally, as a test you should be able to do a cfobject/java
call and dump the class to confirm the class is available. So
following the above example see the attached code. The cfdump
should show the methods of your cfx class. -
Standard Java RMI and WLS5.1?
I would surmise that the problem you are seeing is the result of the fact
that we do not except standard Java RMI calls using the functionality in the
JDK. You must use the WebLogic implementation of RMI. It is exactly the
same in terms of APIs, but we have gone through and optimize the underlying
protocol.
Please see the documentation for more details.
We offer both RMI over IIOP and RMI over T3.
Thanks,
Michael
Michael Girdley
Product Manager, WebLogic Server & Express
BEA Systems Inc
Mario Felarca <[email protected]> wrote in message
news:[email protected]..
Hello,
I was trying to get a simple callback demo working using standard java
RMI and the WLS5.1. Unfortunately, although things seemed to compile
and launch smoothly, when the client started up and tried to talk to the
WLS I would get the following error:
weblogic.rmi.server.ExportException: A description for CallbackImpl was
found but it could not be read due to: [Failed to find a stub for [class
CallbackImpl] implements at least one interface [interface Callback]
which extends Remote.]
weblogic.rmi.StubNotFoundException: Failed to find a stub for [class
CallbackImpl] implements at least one interface [interface Callback]
which extends Remote.
I tried determining if this was a classpath problem, but all my efforts
kept producing this result.
On the flip side, if I retool my objects slightly in order to make them
use weblogic.rmi.*, then everything works perfectly.
Is there a tradeoff to using weblogic.rmi over java.rmi?
Also, does anyone have any ideas as to what might be causing my error
when using standard rmi?
Thanks so much in advance,
Mario- -
Exception in thread "main" java.lang.NoClassDefFoundError: ?classpath
I try to run a java program at the JRE. I type the following at the DOS prompt.
C:\j>java -classpath .\ldap.jar;. findAppList
I have put the ldap.jar and the findAppList.class in the current directory. Also I am sure that the ldap.jar is the only jar file required. So the setting for the classpath variable should be correct. However I still get the following error:
Exception in thread "main" java.lang.NoClassDefFoundError: ?classpath
Anyone can tell me what is wrong? Thanks.The command-line parameter is "-cp", not "-classpath". Type java -? for list of parameters.
-
Java compile and run time questions
Hello, I have two generic question about java compile and run:
1. When I used javac to compile my project, it complained some classes can't be found. I added the jar file which contains these needed classes to the jre/lib/ext/ directory. The compiler no longer complains. But I'm confused. I thought the jar files in jre/lib/ext/ only used for java run time, not the compile time. Can someone help me to explain this?
2. If I need certain user defined jar file in the classpath to compile my application, does that imply that I have to have that jar file if I want to run my project?
Thanks in advance.1. lib/ext is used for generally finding classes, it doesn't matter whether you are compiling or running.
2. Yes, you will. -
Java Importer and UNIX app server
Setup: win2000, forms6i, jdk1.2.2
I have successfully imported a java class (simple one just to give a string message out) on my pc, now I want to move the form to unix app server.
I installed jdk1.2.2 on unix box in oracle app server account, made sure the path includes jdk1.2.2 path, added classpath variable to include importer.jar and my jar file.
when the form is executed, It fails with "JAVA error"; no further explanation. I have coded exception block to trap java exception and display error.
Any other setup required? Do I need to restart app server?
Any suggestions please.
Thanks
Abhay1) I am currently using 9iAS version 9.0.2.2.0 (Forms version (9.0.2.11.0). Will this version reuse a single JVM or create one for every user?
2) I am trying to implement a form with imported Java. I get an exception. I have tried the ORA_JAVA exception and error handling as indicated in the Forms Developer help (importing java.lang.exception) but it does not help. Stepping through the code I see that the generated JNI.GET_CLASS call fails for both my custom class and Exception_. Does this mean the JVM cannot be created? In my default.env file I have added my jar file to the classpath and the path already contained the jre/bin/classic directory. I saw a post about conflicts between the Forms and Reports classpath but I have not called reports when I run into this problem.
Maybe you are looking for
-
How do i get iphone backup files to show in itunes?
Hi. Ive recently had to start using another computer due to a component failure, and as a result managed to wiped my iphone of its original contents during an update on the 'new' computer. I have my old hard drive connected to this computer via a doc
-
Toslink/AC3 Optical Audio Out Docking Station???
Is there such a thing that docks iPod at the base and send digital audio signal to a receiver/preamp? I realize you can do this using RCA cable but D/A conversion is done in iPod rather than in home hi-fi. I searched a bit in this forum and came to u
-
Can't install adobe flash??
I am trying to download flash becuase I wasn't able to watch videos, but every time it goes to install it stops at 7% and says "connection lost, trying to reconnect" and it won't install. I have tried so many times and have un-installed it but that d
-
Change of subscriber package to SCE2020
When we provision a subscriber to an SCE package with rules to redirect HTTP flows, then this redirection is not available right away, but only after about 10 seconds have passed. Before the redirection gets enabled, the HTTP requests just get blocke
-
Hello, I have data stored in the database like this in two columns FROM_URL and TO_URL FROM_URL ---- TO_URL start ---- a.html a.html ---- b.html b.html ---- c.html start ---- k.html k.html ---- h.html h.html ---- f.html f.html ---- t.html start ----