[JBoss Seam] - Why is called @Factory method always ?
by miloslav.vlach
I have a component which display some list and I am using @Factory method. But when I call add, from this component, which do not access to the list, the @Factory method is called. Why ?
| package cz.bpsolutions.ims.services.diary;
|
| import java.io.Serializable;
| import java.util.ArrayList;
| import java.util.Calendar;
| import java.util.Date;
| import java.util.List;
| import java.util.Locale;
|
| import javax.ejb.Remove;
| import javax.ejb.Stateful;
| import javax.persistence.EntityManager;
| import javax.persistence.PersistenceContext;
| import javax.persistence.PersistenceContextType;
|
| import org.hibernate.Criteria;
| import org.hibernate.criterion.Order;
| import org.hibernate.criterion.Restrictions;
| import org.hibernate.ejb.EntityManagerImpl;
| import org.jboss.seam.ScopeType;
| import org.jboss.seam.annotations.Begin;
| import org.jboss.seam.annotations.Destroy;
| import org.jboss.seam.annotations.End;
| import org.jboss.seam.annotations.Factory;
| import org.jboss.seam.annotations.In;
| import org.jboss.seam.annotations.Logger;
| import org.jboss.seam.annotations.Name;
| import org.jboss.seam.annotations.Out;
| import org.jboss.seam.annotations.datamodel.DataModel;
| import org.jboss.seam.annotations.datamodel.DataModelSelection;
| import org.jboss.seam.annotations.security.Restrict;
| import org.jboss.seam.log.Log;
|
| import cz.bpsolutions.ims.model.Account;
| import cz.bpsolutions.ims.model.DiaryEntry;
| import cz.bpsolutions.ims.model.Request;
| import cz.bpsolutions.ims.services.other.Configuration;
| import cz.bpsolutions.tools.BiInfo;
|
| @Name("diaryEntryAction")
| @Restrict("#{identity.loggedIn}")
| @Stateful
| public class DiaryEntryAction implements Serializable, DiaryEntryActionLocal {
| private static final long serialVersionUID = 6790052898169296206L;
|
| @Logger
| Log log;
|
| Date date;
|
| @In(required = false, scope = ScopeType.SESSION)
| Account loggedUser;
|
| @PersistenceContext(type = PersistenceContextType.EXTENDED)
| EntityManager em;
|
| @DataModel
| List<DiaryEntry> diaryEntries;
|
| @In(required = false)
| DiaryEntry diaryEntry;
|
| @DataModelSelection(value = "diaryEntries")
| DiaryEntry selectedDiaryEntry;
|
| @In(required = false)
| Request request;
|
|
| @Factory("diaryEntries")
| public void load() {
| log.info("loading date #0, user #1", getDate(), loggedUser);
|
| Criteria c = ((EntityManagerImpl) (em.getDelegate())).getSession().createCriteria(DiaryEntry.class);
|
| Date startDay;
| Date endDay;
|
| Calendar cal = Calendar.getInstance(new Locale("cs", "CZ"));
|
| cal.setTime(getDate());
|
| cal.set(Calendar.HOUR, 0);
| cal.set(Calendar.MINUTE, 0);
| cal.set(Calendar.SECOND, 0);
| cal.set(Calendar.AM_PM, 0);
|
| startDay = cal.getTime();
|
| cal.set(Calendar.HOUR, 23);
| cal.set(Calendar.MINUTE, 59);
| cal.set(Calendar.SECOND, 59);
|
| endDay = cal.getTime();
| log.info("dates: #0, #1", startDay, endDay);
|
| c.add(Restrictions.eq("user.id", loggedUser.getId()));
| c.add(Restrictions.or(Restrictions.between("dateFrom", startDay, endDay), Restrictions.between("dateTo", startDay, endDay)));
|
| c.addOrder(Order.asc("dateFrom"));
|
| diaryEntries = c.list();
| log.info("loaded #0 of rows.", diaryEntries.size());
| }
|
| /*
| * (non-Javadoc)
| *
| * @see cz.bpsolutions.ims.services.diary.DiaryEntryActionLocal#save()
| */
|
| public String save() {
| log.info("saving the diary entry #0", diaryEntry);
| loggedUser = em.find(Account.class, loggedUser.getId());
|
| // Date time correction
| Calendar c = Calendar.getInstance(Configuration.locale);
| Calendar c1 = Calendar.getInstance(Configuration.locale);
|
| c.setTime(diaryEntry.getDateFrom());
| c1.setTime(date);
| c.set(Calendar.DAY_OF_MONTH, c1.get(Calendar.DAY_OF_MONTH));
| c.set(Calendar.MONTH, c1.get(Calendar.MONTH));
| c.set(Calendar.YEAR, c1.get(Calendar.YEAR));
|
| diaryEntry.setDateFrom(c.getTime());
|
| c.setTime(diaryEntry.getDateTo());
| c.set(Calendar.DAY_OF_MONTH, c1.get(Calendar.DAY_OF_MONTH));
| c.set(Calendar.MONTH, c1.get(Calendar.MONTH));
| c.set(Calendar.YEAR, c1.get(Calendar.YEAR));
|
| diaryEntry.setDateTo(c.getTime());
|
| diaryEntry.setUser(loggedUser);
|
| loggedUser.getDiaryEntries().add(diaryEntry);
|
|
| if (request != null && request.getId() != null) {
| request = em.find(Request.class, request.getId());
| diaryEntry.setRequest(request);
| request.getDiaryEntries().add(diaryEntry);
| em.persist(request);
| }
|
|
| em.persist(diaryEntry);
| em.persist(loggedUser);
|
| load();
|
| diaryEntry = new DiaryEntry();
|
| return "saved";
| }
|
| @Begin(join = true)
| public void reset() {
| diaryEntries = null;
| }
|
| public Date getDate() {
| if (date == null)
| date = new Date();
| return date;
| }
|
| @Begin(join = true)
| public void setDate(Date date) {
| this.date = date;
| }
|
| @Begin(join = true)
| public void changeDate() {
| log.info("Changing the date...#0", getDate());
| diaryEntries = null;
| }
|
| @Begin(join = true)
| public void changeDateToNow() {
| log.info("changing to now");
| setDate(new Date());
| diaryEntries = null;
| }
|
| public Long getWorkedHours() {
| Long workedSeconds = 0l;
|
| if (diaryEntries == null) {
| load();
| }
|
| if (diaryEntries != null) {
| for (DiaryEntry d : diaryEntries) {
| if (DiaryType.WORK_DAY.equals(d.getDiaryType())) {
| workedSeconds += d.getDateTo().getTime() - d.getDateFrom().getTime();
| } else if (DiaryType.DOCTOR.equals(d.getDiaryType())) {
| workedSeconds += d.getDateTo().getTime() - d.getDateFrom().getTime();
| } else if (DiaryType.VACATION.equals(d.getDiaryType())) {
| workedSeconds += d.getDateTo().getTime() - d.getDateFrom().getTime();
| } else if (DiaryType.VACATION2.equals(d.getDiaryType())) {
| workedSeconds += d.getDateTo().getTime() - d.getDateFrom().getTime();
| }
| }
| }
|
| log.info("worked seconds: #0", workedSeconds);
| return workedSeconds;
| }
|
| public List<BiInfo> getWorkMapInfo() {
|
| List<BiInfo> ret = new ArrayList<BiInfo>();
|
| int workDay = Configuration.workDay;
| long workedDay = getWorkedHours() / 1000;
| double percent = 0l;
|
| if (diaryEntries != null) {
| Long divider = (workDay > workedDay ? workDay : workedDay);
| if (workDay > workedDay) {
| divider += workDay - workedDay;
| }
| for (DiaryEntry d : diaryEntries) {
| BiInfo b = new BiInfo();
|
| b.first = d.getDiaryType();
| b.second = 100 * (d.getDateTo().getTime() - d.getDateFrom().getTime()) / (1000.0 * divider);
| percent += 100 * (d.getDateTo().getTime() - d.getDateFrom().getTime()) / (1000.0 * divider);
|
| ret.add(b);
| }
|
| if (workDay > workedDay) {
| // neodpracovano
| BiInfo b = new BiInfo();
|
| b.first = DiaryType.NOT_CREATED;
| b.second = 100 - percent;
|
| ret.add(b);
| }
| }
|
| return ret;
| }
|
| @Destroy
| @Remove
| public void remove() {
| }
|
| public String delete() {
| log.info("removind the diaryentry: #0", selectedDiaryEntry);
| em.refresh(selectedDiaryEntry);
|
| Request r = selectedDiaryEntry.getRequest();
| if (r != null) {
| r.getDiaryEntries().remove(selectedDiaryEntry);
|
| em.persist(r);
| }
| em.remove(selectedDiaryEntry);
|
| diaryEntries = null;
| return "deleted";
| }
|
| @End(beforeRedirect=true)
| public String done() {
| log.info("saved...conversation end");
| return "done";
| }
| }
|
|
| 21:38:16,359 INFO [DiaryEntryAction] loading date Thu Jul 19 21:38:16 CEST 2007, user cz.bpsolutions.ims.model.Account@1e4605c
| 21:38:16,359 INFO [DiaryEntryAction] dates: Thu Jul 19 00:00:00 CEST 2007, Thu Jul 19 23:59:59 CEST 2007
| 21:38:16,390 INFO [DiaryEntryAction] loaded 5 of rows.
| 21:38:16,390 INFO [DiaryEntryAction] worked seconds: 33420000
| 21:38:16,390 INFO [DiaryEntryAction] saving the diary entry cz.bpsolutions.ims.model.DiaryEntry@520467
| 21:38:16,406 INFO [DiaryEntryAction] loading date Thu Jul 19 21:38:16 CEST 2007, user cz.bpsolutions.ims.model.Account@141b041
| 21:38:16,406 INFO [DiaryEntryAction] dates: Thu Jul 19 00:00:00 CEST 2007, Thu Jul 19 23:59:59 CEST 2007
| 21:38:16,406 INFO [DiaryEntryAction] loaded 6 of rows.
| 21:38:16,468 INFO [UserService] locating the user mvlach
| 21:38:16,468 INFO [UserService] locating the user mvlach
| 21:38:16,468 INFO [DiaryEntryAction] worked seconds: 33420000
| 21:38:16,484 INFO [DiaryEntryAction] worked seconds: 33420000
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4065936#4065936
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4065936
18Â years, 9Â months
[JBoss jBPM] - Some questions on Process Instance.
by jgreiner
I just wanted to make sure I am doing some things using the best practice. I think I am doing some things that are not just 100% correct and work coincidentally
I have the process instance that I want to work with. What is the best method to get a Node so I can signal it? Also what is the best method to get a task so I can end it?
My Logic I am using on Node is....
| ProcessInstance pi = jbpmContext.getProcessInstance(pid);
|
| Token token = pi.findToken("MyNode1");
| token.signal("Pass"); // transition
|
My logic on a Task Node is...this is the one I think is not the best practice.
| ProcessInstance pi = jbpmContext.getProcessInstance(pid);
|
| Collection tis = pi.getTaskMgmtInstance().getTaskInstances();
| Iterator li = tis.iterator();
| while (li.hasNext())
| {
| TaskInstance ti = (TaskInstance)li.next();
| if (ti.getEnd() == null)
| {
| String ami = (String)ti.getVariable(ProcessVariables.ART_MASTER_ID);
| if (ami.equals(String.valueOf(artMasterId)))
| {
| ti.start(actorId);
| am = qm.retrieveArtMaster(artMasterId);
| }
| }
| }
|
Thanks
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4065935#4065935
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4065935
18Â years, 9Â months
[JBoss Seam] - Re: <s:conversationPropagation/> has no effekt
by fmars
"stu2" wrote : Could you please post the showAll() method (and any annotations) as well as the stacktrace?
methsearch is a stateful session bean. there are two methods annotated with @Begin. showAll() is one of them and here it is:
@PersistenceContext(type=PersistenceContextType.EXTENDED)
| private EntityManager entityManager;
| .....
| @Begin
| public void showAll(){
| genes = ((org.hibernate.Session)this.entityManager.getDelegate()).
| createCriteria(Gene.class).list();
| }
|
Stack Trace is really long. so here only last 3 one
Caused by: javax.ejb.EJBTransactionRolledbackException: begin method invoked from a long running conversation, try using @Begin(join=true) on method: showAll
| at org.jboss.ejb3.tx.Ejb3TxPolicy.handleInCallerTx(Ejb3TxPolicy.java:87)
| at org.jboss.aspects.tx.TxPolicy.invokeInCallerTx(TxPolicy.java:130)
| at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:195)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:76)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.ejb3.stateful.StatefulInstanceInterceptor.invoke(StatefulInstanceInterceptor.java:83)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:77)
| at org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.invoke(Ejb3AuthenticationInterceptor.java:106)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:46)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.ejb3.stateful.StatefulContainer.localInvoke(StatefulContainer.java:204)
| at org.jboss.ejb3.stateful.StatefulLocalProxy.invoke(StatefulLocalProxy.java:100)
| at $Proxy144.showAll(Unknown Source)
| 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.seam.util.Reflections.invoke(Reflections.java:21)
| at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:61)
| at org.jboss.seam.intercept.ClientSideInterceptor$1.proceed(ClientSideInterceptor.java:72)
| at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)
| at org.jboss.seam.ejb.RemoveInterceptor.aroundInvoke(RemoveInterceptor.java:41)
| at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
| at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:106)
| at org.jboss.seam.intercept.ClientSideInterceptor.invoke(ClientSideInterceptor.java:50)
| at org.javassist.tmp.java.lang.Object_$$_javassist_1.showAll(Object_$$_javassist_1.java)
| 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.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:325)
| at org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:270)
| at org.jboss.el.parser.AstMethodSuffix.getValue(AstMethodSuffix.java:59)
| at org.jboss.el.parser.AstMethodSuffix.invoke(AstMethodSuffix.java:65)
| at org.jboss.el.parser.AstValue.invoke(AstValue.java:96)
| at org.jboss.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276)
| at com.sun.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:68)
| at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:77)
| ... 46 more
| Caused by: java.lang.IllegalStateException: begin method invoked from a long running conversation, try using @Begin(join=true) on method: showAll
| at org.jboss.seam.core.ConversationInterceptor.aroundInvoke(ConversationInterceptor.java:45)
| at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
| at org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:42)
| at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
| at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:106)
| at org.jboss.seam.intercept.SessionBeanInterceptor.aroundInvoke(SessionBeanInterceptor.java:53)
| at sun.reflect.GeneratedMethodAccessor116.invoke(Unknown Source)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:585)
| at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:118)
| at org.jboss.ejb3.interceptor.EJB3InterceptorsInterceptor.invoke(EJB3InterceptorsInterceptor.java:63)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.ejb3.entity.ExtendedPersistenceContextPropagationInterceptor.invoke(ExtendedPersistenceContextPropagationInterceptor.java:71)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invoke(TransactionScopedEntityManagerInterceptor.java:54)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:47)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.aspects.tx.TxPolicy.invokeInCallerTx(TxPolicy.java:126)
| ... 87 more
| 20:55:15,843 ERROR [DebugPageHandler] redirecting to debug page
| java.lang.IllegalStateException: begin method invoked from a long running conversation, try using @Begin(join=true) on method: showAll
| at org.jboss.seam.core.ConversationInterceptor.aroundInvoke(ConversationInterceptor.java:45)
| at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
| at org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:42)
| at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
| at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:106)
| at org.jboss.seam.intercept.SessionBeanInterceptor.aroundInvoke(SessionBeanInterceptor.java:53)
| at sun.reflect.GeneratedMethodAccessor116.invoke(Unknown Source)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:585)
| at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:118)
| at org.jboss.ejb3.interceptor.EJB3InterceptorsInterceptor.invoke(EJB3InterceptorsInterceptor.java:63)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.ejb3.entity.ExtendedPersistenceContextPropagationInterceptor.invoke(ExtendedPersistenceContextPropagationInterceptor.java:71)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invoke(TransactionScopedEntityManagerInterceptor.java:54)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:47)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.aspects.tx.TxPolicy.invokeInCallerTx(TxPolicy.java:126)
| at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:195)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:76)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.ejb3.stateful.StatefulInstanceInterceptor.invoke(StatefulInstanceInterceptor.java:83)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:77)
| at org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.invoke(Ejb3AuthenticationInterceptor.java:106)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:46)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.ejb3.stateful.StatefulContainer.localInvoke(StatefulContainer.java:204)
| at org.jboss.ejb3.stateful.StatefulLocalProxy.invoke(StatefulLocalProxy.java:100)
| at $Proxy144.showAll(Unknown Source)
| 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.seam.util.Reflections.invoke(Reflections.java:21)
| at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:61)
| at org.jboss.seam.intercept.ClientSideInterceptor$1.proceed(ClientSideInterceptor.java:72)
| at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)
| at org.jboss.seam.ejb.RemoveInterceptor.aroundInvoke(RemoveInterceptor.java:41)
| at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
| at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:106)
| at org.jboss.seam.intercept.ClientSideInterceptor.invoke(ClientSideInterceptor.java:50)
| at org.javassist.tmp.java.lang.Object_$$_javassist_1.showAll(Object_$$_javassist_1.java)
| 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.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:325)
| at org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:270)
| at org.jboss.el.parser.AstMethodSuffix.getValue(AstMethodSuffix.java:59)
| at org.jboss.el.parser.AstMethodSuffix.invoke(AstMethodSuffix.java:65)
| at org.jboss.el.parser.AstValue.invoke(AstValue.java:96)
| at org.jboss.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276)
| at com.sun.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:68)
| at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:77)
| at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:91)
| at javax.faces.component.UICommand.broadcast(UICommand.java:383)
| at org.ajax4jsf.framework.ajax.AjaxViewRoot.processEvents(AjaxViewRoot.java:180)
| at org.ajax4jsf.framework.ajax.AjaxViewRoot.broadcastEvents(AjaxViewRoot.java:158)
| at org.ajax4jsf.framework.ajax.AjaxViewRoot.processApplication(AjaxViewRoot.java:346)
| at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:97)
| at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
| at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:117)
| at javax.faces.webapp.FacesServlet.service(FacesServlet.java:244)
| 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:82)
| at org.jboss.seam.debug.hot.HotDeployFilter.doFilter(HotDeployFilter.java:68)
| at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:68)
| at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:85)
| at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:68)
| at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:61)
| at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:68)
| at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:44)
| at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:68)
| 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:60)
| at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:68)
| at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:58)
| at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:68)
| at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:149)
| 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.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:433)
| 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)
|
Any Idea! Thank you.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4065932#4065932
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4065932
18Â years, 9Â months
[Tomcat, HTTPD, Servlets & JSP] Virtual host environment
by Steve
Hello,
Does anyone know how to configure a different set of JNDI environment
entries for each virtual host that uses the same WAR in JBoss? This can be
done with stand alone Tomcat using context.xml fragments under
CATALINA_HOME/conf/Catalina/www.site1.com/ROOT.xml
<Context>
<Environment description="Unique Host ID" name="siteId" type="
java.lang.String" value="site1"/>
</Context>
I can then give each virtual host it's own siteId so that it accesses the
correct rows from a shared database.
This doesn't seem to work with Tomcat embedded in JBoss. The closest I have
found so far is jboss-web.xml under WEB-INF inside the WAR, but it seems
that you can only configure environment entries for this WAR that would then
be shared across all virtual hosts that use it.
Any ideas?
Thanks,
Steve
18Â years, 9Â months