- This topic has 5 replies, 3 voices, and was last updated 19 years, 9 months ago by
Riyad Kalla.
-
AuthorPosts
-
aerobioticMemberI have an existing application that has been deployed to TomCat 5.0.28 with the tomcat deployer ant tasks.
The application uses Tapestry and Spring framework.
When I try to load the first page I get the following exception:
**********************************************************
Tapestry unable to begin processing request.
Session id: null
Client address: 127.0.0.1Exceptions:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘discCachePath’ defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Initialization of bean failed; nested exception is javax.naming.NameNotFoundException: Name java:comp is not bound in this Context
beanName: discCachePath
resourceDescription: ServletContext resource [/WEB-INF/applicationContext.xml]javax.naming.NameNotFoundException: Name java:comp is not bound in this Context
org.apache.naming.NamingContext.lookup(NamingContext.java:764)
org.apache.naming.NamingContext.lookup(NamingContext.java:147)
javax.naming.InitialContext.lookup(InitialContext.java:347)
org.springframework.jndi.JndiTemplate$1.doInContext(JndiTemplate.java:123)
org.springframework.jndi.JndiTemplate.execute(JndiTemplate.java:85)
org.springframework.jndi.JndiTemplate.lookup(JndiTemplate.java:121)
org.springframework.jndi.JndiLocatorSupport.lookup(JndiLocatorSupport.java:71)
org.springframework.jndi.JndiObjectLocator.lookup(JndiObjectLocator.java:85)
org.springframework.jndi.JndiObjectFactoryBean.afterPropertiesSet(JndiObjectFactoryBean.java:124)
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:962)
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:354)
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:223)
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:147)
org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:271)
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:312)
org.springframework.web.context.support.AbstractRefreshableWebApplicationContext.refresh(AbstractRefreshableWebApplicationContext.java:134)
org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:230)
org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:156)
o
o
oThe value that it’s trying to find is a JNDI value that was configured in the META-INF/context.xml file. This file contains the environment valriable that’s being looked up and datasources for my application.
I setup another TomCat 5.0.28 server in another directory started it and deployed to it with the ant deployer. The application runs fine.
I noticed one difference. The META-INF/context.xml file gets copied my Tomcat to the jakarta-tomcat-5.0.28\conf\Catalina\localhost directory. It name is changed to DrummondChocolatesIntranet.xml. DrummondChocolatesIntranet is the name of my context.
Does MyEclipseIde support META-INF/context.xml? If not, how can I get my JNDI settings established in your TomCat runner?
I tried copying context.xml to to conf\Catalina\localhost\DrummondChocolatesIntranet.xml that didn’t help.
Riyad KallaMemberJay,
Why are you using the Tomcat ant tasks to deploy the app and not just using an exploded deployment from MyEclipse?It isn’t an issue of MyEclipse supporting the context.xml file or not, that is an app-server feature. If you have a META-INF/context file, and deploy your app to Tomcat, tomcat SHOULD honor that file and do what you saw (move it to the conf dir and rename it).
aerobioticMemberGuess it is hard to understand….sorry about that.
What I intended to say was, that when ANT deploy is used, it works.
When the deployer that’s built into MyEcplise is used, it doesn’t.
When MyExclipse is used to deploy, the application shows up in the webapps directory. No DrummondChocolatesIntranet.xml file appears in the conf/Catalina/localhosts directory. I get the NameNotFoundException mentioned below.
Riyad KallaMemberHmm I see, keeping in mind that this context file only ever needs to be deployed once, so this shouldn’t keep you from working, but try this:
1) Shut down app server
2) Deploy your app using MyEclipse
3) Start up Tomcat, when it loads the context it *should* recognize the file. But I know in the past Tomcat honoring the context.xml file has been a shaky issue.If I were you I would just manually deploy the file and call it a day and never do it again 🙂
ygenestMemberI have the same issue. But copy the file manually to CATALINA/Conf is not an option since I want to deploy my apps on a hosted Tomacat Virtual Server for which I don’t have access to the /conf directory. Could you please take a look at this, the contect.xml file in META-INF does not get renamed/deployed by MyEclipse.
Riyad KallaMemberyg,
the contect.xml file in META-INF does not get renamed/deployed by MyEclipse.
It isn’t suppose to, it is up to Tomcat to do this if it sees a META-INF/context.xml file in a freshly deployed app.
-
AuthorPosts