[JBoss Messaging] - Error : Cannot create timer table
by tedyw
Hi, all
I'm configuring jboss cluster with jboss4.2.2GA,Sybase.To fulfill HAJMS,I replace jbossMQ with jbossMessaging,but get error : Cannot create timer table.Could somebody help me ??
The error below:
18:09:53,538 INFO [ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=DataSourceBinding,name=DefaultDS' to JNDI name 'java:DefaultDS'
18:09:53,575 ERROR [GeneralPurposeDatabasePersistencePlugin] Cannot create timer table
java.lang.IllegalStateException: Cannot obtain type mapping from: jboss.jdbc:datasource=DefaultDS,service=metadata
at org.jboss.ejb.txtimer.GeneralPurposeDatabasePersistencePlugin.createTableIfNotExists(GeneralPurposeDatabasePersistencePlugin.java:137)
at org.jboss.ejb.txtimer.DatabasePersistencePolicy.startService(DatabasePersistencePolicy.java:104)
at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
at $Proxy0.start(Unknown Source)
at org.jboss.system.ServiceController.start(ServiceController.java:417)
at org.jboss.system.ServiceController.start(ServiceController.java:435)
at org.jboss.system.ServiceController.start(ServiceController.java:435)
at org.jboss.system.ServiceController.start(ServiceController.java:435)
at org.jboss.system.ServiceController.start(ServiceController.java:435)
at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
at $Proxy4.start(Unknown Source)
at org.jboss.deployment.SARDeployer.start(SARDeployer.java:302)
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:585)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
at $Proxy51.start(Unknown Source)
at org.jboss.deployment.XSLSubDeployer.start(XSLSubDeployer.java:197)
at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1025)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
at sun.reflect.GeneratedMethodAccessor29.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
at $Proxy63.deploy(Unknown Source)
at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:421)
at org.jboss.ha.framework.server.FarmMemberService.deploy(FarmMemberService.java:412)
at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:634)
at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:263)
at org.jboss.ha.framework.server.FarmMemberService.startService(FarmMemberService.java:212)
at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
at $Proxy0.start(Unknown Source)
at org.jboss.system.ServiceController.start(ServiceController.java:417)
at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
at $Proxy4.start(Unknown Source)
at org.jboss.deployment.SARDeployer.start(SARDeployer.java:302)
at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1025)
at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1015)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
at sun.reflect.GeneratedMethodAccessor29.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
at $Proxy9.deploy(Unknown Source)
at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:421)
at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:634)
at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:263)
at org.jboss.deployment.scanner.AbstractDeploymentScanner.startService(AbstractDeploymentScanner.java:336)
at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
at $Proxy0.start(Unknown Source)
at org.jboss.system.ServiceController.start(ServiceController.java:417)
at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
at $Proxy4.start(Unknown Source)
at org.jboss.deployment.SARDeployer.start(SARDeployer.java:302)
at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1025)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:766)
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:585)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
at $Proxy5.deploy(Unknown Source)
at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:482)
at org.jboss.system.server.ServerImpl.start(ServerImpl.java:362)
at org.jboss.Main.boot(Main.java:200)
at org.jboss.Main$1.run(Main.java:508)
at java.lang.Thread.run(Thread.java:595)
Below is Sybase config:
<local-tx-datasource>
<jndi-name>DefaultDS</jndi-name>
<connection-url>jdbc:sybase:Tds:192.168.200.139:4100/CIS</connection-url>
<driver-class>com.sybase.jdbc2.jdbc.SybDriver</driver-class>
<user-name>tedyw</user-name>
synnex
<min-pool-size>20</min-pool-size>
<max-pool-size>80</max-pool-size>
<blocking-timeout-millis>10000</blocking-timeout-millis>
<idle-timeout-minutes>15</idle-timeout-minutes>
<check-valid-connection-sql>if db_name()='CIS' select @@error else exec ('select * from false_table')</check-valid-connection-s
ql>
<exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.SybaseExceptionSorter</exception-sorter-class-name>
<connection-property name="JCONNECT_VERSION">6</connection-property>
<type-mapping>sysbase</type-mapping>
</local-tx-datasource>
Thanks.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4119888#4119888
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4119888
18 years, 5 months
[JBoss Seam] - null pointer exception with fileUpload
by vlaugier
Hello,
I am making a forum where people can upload files to be shared. I can't make file upload work whereas I am in a very classical environment :
seam 1.2.1 CP1
jboss eap 4.2.0
filename and bytearray are seen as null in the SFSB
I have seen some people having quite the same problem but none of the case corresponds to my problem.
it might be silly but ....i am stuck
here is the web page :
| <!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
| "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
| <ui:composition xmlns="http://www.w3.org/1999/xhtml"
| xmlns:s="http://jboss.com/products/seam/taglib"
| xmlns:ui="http://java.sun.com/jsf/facelets"
| xmlns:f="http://java.sun.com/jsf"
| xmlns:c="http://java.sun.com/jsf/core"
| xmlns:h="http://java.sun.com/jsf/html"
| xmlns:rich="http://richfaces.ajax4jsf.org/rich"
| xmlns:a="https://ajax4jsf.dev.java.net/ajax"
| template="layout/template.xhtml">
|
| <ui:define name="body">
|
| <h:form rendered="#{forum.id != 0}">
| <h:commandButton value="Previous element"
| action="#{forumManager.previousElement}" />
| <h:commandButton value="Next element"
| action="#{forumManager.nextElement}"/>
| </h:form>
|
| <h:form id="createService" styleClass="edit">
|
| <rich:panel>
| <c:facet name="header">Forum #{forum.id}</c:facet>
|
| <s:validateAll>
|
| <div class="input">
| <s:decorate template="layout/edit.xhtml">
| <ui:define name="label">Product name :</ui:define>
| <h:inputText id="login" size="50" value="#{forum.product.name}" required="true" rendered="#{user.context == 1}"/>
| <h:outputText id="loginOut" size="50" value="#{forum.product.name}" rendered="#{user.context == 0}"/>
| </s:decorate>
| </div>
|
| <div class="input">
| <s:decorate template="layout/edit.xhtml">
| <ui:define name="label">Deal Id :</ui:define>
| <h:inputText size="50" value="#{forum.deal.id}" required="true" rendered="#{user.context == 1}"/>
| <h:outputText size="50" value="#{forum.deal.id}" rendered="#{user.context == 0}"/>
| </s:decorate>
| </div>
|
|
| </s:validateAll>
|
| <div style="clear:both"/>
|
| </rich:panel>
|
|
| <h:form enctype="multipart/form-data">
| <s:validateAll>
| <s:fileUpload data="#{forumManager.fileByteArray}" fileName="#{fileName}" />
|
| <h:commandButton action="#{forumManager.registerFile}" value="Upload file" styleClass="action"/>
| </s:validateAll>
| </h:form>
|
|
| <rich:tabPanel switchType="client">
| <rich:tab label="Discussion">
|
| <rich:panel>
| <c:facet name="header" >Previous messages</c:facet>
| <h:dataTable value="#{forum.messages}" var="potentialEditedMessage" >
|
| <h:column>
| <c:facet name="header">date</c:facet>
| <h:outputText value="#{potentialEditedMessage.submitTime}"/>
| </h:column>
|
| <h:column>
| <c:facet name="header">content</c:facet>
| <h:outputText>
| <s:formattedText value="#{potentialEditedMessage.content}"/>
| </h:outputText>
| </h:column>
|
| </h:dataTable>
|
|
| <div style="clear:both"/>
| </rich:panel>
|
| <a:outputPanel id="msgPreview">
|
| <rich:panel>
|
| <c:facet name="header" >Message preview</c:facet>
|
| <s:formattedText value="#{message.content}"/>
|
| <div style="clear:both"/>
|
| </rich:panel>
|
| </a:outputPanel>
|
|
|
| <a:outputPanel id="msgEditor">
|
| <h:form>
|
| <rich:panel>
| <c:facet name="header" ></c:facet>
|
| <h:inputTextarea id="text" value="#{message.content}" cols="100" rows="20"/>
|
| <div style="clear:both"/>
| </rich:panel>
|
| <h:commandButton value="Preview message">
| <a:support event="onclick" disableDefault="true" reRender="msgPreview" />
| </h:commandButton>
|
| <h:commandButton action="#{forumManager.registerMessage}" value="Submit message" styleClass="action"/>
|
| </h:form>
|
| </a:outputPanel>
|
| </rich:tab>
|
|
| <rich:tab label="Files">
|
| </rich:tab>
|
| </rich:tabPanel>
|
|
| </h:form>
| </ui:define>
| </ui:composition>
|
|
here is the SFSB : interesting part in blue
| package fr.helmet.bbpp.manager;
|
| import fr.helmet.bbpp.entity.Forum;
| import fr.helmet.bbpp.entity.Message;
| import java.util.List;
|
| import javax.ejb.Remove;
| import javax.ejb.Stateful;
| import javax.persistence.EntityManager;
| import org.jboss.seam.annotations.Destroy;
| import org.jboss.seam.annotations.Name;
| import fr.helmet.bbpp.entity.User;
| import java.io.FileOutputStream;
| import java.util.LinkedList;
| import org.jboss.seam.annotations.Begin;
| import org.jboss.seam.annotations.End;
| import org.jboss.seam.annotations.In;
| import org.jboss.seam.annotations.Out;
| import org.jboss.seam.core.FacesMessages;
| import org.jboss.seam.annotations.Logger;
| import org.jboss.seam.annotations.datamodel.DataModel;
| import org.jboss.seam.log.Log;
| import javax.persistence.Query;
|
| @Stateful
| @Name("forumManager")
| //(a)Scope(ScopeType.EVENT)
| public class ForumManagerBean implements ForumManager, java.io.Serializable {
|
| @Logger
| private Log logger ;
|
| @DataModel
| List<Forum> forums = new LinkedList<Forum>();
|
| @In(required=false)
| @Out(required=false)
| private Message message;
|
|
| private byte[] fileByteArray;
|
| @In(required=false)
| @Out(required=false)
| private String fileName;
|
|
| //@PersistenceContext
| //EntityManager em;
|
| @In EntityManager entityManager;
|
| @In(required=false)
| @Out(required=false)
| Forum forum ;
|
| @In(required=false)
| @Out(required=false)
| User user;
|
| @In FacesMessages facesMessages;
|
|
|
| @Remove @Destroy
| public void destroy() {
| // SystentityManager.out.println("Entree dans Destroy");
| }
|
|
| public void nextElement(){
|
| int i = user.getForums().indexOf(user.getForum());
| i++;
| if (i > user.getForums().size()-1) i=0;
|
| user.setForum(user.getForums().get(i));
| this.forum = entityManager.find(Forum.class,user.getForum().getId());
| }
|
| public void previousElement(){
|
| int i = user.getForums().indexOf(user.getForum());
| i--;
| if (i < 1) i = user.getForums().size()-1;
|
| user.setForum(user.getForums().get(i));
| this.forum = entityManager.find(Forum.class,user.getForum().getId());
| }
|
|
| public void registerFile() {
|
| logger.info("IN registerFile");
|
| System.out.println("name of file = " + this.fileName);
|
| //System.out.println("size of byte array = " + this.fileByteArray.length);
|
|
| String filePath = "/home/vlaugier/Developpement/UPLOADED_FILES/" + this.fileName;
| try {
| FileOutputStream file = new FileOutputStream(filePath) ;
| file.write(this.fileByteArray);
| } catch (Exception ex) {logger.fatal("could not save uploaded file");}
|
| }
|
|
| public void registerMessage()
| {
| this.message.setForum(this.forum);
| entityManager.merge(this.message);
|
| String queryString = "select m from Message m WHERE m.forum=?";
| Query query = entityManager.createQuery(queryString);
| query.setParameter(1,forum);
| this.forum.setMessages(query.getResultList());
|
| }
|
|
| @End
| public void registerForum(Forum forum )
| {
| // SystentityManager.out.println("enregistrement du forum " + forum );
| // SystentityManager.out.println("Parent du forum :" + forum .getParentForum());
| entityManager.persist(forum );
|
| FacesMessages.instance().add("Nouveau Forum enregistré dans le catalogue!") ;
| user.setContext(user.READING); // back to READING mode
| forum = null;
| }
|
|
| @End
| public String updateForum() {
| //System.out.println("mise ÃÂ jour");
| entityManager.merge(forum );
|
| user.setContext(user.READING); // back to READING mode
| FacesMessages.instance().add("Forum successfully updated !") ;
|
| return null;
| }
|
|
| @Begin(join=true)
| public String viewForum(Forum serv) {
|
| this.forum = serv;
|
| user.setContext(user.READING);
|
| //facesMessages.add("editAccount " + this.client.getAccount().getFullname());
| //this.account = client.getAccount();
| return "createProduct";
| }
|
|
| @Begin(join=true)
| public void editForum(Forum serv){
|
| this.forum = serv;
|
| user.setContext(user.WRITING);
|
| }
|
|
| @Begin(join=true)
| public String startCreateForum() {
|
| user.setContext(user.WRITING);
|
| return "createProduct" ;
| }
|
| public List<Forum> getForums()
| {
| return forums;
| }
|
| public void setForums(List<Forum> forums)
| {
| this.forums=forums;
| }
|
|
| public Forum getForum() {
| return forum;
| }
|
|
| @Begin(join=true)
| public String defineFromUserForum() {
| try {
| this.forum = entityManager.find(Forum.class,user.getForum().getId());
| }catch (Exception ex) {facesMessages.add("You have no element selected for this page yet");}
| return "createForum";
| }
|
| @Begin(join=true)
| public String defineFromUserForums() {
| //logger.info(user.getForums().size());
| this.forums = new LinkedList<Forum>();
| try {
| for (Forum frm : user.getForums()) {
| this.forums.add ( entityManager.find(Forum.class,frm.getId()) ) ;
| }
| this.forum = this.forums.get(0);
| } catch (Exception ex) {facesMessages.add("You have no element selected for this page yet");}
| return "createForum";
| }
|
| public byte[] getFileByteArray() {
| return fileByteArray;
| }
|
| public void setFileByteArray(byte[] fileByteArray) {
| this.fileByteArray = fileByteArray;
| }
|
|
|
| }
|
here is the component.xml : (but I have not changed anything in it)
| <?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:security="http://jboss.com/products/seam/security"
| xmlns:mail="http://jboss.com/products/seam/mail"
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
| xmlns:framework="http://jboss.com/products/seam/framework"
| xsi:schemaLocation=
| "http://jboss.com/products/seam/core http://jboss.com/products/seam/core-1.2.xsd
| http://jboss.com/products/seam/drools http://jboss.com/products/seam/drools-1.2.xsd
| http://jboss.com/products/seam/security http://jboss.com/products/seam/security-1.2.xsd
| http://jboss.com/products/seam/mail http://jboss.com/products/seam/mail-1.2.xsd
| http://jboss.com/products/seam/components http://jboss.com/products/seam/components-1.2.xsd">
|
| <core:init debug="@debug@" jndi-pattern="@jndiPattern@"/>
|
| <core:manager concurrent-request-timeout="500"
| conversation-timeout="120000"
| conversation-id-parameter="cid"
| conversation-is-long-running-parameter="clr"/>
|
| <core:managed-persistence-context name="entityManager"
| auto-create="true"
| persistence-unit-jndi-name="java:/bbppEntityManagerFactory"/>
|
| <core:ejb installed="@embeddedEjb@"/>
|
| <drools:rule-base name="securityRules">
| <drools:rule-files>
| <value>/security.drl</value>
| </drools:rule-files>
| </drools:rule-base>
|
| <security:identity authenticate-method="#{authenticator.authenticate}"
| security-rules="#{securityRules}"/>
|
| <event type="org.jboss.seam.notLoggedIn">
| <action expression="#{redirect.captureCurrentView}"/>
| </event>
| <event type="org.jboss.seam.postAuthenticate">
| <action expression="#{redirect.returnToCapturedView}"/>
| </event>
|
|
| <mail:mail-session host="localhost" port="2525" username="test" password="test" />
|
| <!-- For use with jBPM pageflow or process management -->
| <!--
| <core:jbpm>
| <core:process-definitions></core:process-definitions>
| <core:pageflow-definitions></core:pageflow-definitions>
| </core:jbpm>
| -->
| <framework:entity-query name="moralEntityQuery" ejbql="select m from MoralEntity m" />
| <framework:entity-query name="companyQuery" ejbql="select c from Company c" />
| <framework:entity-query name="agentQuery" ejbql="select a from Agent a" />
| <framework:entity-query name="roleQuery" ejbql="select r from Role r" />
| <framework:entity-query name="dealQuery" ejbql="select d from Deal d" />
| <framework:entity-query name="productQuery" ejbql="select p from Product p" />
|
| </components>
|
|
and the web.xml :
| <?xml version="1.0" ?>
| <web-app xmlns="http://java.sun.com/xml/ns/j2ee"
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
| xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
| version="2.4">
|
| <!-- Ajax4jsf (must come first!) -->
|
| <filter>
| <display-name>Ajax4jsf Filter</display-name>
| <filter-name>ajax4jsf</filter-name>
| <filter-class>org.ajax4jsf.Filter</filter-class>
| </filter>
|
| <filter-mapping>
| <filter-name>ajax4jsf</filter-name>
| <url-pattern>*.seam</url-pattern>
| </filter-mapping>
|
| <context-param>
| <param-name>org.ajax4jsf.VIEW_HANDLERS</param-name>
| <param-value>org.jboss.seam.ui.facelet.SeamFaceletViewHandler</param-value>
| </context-param>
|
| <context-param>
| <param-name>org.ajax4jsf.SKIN</param-name>
| <param-value>blueSky</param-value>
| </context-param>
|
| <!-- Seam -->
|
| <listener>
| <listener-class>org.jboss.seam.servlet.SeamListener</listener-class>
| </listener>
|
| <filter>
| <filter-name>Seam Filter</filter-name>
| <filter-class>org.jboss.seam.web.SeamFilter</filter-class>
| </filter>
|
| <filter-mapping>
| <filter-name>Seam Filter</filter-name>
| <url-pattern>/*</url-pattern>
| </filter-mapping>
|
| <servlet>
| <servlet-name>Seam Resource Servlet</servlet-name>
| <servlet-class>org.jboss.seam.servlet.ResourceServlet</servlet-class>
| </servlet>
|
| <servlet-mapping>
| <servlet-name>Seam Resource Servlet</servlet-name>
| <url-pattern>/seam/resource/*</url-pattern>
| </servlet-mapping>
|
| <!-- MyFaces -->
| <!--
| <listener>
| <listener-class>org.apache.myfaces.webapp.StartupServletContextListener</listener-class>
| </listener>
| -->
|
| <!-- SUN Faces instead of MyFaces -->
| <listener>
| <listener-class>com.sun.faces.config.ConfigureListener</listener-class>
| </listener>
|
| <!-- Facelets development mode (disable in production) -->
|
| <context-param>
| <param-name>facelets.DEVELOPMENT</param-name>
| <param-value>true</param-value>
| </context-param>
|
| <!-- JSF -->
|
| <context-param>
| <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
| <param-value>client</param-value>
| </context-param>
|
| <context-param>
| <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
| <param-value>.xhtml</param-value>
| </context-param>
|
| <servlet>
| <servlet-name>Faces Servlet</servlet-name>
| <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
| <load-on-startup>1</load-on-startup>
| </servlet>
|
| <servlet-mapping>
| <servlet-name>Faces Servlet</servlet-name>
| <url-pattern>*.seam</url-pattern>
| </servlet-mapping>
|
| <security-constraint>
| <display-name>Restrict raw XHTML Documents</display-name>
| <web-resource-collection>
| <web-resource-name>XHTML</web-resource-name>
| <url-pattern>*.xhtml</url-pattern>
| </web-resource-collection>
| <auth-constraint>
| <role-name>NONE</role-name>
| </auth-constraint>
| </security-constraint>
|
| </web-app>
|
|
I hae not changed anything in the application.xml
thanks for your help
Vincent
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4119886#4119886
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4119886
18 years, 5 months
Re: Exception while using jmsXA connection factory
by samk@twinix.com
See Thread at: http://www.techienuggets.com/Detail?tx=11907 Posted on behalf of a User
I'm having a similar problem... Using JBoss 4.2.1.GA and Java 1.5.0_05.
2008-01-12 18:50:34,823 WARN [com.arjuna.ats.jta.logging.loggerI18N] [com.arjuna.ats.internal.jta.resources.arjunacore.preparefailed] [com.arjuna.ats.internal.jta.resources.arjunacore.preparefailed] XAResourceRecord.prepare - prepare failed with exception XAException.XAER_RMERR
2008-01-12 18:50:34,823 WARN [com.arjuna.ats.arjuna.logging.arjLoggerI18N] [com.arjuna.ats.arjuna.coordinator.BasicAction_50] - Prepare phase of action -3f57f496:bde:478619a6:d1e4e received heuristic decision: TwoPhaseOutcome.HEURISTIC_HAZARD
2008-01-12 18:50:34,823 WARN [com.arjuna.ats.arjuna.logging.arjLoggerI18N] [com.arjuna.ats.arjuna.coordinator.BasicAction_36] - BasicAction.End() - prepare phase of action-id -3f57f496:bde:478619a6:d1e4e failed.
2008-01-12 18:50:34,838 WARN [com.arjuna.ats.arjuna.logging.arjLoggerI18N] [com.arjuna.ats.arjuna.coordinator.BasicAction_37] - Received heuristic: TwoPhaseOutcome.HEURISTIC_HAZARD .
2008-01-12 18:50:34,838 WARN [com.arjuna.ats.arjuna.logging.arjLoggerI18N] [com.arjuna.ats.arjuna.coordinator.BasicAction_38] - Action Aborting
2008-01-12 18:50:34,870 ERROR [org.jboss.ejb.plugins.LogInterceptor] TransactionRolledbackException in method: public abstract int com.company.TransactionInterfaceRemote.submitDocument(org.jdom.Document) throws com.company.TransactionException,java.rmi.RemoteException, causedBy:
javax.transaction.HeuristicMixedException
at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.commit(TransactionImple.java:250)
at org.jboss.ejb.plugins.TxInterceptorCMT.endTransaction(TxInterceptorCMT.java:501)
at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:361)
at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:181)
at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:168)
In Response To:
Hi,
I am using JBoss 4.2.0 , with the bundled MQ server.
The scenario is as the following:
Container Managed Transactions is used.
An MDB is listening on a secured queue , when it recieves a message it sends another message to a number of secured queues.
In the first MDB , i lookup jmsXA as the connection factory , and try a connection to it . When an exception is thrown , a exception related to 2 phase commiting is thrown.
Thanks in advance.
14:23:09,312 INFO [Server] JBoss (MX MicroKernel) [4.2.0.GA (build: SVNTag=JBoss_4_2_0_GA date=200705111440)] Started in 28s:203ms
14:23:19,562 WARN [loggerI18N] [com.arjuna.ats.internal.jta.resources.arjunacore.preparefailed] [com.arjuna.ats.internal.jta.resources.arjunacore.preparefailed] XAResourceRecord.prepare - prepare failed with exception XAException.XAER_RMERR
14:23:19,562 WARN [arjLoggerI18N] [com.arjuna.ats.arjuna.coordinator.BasicAction_50] - Prepare phase of action a0a0a0a:a89:46dd4006:95 received heuristic decision: TwoPhaseOutcome.HEURISTIC_HAZARD
14:23:19,562 WARN [arjLoggerI18N] [com.arjuna.ats.arjuna.coordinator.BasicAction_36] - BasicAction.End() - prepare phase of action-id a0a0a0a:a89:46dd4006:95 failed.
14:23:19,640 WARN [arjLoggerI18N] [com.arjuna.ats.arjuna.coordinator.BasicAction_37] - Received heuristic: TwoPhaseOutcome.HEURISTIC_HAZARD .
14:23:19,640 WARN [arjLoggerI18N] [com.arjuna.ats.arjuna.coordinator.BasicAction_38] - Action Aborting
14:23:19,718 ERROR [StdServerSession] failed to commit/rollback
javax.transaction.HeuristicMixedException
at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.commitAndDisassociate(TransactionImple.java:1264)
at com.arjuna.ats.internal.jta.transaction.arjunacore.BaseTransaction.commit(BaseTransaction.java:135)
at com.arjuna.ats.jbossatx.BaseTransactionManagerDelegate.commit(BaseTransactionManagerDelegate.java:87)
at org.jboss.jms.asf.StdServerSession.onMessage(StdServerSession.java:351)
at org.jboss.mq.SpyMessageConsumer.sessionConsumerProcessMessage(SpyMessageConsumer.java:891)
at org.jboss.mq.SpyMessageConsumer.addMessage(SpyMessageConsumer.java:170)
at org.jboss.mq.SpySession.run(SpySession.java:323)
at org.jboss.jms.asf.StdServerSession.run(StdServerSession.java:194)
at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:743)
at java.lang.Thread.run(Thread.java:595)
18 years, 5 months
[EJB/JBoss] - Re: EJB 3873 Can not get connection to server
by zjx_cool
"zjx_cool" wrote : I got a frustrated problem when I try to call more than two method in same remote interface from client, sometimes it run correctlly and give me right answer but 90% will get a Exception listed bellow. I tryed likely hundreds times and figure out that if I only call one method at a time , it work fine. but if I
| call two method closely it will throw this Exception...help thanks.
| my env is Jboss 4.2.2GA , jdk 1.6.0_03
|
|
| public static void main(String[] args)
| | {
| |
| | InitialContext ctx;
| | try
| | {
| | ctx = new javax.naming.InitialContext();
| | ctx.addToEnvironment(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
| | ctx.addToEnvironment(Context.PROVIDER_URL, "jnp://localhost");
| | ctx.addToEnvironment("InitialContext.SECURITY_PRINCIPAL", "user");
| | ctx.addToEnvironment("InitialContext.SECURITY_CREDENTIALS", "password");
| |
| | ctx.addToEnvironment("java.naming.factory.url.pkgs", "org.jboss.naming");
| | HelloWorldRemote remote = (HelloWorldRemote)ctx.lookup("HelloWorld/remote");
| | System.out.println(remote.sayHello("ken"));
| |
| | System.out.println("res =" + remote.getRes());
| | System.out.println("res + 10 = " + remote.add(10));
| |
| | System.out.println("res =" + remote.getRes());
| | System.out.println("res + 20 = " + remote.add(20));
| | System.out.println("res =" + remote.getRes());
| |
| | ctx.close();
| | }
| | catch (NamingException e)
| | {
| | // TODO Auto-generated catch block
| | e.printStackTrace();
| | }
| |
| | }
| |
|
|
| it will keep giving me Exception :
|
|
| | hello world ken
| | Exception in thread "main" org.jboss.remoting.CannotConnectException: Can not get connection to server. Problem establishing socket connection for InvokerLocator [socket://127.0.0.1:3873/]
| | at org.jboss.remoting.transport.socket.MicroSocketClientInvoker.transport(MicroSocketClientInvoker.java:532)
| | at org.jboss.remoting.MicroRemoteClientInvoker.invoke(MicroRemoteClientInvoker.java:122)
| | at org.jboss.remoting.Client.invoke(Client.java:1634)
| | at org.jboss.remoting.Client.invoke(Client.java:548)
| | at org.jboss.aspects.remoting.InvokeRemoteInterceptor.invoke(InvokeRemoteInterceptor.java:62)
| | at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| | at org.jboss.aspects.tx.ClientTxPropagationInterceptor.invoke(ClientTxPropagationInterceptor.java:67)
| | at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| | at org.jboss.aspects.security.SecurityClientInterceptor.invoke(SecurityClientInterceptor.java:53)
| | at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| | at org.jboss.ejb3.remoting.IsLocalInterceptor.invoke(IsLocalInterceptor.java:74)
| | at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| | at org.jboss.ejb3.stateless.StatelessRemoteProxy.invoke(StatelessRemoteProxy.java:107)
| | at $Proxy0.getRes(Unknown Source)
| | at TestMain.main(TestMain.java:31)
| | Caused by: java.lang.reflect.InvocationTargetException
| | at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
| | at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
| | at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
| | at java.lang.reflect.Constructor.newInstance(Unknown Source)
| | at org.jboss.remoting.transport.socket.SocketClientInvoker.createClientSocket(SocketClientInvoker.java:152)
| | at org.jboss.remoting.transport.socket.MicroSocketClientInvoker.getConnection(MicroSocketClientInvoker.java:856)
| | at org.jboss.remoting.transport.socket.MicroSocketClientInvoker.transport(MicroSocketClientInvoker.java:525)
| | at org.jboss.remoting.MicroRemoteClientInvoker.invoke(MicroRemoteClientInvoker.java:122)
| | at org.jboss.remoting.Client.invoke(Client.java:1634)
| | at org.jboss.remoting.Client.invoke(Client.java:548)
| | at org.jboss.aspects.remoting.InvokeRemoteInterceptor.invoke(InvokeRemoteInterceptor.java:62)
| | at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| | at org.jboss.aspects.tx.ClientTxPropagationInterceptor.invoke(ClientTxPropagationInterceptor.java:67)
| | at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| | at org.jboss.aspects.security.SecurityClientInterceptor.invoke(SecurityClientInterceptor.java:53)
| | at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| | at org.jboss.ejb3.remoting.IsLocalInterceptor.invoke(IsLocalInterceptor.java:74)
| | at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| | at org.jboss.ejb3.stateless.StatelessRemoteProxy.invoke(StatelessRemoteProxy.java:107)
| | at $Proxy0.getRes(Unknown Source)
| | at TestMain.main(TestMain.java:31)
| | at org.jboss.aspects.remoting.InvokeRemoteInterceptor.invoke(InvokeRemoteInterceptor.java:74)
| | ... 10 more
| | Caused by: java.net.SocketException: Software caused connection abort: socket write error
| | at java.net.SocketOutputStream.socketWrite0(Native Method)
| | at java.net.SocketOutputStream.socketWrite(Unknown Source)
| | at java.net.SocketOutputStream.write(Unknown Source)
| | at java.io.BufferedOutputStream.flushBuffer(Unknown Source)
| | at java.io.BufferedOutputStream.flush(Unknown Source)
| | at java.io.ObjectOutputStream$BlockDataOutputStream.flush(Unknown Source)
| | at java.io.ObjectOutputStream.flush(Unknown Source)
| | at org.jboss.remoting.marshal.serializable.SerializableMarshaller.getMarshallingStream(SerializableMarshaller.java:90)
| | at org.jboss.remoting.marshal.serializable.SerializableMarshaller.getMarshallingStream(SerializableMarshaller.java:72)
| | at org.jboss.remoting.transport.socket.ClientSocketWrapper.createOutputStream(ClientSocketWrapper.java:204)
| | at org.jboss.remoting.transport.socket.ClientSocketWrapper.createStreams(ClientSocketWrapper.java:163)
| | at org.jboss.remoting.transport.socket.ClientSocketWrapper.<init>(ClientSocketWrapper.java:66)
| | at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
| | at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
| | at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
| | at java.lang.reflect.Constructor.newInstance(Unknown Source)
| | at org.jboss.remoting.transport.socket.SocketClientInvoker.createClientSocket(SocketClientInvoker.java:152)
| | at org.jboss.remoting.transport.socket.MicroSocketClientInvoker.getConnection(MicroSocketClientInvoker.java:856)
| | at org.jboss.remoting.transport.socket.MicroSocketClientInvoker.transport(MicroSocketClientInvoker.java:525)
| | at org.jboss.remoting.MicroRemoteClientInvoker.invoke(MicroRemoteClientInvoker.java:122)
| | at org.jboss.remoting.Client.invoke(Client.java:1634)
| | at org.jboss.remoting.Client.invoke(Client.java:548)
| | at org.jboss.aspects.remoting.InvokeRemoteInterceptor.invoke(InvokeRemoteInterceptor.java:62)
| | ... 10 more
| |
| |
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4119869#4119869
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4119869
18 years, 5 months