[jboss-user] [JBoss Seam] - Contexts.getApplicationContext() loses Components
Lundegaard
do-not-reply at jboss.com
Mon Apr 2 15:16:05 EDT 2007
Hello,
I am using Seam CVS 20070402 with Tomcat 5.5.23 and the following configuration files.
The problem is that in Lifecycle.endInitialization() Contexts.getApplicationContext() doesn't return all installed components, resp. when starting up the EntityManagerFactory the dependent Microcontainer-component isn't found and I get the following exception:
javax.naming.NamingException: Local server is not initialized
When I remove at least one in META-INF/components.xml the EntityManagerFactory starts up fine.
After increasing the initial capacity of org.jboss.seam.init.Initialization#properties the startup worked with all components in my components.xml.
WEB-INF/components.xml
| <?xml version="1.0" encoding="UTF-8"?>
| <components
| xmlns="http://jboss.com/products/seam/components"
| xmlns:core="http://jboss.com/products/seam/core"
| xmlns:security="http://jboss.com/products/seam/security"
| xmlns:drools="http://jboss.com/products/seam/drools"
| xmlns:web="http://jboss.com/products/seam/web"
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
| xmlns:mail="http://jboss.com/products/seam/mail"
| xsi:schemaLocation="
| http://jboss.com/products/seam/core
| http://jboss.com/products/seam/core-1.2.xsd
| http://jboss.com/products/seam/components
| http://jboss.com/products/seam/components-1.2.xsd
| http://jboss.com/products/seam/security
| http://jboss.com/products/seam/security-1.2.xsd
| http://jboss.com/products/seam/web
| http://jboss.com/products/seam/web-1.2.xsd
| http://jboss.com/products/seam/drools
| http://jboss.com/products/seam/drools-1.2.xsd">
|
| <core:init jndi-pattern="#{ejbName}/local" debug="true" />
| <core:ejb installed="true" />
| <core:dispatcher />
|
| <core:entity-manager-factory persistence-unit-name="prozessbenchmarkPersistenceUnit" name="entityManagerFactory" />
| <core:managed-persistence-context name="entityManager" auto-create="true" entity-manager-factory="#{entityManagerFactory}" />
|
| <core:manager
| conversation-timeout="120000"
| concurrent-request-timeout="500"
| conversation-id-parameter="cid"
| conversation-is-long-running-parameter="clr" />
|
| <core:locale-selector cookie-enabled="true"/>
|
| <mail:mail-session host="cf.mediawave.de" />
|
| <web:multipart-filter create-temp-files="true" max-request-size="1000000" url-pattern="*.html" />
| <!-- <web:context-filter url-pattern="/content/*" /> -->
|
| <drools:rule-base name="securityRules">
| <drools:rule-files>
| <value>/META-INF/security-rules.drl</value>
| </drools:rule-files>
| </drools:rule-base>
|
| <security:rule-based-identity authenticate-method="#{authenticator.authenticate}" />
|
| <event type="org.jboss.seam.notLoggedIn">
| <action expression="#{redirect.captureCurrentView}" />
| </event>
|
| <event type="org.jboss.seam.postAuthenticate">
| <action expression="#{redirect.returnToCapturedView}" />
| </event>
|
| </components>
|
META-INF/components.xml
| <?xml version="1.0" encoding="UTF-8"?>
| <components xmlns="http://jboss.com/products/seam/components" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
| xsi:schemaLocation="
| http://jboss.com/products/seam/components
| http://jboss.com/products/seam/components-1.2.xsd">
|
| <!-- Action -->
| <component name="authenticator" class="com.example.action.Authenticator" scope="conversation" auto-create="true" />
| <component name="mailAction" class="com.example.action.MailAction" scope="conversation" auto-create="true" />
| <component name="userAction" class="com.example.action.UserAction" scope="conversation" auto-create="true" />
| <component name="userBranchAction" class="com.example.action.UserBranchAction" scope="conversation" auto-create="true" />
| <component name="userQuestionnaireAction" class="com.example.questionnaire.action.UserQuestionnaireAction" scope="conversation" auto-create="true" />
| <component name="exportAction" class="com.example.action.ExportAction" scope="conversation" auto-create="true" />
|
| <!-- Util -->
| <component name="configuration" class="com.example.util.Configuration" scope="application" auto-create="true">
| <property name="path">${configuration.path}</property>
| <property name="url">${configuration.url}</property>
| </component>
|
| <!-- Entity -->
| <component name="user" class="com.example.entity.User" scope="conversation" auto-create="true" />
|
| <!-- DAO -->
| <component name="userDao" class="com.example.dao.UserDao" scope="stateless" auto-create="true" />
| <component name="userBranchDao" class="com.example.dao.UserBranchDao" scope="stateless" auto-create="true" />
| <component name="roleDao" class="com.example.dao.RoleDao" scope="stateless" auto-create="true" />
| <component name="questionnaireDao" class="com.example.questionnaire.dao.QuestionnaireDao" scope="stateless" auto-create="true" />
| <component name="questionDao" class="com.example.questionnaire.dao.QuestionDao" scope="stateless" auto-create="true" />
| <component name="answerDao" class="com.example.questionnaire.dao.AnswerDao" scope="stateless" auto-create="true" />
| <component name="userQuestionnaireDao" class="com.example.questionnaire.dao.UserQuestionnaireDao" scope="stateless" auto-create="true" />
| <component name="userQuestionDao" class="com.example.questionnaire.dao.UserQuestionDao" scope="stateless" auto-create="true" />
| <component name="userAnswerDao" class="com.example.questionnaire.dao.UserAnswerDao" scope="stateless" auto-create="true" />
|
| <!-- Framework -->
| <component name="questionnaireHome" class="com.example.questionnaire.home.QuestionnaireHome" scope="conversation">
| <property name="entityClass">com.example.questionnaire.entity.Questionnaire</property>
| </component>
| <component name="questionHome" class="com.example.questionnaire.home.QuestionHome" scope="conversation">
| <property name="entityClass">com.example.questionnaire.entity.Question</property>
| </component>
| <component name="answerHome" class="com.example.questionnaire.home.AnswerHome" scope="conversation">
| <property name="entityClass">com.example.questionnaire.entity.Answer</property>
| </component>
|
| </components>
|
After reading http://wiki.jboss.org/wiki/Wiki.jsp?page=HelpBugReport I wasn't certain enough if this is worth a Bug report.
Regards,
Thomas
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4033797#4033797
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4033797
More information about the jboss-user
mailing list