[JBoss Seam] - Re: Seam and Hibernate-all.jar
by jimk1723
This seems related to my issue; I'm trying to upgrade the Hibernate Annotations to use the @SQLInsert annotations. I replaced hibernate-all.jar with the new jars you listed, but I'm now getting an exception when I try and run my unit tests:
| [testng] javax.persistence.PersistenceException: org.hibernate.HibernateException: The chosen transaction strategy requires access to the JTA TransactionManager
| [testng] at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:737)
| [testng] at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:121)
| [testng] at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:51)
| [testng] at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:33)
| [testng] at com.tmcs.attraction.AttractionGenreTest.testHibernateExtensions(AttractionGenreTest.java:14)
| [testng] Caused by: org.hibernate.HibernateException: The chosen transaction strategy requires access to the JTA TransactionManager
| [testng] at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:329)
| [testng] at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1294)
| [testng] at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:915)
| [testng] at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:730)
| [testng] ... 26 more
| [testng] ... Removed 22 stack frames
|
Anyone know where this is coming from?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4059325#4059325
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4059325
17Â years, 5Â months
[JBoss Seam] - Re: Problems using multiple datasources
by dustismo
Gavin,
Thanks for pointing me in the right direction (I would have never figured this out otherwise)..
For anyone else out there with the same problem.. I solved it by changing local-tx-datasource to xa-datasource in DataSource-dev.xml
example:
| <xa-datasource>
| <jndi-name>MainDatasource</jndi-name>
| <xa-datasource-class>com.mysql.jdbc.jdbc2.optional.MysqlXADataSource</xa-datasource-class>
| <xa-datasource-property name="URL">jdbc:mysql://xxx.xxx.xx</xa-datasource-property>
|
| <user-name>xxxxxxxx</user-name>
| <password>xxxxxxxx</password>
| <transaction-isolation>TRANSACTION_READ_COMMITTED</transaction-isolation>
|
| <!-- This disables transaction interleaving (which BTW, most DB vendors don't support) -->
| <track-connection-by-tx/>
| <isSameRM-override-value>false</isSameRM-override-value>
|
| <!--pooling parameters-->
| <min-pool-size>5</min-pool-size>
| <max-pool-size>20</max-pool-size>
| <blocking-timeout-millis>5000</blocking-timeout-millis>
| <idle-timeout-minutes>15</idle-timeout-minutes>
|
| <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.MySQLExceptionSorter</exception-sorter-class-name>
| <metadata>
| <type-mapping>mySQL</type-mapping>
| </metadata>
| </xa-datasource>
|
|
-Dustin
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4059324#4059324
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4059324
17Â years, 5Â months
[JBoss Seam] - Re: Seam 1.3.0.ALPHA entity converter: The instance was not
by jamathison
Hi Pete,
Thanks for the quick reply. I am using SMPCs, and I made all the config changes specified in the Seam 2.0 Migration Guide in Fisheye.
Aren't all requests wrapped in a temporary conversation? At any rate, I am inside a long running conversation. Originally, I was making the itemTextDAO.getTutorialCategories call from inside a SFSB with ScopeType.CONVERSATION and outjecting it. Then I made it a member (with a get/set) of that same SFSB instead of outjecting. All with the same outcome.
Here's the entity query in a conversation scoped SFSB:
| @Stateful
| @Name("tutorialEditAction")
| @Scope(ScopeType.CONVERSATION)
| public class EditActionBean implements EditAction, Serializable {
|
| @PersistenceContext(type=PersistenceContextType.EXTENDED)
| private EntityManager entityManager;
|
| @Logger
| private Log log;
|
| private List<ItemText> tutorialCategories;
|
|
| @Create @Begin(join=true)
| public String create() {
| return "created";
| }
|
| @Begin(join=true)
| public String begin() {
| log.info ("Inside tutorialEditAction.begin");
| return "begin";
| }
|
| public List<ItemText> getTutorialCategories() {
| log.info ("Begin tutorialEditAction.getTutorialCategories()");
| if (this.tutorialCategories == null) {
| try {
| Query query = entityManager.createQuery (
| "select it from ItemText it where it.itemCode.itemCodeType.name=:name and it.locale=:locale order by it.text asc");
| query.setParameter ("name", ItemCodeType.ItemCodeTypeEnum.TUTORIAL_CATEGORY);
| query.setParameter ("locale", Locale.US.toString());
| this.tutorialCategories = (List<ItemText>) query.getResultList();
|
| } catch (NoResultException ex) {
| this.tutorialCategories = new ArrayList<ItemText>(0);
| }
|
| }
| log.info ("End tutorialEditAction.getTutorialCategories()");
| return this.tutorialCategories;
| }
| public String getCategory() {
| return "Application";
| }
| public void setCategory(String value) {
| }
| @End
| public String save() {
| log.info("Inside tutorialEditAction.save()");
| return "saved";
| }
|
| @Destroy @Remove
| public void destroy() {}
|
| }
|
|
And my xhtml fragment:
| <ui:composition xmlns="http://www.w3.org/1999/xhtml"
| xmlns:s="http://jboss.com/products/seam/taglib"
| xmlns:f="http://java.sun.com/jsf/core"
| xmlns:h="http://java.sun.com/jsf/html"
| xmlns:ui="http://java.sun.com/jsf/facelets">
|
|
| <h:form id='tutorialEditForm'>
| <h:selectOneMenu value="#{tutorialEditAction.category}">
| <s:convertEntity />
| <s:selectItems value="#{tutorialEditAction.tutorialCategories}"
| var="category"
| label="#{category.text}"
| noSelectionLabel="-- Select --" >
| </s:selectItems>
| </h:selectOneMenu>
| </h:form>
|
| </ui:composition>
|
|
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:drools="http://jboss.com/products/seam/drools"
| xmlns:jms="http://jboss.com/products/seam/jms"
| xmlns:persistence="http://jboss.com/products/seam/persistence"
| xmlns:security="http://jboss.com/products/seam/security"
| xmlns:web="http://jboss.com/products/seam/web"
| xmlns:theme="http://jboss.com/products/seam/theme"
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
| xsi:schemaLocation=
| "http://jboss.com/products/seam/core http://jboss.com/products/seam/core-2.0.xsd
| http://jboss.com/products/seam/drools http://jboss.com/products/seam/drools-2.0.xsd
| http://jboss.com/products/seam/jms http://jboss.com/products/seam/jms-2.0.xsd
| http://jboss.com/products/seam/persistence http://jboss.com/products/seam/persistence-2.0.xsd
| http://jboss.com/products/seam/security http://jboss.com/products/seam/security-2.0.xsd
| http://jboss.com/products/seam/web http://jboss.com/products/seam/web-2.0.xsd
| http://jboss.com/products/seam/theme http://jboss.com/products/seam/theme-2.0.xsd
| http://jboss.com/products/seam/components http://jboss.com/products/seam/components-2.0.xsd">
|
| <core:init debug="true" jndi-pattern="PhoneScout/#{ejbName}/local"/>
|
| <core:manager concurrent-request-timeout="500" conversation-timeout="71000000" conversation-id-parameter="cid"/>
|
| <persistence:managed-persistence-context name="entityManager" auto-create="true"
| persistence-unit-jndi-name="java:/phoneScoutEntityManagerFactory"/>
|
| <security:identity authenticate-method="#{authenticateAction.authenticate}"/>
|
| <web:context-filter url-pattern="*.ajax" />
|
| <jms:managed-topic-publisher name="sharedDeviceTopic" auto-create="true" topic-jndi-name="topic/sharedDeviceTopic"/>
|
| <component class="org.jboss.seam.remoting.messaging.SubscriptionRegistry" installed="true">
| <property name="allowedTopics">sharedDeviceTopic</property>
| </component>
|
| <event type="org.jboss.seam.notLoggedIn">
| <action expression="#{redirect.captureCurrentView}"/>
| </event>
| <event type="org.jboss.seam.postAuthenticate">
| <action expression="#{redirect.returnToCapturedView}"/>
| </event>
|
| <factory name='cmpContextRoot' value='#{facesContext.externalContext.request.contextPath}' />
| <factory name='cmpDevicesSubdir' value='#{"/devices"}' />
| <factory name='cmpGraphsSubdir' value='#{cmpDevicesSubdir}/#{deviceHome.id}/graphs' />
| <factory name="cmpDevicesRoot" value="#{cmpContextRoot}/devices"/>
| <factory name='cmpDeviceRoot' value='#{cmpDevicesRoot}/#{deviceHome.id}' />
| <factory name="cmpGraphRoot" value="#{cmpDeviceRoot}/graphs"/>
| <factory name='cmp360Subdir' value='/devices/#{deviceHome.id}/#{empty param.viewof ? "front" : param.viewof}' />
| <factory name='cmp360Root' value='#{cmpContextRoot}#{cmp360Subdir}' />
|
| </components>
|
|
The full stack trace:
| org.hibernate.TransientObjectException: The instance was not associated with this session
| at org.hibernate.impl.SessionImpl.getIdentifier(SessionImpl.java:1375)
| at org.hibernate.search.impl.FullTextSessionImpl.getIdentifier(FullTextSessionImpl.java:331)
| at org.jboss.seam.persistence.HibernateSessionProxy.getIdentifier(HibernateSessionProxy.java:205)
| at org.jboss.seam.persistence.HibernatePersistenceProvider.getId(HibernatePersistenceProvider.java:114)
| at org.jboss.seam.framework.EntityIdentifier.<init>(EntityIdentifier.java:15)
| at org.jboss.seam.ui.converter.EntityConverterStore.put(EntityConverterStore.java:60)
| at org.jboss.seam.ui.converter.EntityConverter.getAsString(EntityConverter.java:69)
| at org.jboss.seam.ui.converter.PrioritizableConverter.getAsString(PrioritizableConverter.java:67)
| at org.jboss.seam.ui.converter.ConverterChain.getAsString(ConverterChain.java:123)
| at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.getFormattedValue(HtmlBasicRenderer.java:469)
| at com.sun.faces.renderkit.html_basic.MenuRenderer.renderOption(MenuRenderer.java:502)
| at com.sun.faces.renderkit.html_basic.MenuRenderer.renderOptions(MenuRenderer.java:757)
| at com.sun.faces.renderkit.html_basic.MenuRenderer.renderSelect(MenuRenderer.java:811)
| at com.sun.faces.renderkit.html_basic.MenuRenderer.encodeEnd(MenuRenderer.java:335)
| at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:833)
| at javax.faces.component.UIComponent.encodeAll(UIComponent.java:896)
| at javax.faces.render.Renderer.encodeChildren(Renderer.java:137)
| at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:809)
| at javax.faces.component.UIComponent.encodeAll(UIComponent.java:886)
| at javax.faces.component.UIComponent.encodeAll(UIComponent.java:892)
| at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:577)
| at org.ajax4jsf.framework.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:108)
| at org.ajax4jsf.framework.ajax.AjaxViewHandler.renderView(AjaxViewHandler.java:233)
| at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:106)
| at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
| at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144)
| at javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
| at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
| at org.jboss.seam.debug.hot.HotDeployFilter.doFilter(HotDeployFilter.java:63)
| at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
| at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:73)
| at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:87)
| at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
| at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:63)
| at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
| at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:46)
| at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
| at org.ajax4jsf.framework.ajax.xmlfilter.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:127)
| at org.ajax4jsf.framework.ajax.xmlfilter.BaseFilter.doFilter(BaseFilter.java:277)
| at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:40)
| at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
| at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:140)
| 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:179)
| at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
| at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
| at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
| at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
| at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
| at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:241)
| at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
| at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:580)
| at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
| at java.lang.Thread.run(Thread.java:595)
|
Not sure how to proceed to debug the problem,
Thanks,
Al
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4059318#4059318
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4059318
17Â years, 5Â months
[JBoss Seam] - Restore View and HTTPSession Timeout
by chane
I have a generic search screen (standard input form) that displays the results on the "next" page using a . The ScopeType.EVENT is used on the SFSB.
If the user hits the refresh button any time prior to the HTTPSession timeout, then the form is resubmitted and the search generated again (could display different results if the underlying data has been updated - which is what we want to happen).
If the user leaves (for a time greater than the HTTPSession timeout) the results screen, comes back and hits the refresh button after the timeout, the "Find" screen is displayed again.
I am using Trinidad 1.0, Myfaces 1.1, Jboss 4.0.x, Seam 1.2p1 with client side state saving.
One of the first errors in the log is:
2007-06-29 15:35:17,593 ERROR [STDERR] Jun 29, 2007 3:35:17 PM org.apache.myfaces.trinidadinternal.application.StateManagerImpl restoreView SEVERE: Could not find saved view state for token 7cad43c0
Which is why I'm assuming it is the HTTPSession timeout and probably a JSF question rather than a Seam question, however, I was hoping someone else had run into this and had a workaround.
Is there anything I can do so that the browser "refresh" will re-run the search and not show the Find screen?
Thanks,
Chris....
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4059316#4059316
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4059316
17Â years, 5Â months