[Installation, Configuration & DEPLOYMENT] - virutal-host question
by fishfarp
We have a WAR file we deploy (app1) that defines 2 virtual-hosts "vhost1" and "vhost2". Within this WAR we have a singleton class named "FooSingleton" which has a getInstance() method. Also within the WAR is a JSP page which simply gets a FooSingleton instance and reloads an internal array list from a data source.
Now we have another application (app2) that is deployed within the same JBoss. There is a class which calls the JSP in app1 to update that applications ArrayList with new data from the data source. Currently we only call the JSP in "vhost1", thinking since FooSingleton is a singleton class it would update both "vhost1" and "vhost2". However this is not the case. We need to call the JSP in both "vhost1" and "vhost2" in order to update both.
Is it possible to have FooSingleton update both virtual hosts at the same time by calling only 1 virtual host? I doubt it and if we could it might not be a good solution.
What would be the best way to call make a single call from app2 to app1 to update the data from the data source? JMS might do the trick however we don't have the time to set something like that up...
Thanks for your help,
- John
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4094199#4094199
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4094199
18Â years, 9Â months
[JBoss Seam] - Re: Quartz question [not just Quartz but EJB timer as well]
by damianharvey
I've got exactly the same problem as this using Seam 2.0.0.CR2 on JBoss 4.2.0.GA. I've tried the async send in the mail example and it shows the same issue.
Has anyone found a solution to this?
I've stripped my own app back so that it has no variables in the mail template. Everything is hard-coded so I doubt it's a conversation scope issue as suggested above.
All of the other types of send in the example app work aside from the async. Here's the stack trace from the example:
| 17:11:35,054 INFO [MailSession] Creating JavaMail Session (localhost:2500)
| 17:11:35,060 INFO [MailSession] connected to mail server
| 17:11:54,872 ERROR [STDERR] java.lang.IllegalStateException: Application was not properly initialized at startup, could not find Factory: javax.faces.application.ApplicationFactory
| 17:11:54,872 ERROR [STDERR] at javax.faces.FactoryFinder.getFactory(FactoryFinder.java:256)
| 17:11:54,872 ERROR [STDERR] at org.jboss.seam.mock.MockFacesContext.<init>(MockFacesContext.java:60)
| 17:11:54,872 ERROR [STDERR] at org.jboss.seam.ui.facelet.FaceletsRenderer$RenderingContext.init(FaceletsRenderer.java:95)
| 17:11:54,872 ERROR [STDERR] at org.jboss.seam.ui.facelet.FaceletsRenderer$RenderingContext.run(FaceletsRenderer.java:77)
| 17:11:54,872 ERROR [STDERR] at org.jboss.seam.ui.facelet.FaceletsRenderer.render(FaceletsRenderer.java:169)
| 17:11:54,872 ERROR [STDERR] at org.jboss.seam.example.mail.AsynchronousMailProcessor.scheduleSend(AsynchronousMailProcessor.java:18)
| 17:11:54,873 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| 17:11:54,873 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
| 17:11:54,873 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| 17:11:54,873 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:585)
| 17:11:54,873 ERROR [STDERR] at org.jboss.seam.util.Reflections.invoke(Reflections.java:21)
| 17:11:54,873 ERROR [STDERR] at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:31)
| 17:11:54,873 ERROR [STDERR] at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)
| 17:11:54,873 ERROR [STDERR] at org.jboss.seam.transaction.RollbackInterceptor.aroundInvoke(RollbackInterceptor.java:31)
| 17:11:54,873 ERROR [STDERR] at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
| 17:11:54,873 ERROR [STDERR] at org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:42)
| 17:11:54,873 ERROR [STDERR] at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
| 17:11:54,873 ERROR [STDERR] at org.jboss.seam.async.AsynchronousInterceptor.aroundInvoke(AsynchronousInterceptor.java:50)
| 17:11:54,873 ERROR [STDERR] at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
| 17:11:54,873 ERROR [STDERR] at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:106)
| 17:11:54,873 ERROR [STDERR] at org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:155)
| 17:11:54,873 ERROR [STDERR] at org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:91)
| 17:11:54,873 ERROR [STDERR] at org.jboss.seam.example.mail.AsynchronousMailProcessor_$$_javassist_2.scheduleSend(AsynchronousMailProcessor_$$_javassist_2.java)
| 17:11:54,873 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| 17:11:54,873 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
| 17:11:54,873 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| 17:11:54,873 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:585)
| 17:11:54,873 ERROR [STDERR] at org.jboss.seam.util.Reflections.invoke(Reflections.java:21)
| 17:11:54,873 ERROR [STDERR] at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:125)
| 17:11:54,873 ERROR [STDERR] at org.jboss.seam.async.AsynchronousInvocation.call(AsynchronousInvocation.java:52)
| 17:11:54,873 ERROR [STDERR] at org.jboss.seam.async.Asynchronous.executeInContexts(Asynchronous.java:76)
| 17:11:54,873 ERROR [STDERR] at org.jboss.seam.async.Asynchronous.execute(Asynchronous.java:45)
| 17:11:54,873 ERROR [STDERR] at org.jboss.seam.async.TimerServiceDispatcher.dispatch(TimerServiceDispatcher.java:50)
| 17:11:54,874 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| 17:11:54,874 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
| 17:11:54,874 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| 17:11:54,874 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:585)
| 17:11:54,874 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:112)
| 17:11:54,874 ERROR [STDERR] at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:166)
| 17:11:54,874 ERROR [STDERR] at org.jboss.ejb3.interceptor.EJB3InterceptorsInterceptor.invoke(EJB3InterceptorsInterceptor.java:63)
| 17:11:54,874 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| 17:11:54,874 ERROR [STDERR] at org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invoke(TransactionScopedEntityManagerInterceptor.java:54)
| 17:11:54,874 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| 17:11:54,874 ERROR [STDERR] at org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:47)
| 17:11:54,874 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| 17:11:54,874 ERROR [STDERR] at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:79)
| 17:11:54,874 ERROR [STDERR] at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:191)
| 17:11:54,874 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| 17:11:54,874 ERROR [STDERR] at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:76)
| 17:11:54,874 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| 17:11:54,874 ERROR [STDERR] at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:62)
| 17:11:54,874 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| 17:11:54,874 ERROR [STDERR] at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:77)
| 17:11:54,874 ERROR [STDERR] at org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.invoke(Ejb3AuthenticationInterceptor.java:106)
| 17:11:54,874 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| 17:11:54,874 ERROR [STDERR] at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:46)
| 17:11:54,874 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| 17:11:54,875 ERROR [STDERR] at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
| 17:11:54,875 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| 17:11:54,875 ERROR [STDERR] at org.jboss.ejb3.stateless.StatelessContainer.callTimeout(StatelessContainer.java:151)
| 17:11:54,875 ERROR [STDERR] at org.jboss.ejb.txtimer.TimerImpl$TimerTaskImpl.run(TimerImpl.java:561)
| 17:11:54,875 ERROR [STDERR] at java.util.TimerThread.mainLoop(Timer.java:512)
| 17:11:54,875 ERROR [STDERR] at java.util.TimerThread.run(Timer.java:462)
|
Thanks,
Damian
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4094189#4094189
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4094189
18Â years, 9Â months
[JBoss Seam] - SEAM remoting problem
by alex_enache
Hi!
I have two classes. One is the POJO that maps on a table in my db. This is a simple class with getters and setters(the name of the class is Project). I have a ProjectManager class which I want to remotely access in javascript. I will post only the code for the ProjectManager class.
@Scope(EVENT)
| @Name("projectManager")
| public class ProjectManager implements GeneralManager {
|
| @In(required=false) @Out(required=false)
| private Project project;
|
| @In
| private UserSession userSession;
|
| @In
| private Session hibernateSession;
|
| @WebRemote
| public List<Project> getProjects() {
| List<Project> projects = hibernateSession.createQuery("from Project p").list();
| return projects;
| }
|
| public String persist() {
| System.out.println(project.getPrjName());
| project.setUserId(userSession.getUser().getUserId());
| hibernateSession.save(project);
| return "dataPersisted";
| }
|
| public String delete() {
| return null;
| }
|
| public String update() {
| return null;
| }
| }
When I access the getProjects method through javascript it works great. No errors there. My problem is when I try to parse the list that is returned by the method. I just don't know how to parse that array. Any clues?
This is the js code.
function processData() {
| Seam.Remoting.displayLoadingMessage = function(){};
| Seam.Remoting.hideLoadingMessage = function(){};
| Seam.Component.getInstance("projectManager").getProjects(projectsFoundCallback);
|
| function projectsFoundCallback(result) {
| // process results
| }
| }
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4094188#4094188
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4094188
18Â years, 9Â months