CayenneRuntimeException sometimes appears with many domains
-----------------------------------------------------------
Key: CAY-1262
URL: https://issues.apache.org/jira/browse/CAY-1262
Project: Cayenne
Issue Type: Bug
Components: Cayenne Core Library
Affects Versions: 2.0 branch
Environment: Linux Ubuntu 9.04 64 bits
java version "1.5.0_18" 64 bits
jboss-portal 2.7.2
Using struts 2 and portlet
(org.apache.struts2.portlet.dispatcher.Jsr168Dispatcher).
IDE Eclipse Gallileo 20090621-0832
Compile with maven
Few Mysql DB
Reporter: Pumpkin
I have a strange behavior when I use many domains in Cayenne.
If I :
- start my PC, with a clean jboss-portal
- build my war (maven)
- deploy my war containing the portlet-struts-cayenne build
... the following exception appears when some queries are executed in the code,
after the cayenne trace (and sometimes, for each page loaded)
15:28:23,491 ERROR [[default]] Servlet.service() for servlet default threw
exception
org.apache.cayenne.CayenneRuntimeException: [v.2.0.4 October 8 2007] More than
one domain is configured; use 'getDomain(String name)' instead.
at
org.apache.cayenne.conf.Configuration.getDomain(Configuration.java:448)
at
org.apache.cayenne.access.DataContext.createDataContext(DataContext.java:206)
at
org.apache.cayenne.conf.ServletUtil.getSessionContext(ServletUtil.java:124)
at
org.apache.cayenne.conf.WebApplicationContextFilter.doFilter(WebApplicationContextFilter.java:86)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at
org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:182)
at
org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at
org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
at java.lang.Thread.run(Thread.java:595)
I can use ...conf.getDomain("myDomain")... method, the same exception appears.
Now, If I :
- edit my cayenne.xml
- comment one of both domain
- build my project
- deploy them
The exception doesn't appear.
The strange is : If i
- edit again cayenne.xml
- uncomment the previous commented domain
- build and deploy the war
The exception doesn't appear !
And doesn't appear anymore if I don't restart my PC.
I can stop the jboss-portal server: clean it (remove work, temp, data etc..),
close my shell, open a new shell etc... the problem doesn't appears anymore.
During the exception, all queries are correctly done (at the moment !?).
In the pom.xml :
<dependency>
<groupId>org.apache.cayenne</groupId>
<artifactId>cayenne</artifactId>
<version>2.0.4</version>
</dependency>
In web.xml
<filter>
<filter-name>CayenneFilter</filter-name>
<filter-class>org.apache.cayenne.conf.WebApplicationContextFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>CayenneFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<context-param>
<param-name>cayenne.configuration.path</param-name>
<param-value>/WEB-INF/cayenne</param-value>
</context-param>
Finally, this warning appears too, and always (for each queries, after the
cayenne trace) :
16:08:13,538 WARN [TextProviderHelper] The first TextProvider in the
ValueStack (my.package.MyStruts2ActionClass) could not locate the message
resource with key 'Filtrer'
16:08:13,538 WARN [TextProviderHelper] The default value expression 'Filtrer'
was evaluated and did not match a property. The literal value 'Filtrer' will
be used.
16:08:13,555 WARN [TextProviderHelper] The first TextProvider in the
ValueStack (my.package.MyStruts2ActionClass) could not locate the message
resource with key 'Filtrer'
16:08:13,555 WARN [TextProviderHelper] The default value expression 'Filtrer'
was evaluated and did not match a property. The literal value 'Filtrer' will
be used.
I will do more tests.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.