[EJB 3.0] - EJB3 + registering Quartz jobs without using quartz-ra.rar
by mruflin
Hello
I'm trying to get an application using quartz running in a clustered environment. The actual jobs call a method of EJB3 objects.
I first went the way using the ResourceAdapter "quartz-ra", but can't bring quartz to work correctly in a clustered environment. In my case quartz should only run on a single node. Having tried deploy-hasingleton without success, the best way I see to use quartz on a single node only would be following:
1. Use RAMJobStore. This avoids any problems regarding correctly set clocks and would simplify the configuration. Short out-times in case of a server error are acceptable
2. deploy quartz as a jboss-service and add
<depends>jboss.ha:service=HASingletonDeployer,type=Barrier</depends>
|
to the jboss-service.xml file. This will deploy quartz on all nodes, but the scheduler is started on only one of them.
3. Register the jobs on all nodes. As quartz is deployed everywhere I won't have the problem of not found resources.
The advantage of this way would be
1) no jdbc for registering jobs, thus easier setup
2) application could be deployed in "farm/", redeployment of all nodes would therefore be automatic.
I have two questions regarding this way though:
1) how can I register the jobs now? EJB+PostConstruct (ugly)? Does quartz provide something for such a case?
2) did I completely misunderstand something and is what I try to do just plain wrong?
Thanks,
Michael
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4047268#4047268
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4047268
18 years, 11 months
[JBoss jBPM] - TaskInstance Hibernate Exception
by jstuck
Hi:
I am working on a UI for JBPM. When starting a ProcessInstance, I inspect the startTaskInstance for any variables that need to be supplied. However, when saving the process instance, I receive the following hibernate exception:
instance not of expected entity type: org.jbpm.context.exe.VariableInstance
Here is the code I am using to get the startTaskInstance:
TaskInstance taskInstance = processInstance.getTaskMgmtInstance().createStartTaskInstance();
I then use the taskController to gain access to the variables if they exist. This is used to construct the UI.
TaskController taskController = taskInstance.getTask().getTaskController();
if (taskController != null) {
List variableAccesses = taskController.getVariableAccesses();
Iterator iterator = variableAccesses.iterator();
while (iterator.hasNext()) {
VariableAccess variableAccess = (VariableAccess) iterator.next();
String mappedName = variableAccess.getMappedName();
String value = (String) taskInstance.getVariable(mappedName);
?
}
}
Does anyone know why I am seeing this exception and can you recommend a solution?
Thanks,
Jeff
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4047264#4047264
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4047264
18 years, 11 months
[JNDI/Naming/Network] - Exception javax.naming.NameNotFoundException
by ganesh.pol
I am new to EJB and trying on EJB sample application in
EJB 2.0
JBOSS Server 4.0.1
______________________________________________________________
my code for getting remote object is
public IUserSessionEJBObject getUserRemoteObject(String jndiName){
System.out.println("looking for JNDI name "+jndiName);
InitialContext context=null;
Object obj=null;
IUserSessionEJBObject userRemoteObject=null;
IUserSessionEJBHome userSessionEJBHome=null;
try{
context= new InitialContext();
obj=context.lookup(jndiName);
userSessionEJBHome=(IUserSessionEJBHome)PortableRemoteObject.narrow(obj,IUserSessionEJBHome.class);
System.out.println("USer EJB HOME Object"+userSessionEJBHome);
}catch(NamingException namingEx){
System.err.println("naming Exception occured");
namingEx.printStackTrace();
}
try{
userRemoteObject=userSessionEJBHome.create();
}catch(CreateException creEx){
System.err.println("create Exception occured");
creEx.printStackTrace();
}catch(RemoteException reEx){
System.err.println("Remote Ex occured");
reEx.printStackTrace();
}
System.out.println("USer EJB HOME Object"+userSessionEJBHome);
return userRemoteObject;
}
________________________________________________________
ejb-jar.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN" "http://java.sun.com/dtd/ejb-jar_2_0.dtd">
<ejb-jar>
mfsc
<display-name>mfsc</display-name>
<enterprise-beans>
<!-- Session Beans -->
<display-name>UserSession</display-name>
<ejb-name>UserSession</ejb-name>
com.pspl.common.admin.user.components.IUserSessionEJBHome
com.pspl.common.admin.user.components.IUserSessionEJBObject
<ejb-class>com.pspl.common.admin.user.components.UserSessionBean</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>
</enterprise-beans>
<assembly-descriptor>
</assembly-descriptor>
</ejb-jar>
_____________________________________________________________
jboss.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE jboss PUBLIC "-//JBoss//DTD JBOSS//EN" "http://www.jboss.org/j2ee/dtd/jboss.dtd">
<enterprise-beans>
<ejb-name>UserSession</ejb-name>
<jndi-name>ejb/UserSession</jndi-name>
</enterprise-beans>
<resource-managers>
</resource-managers>
_______________________________________________________
but i got following Exception
19:29:13,120 INFO [STDOUT] looking for JNDI name ejb/UserSession
19:29:13,135 INFO [STDOUT] naming Exception occured
19:29:13,135 INFO [STDOUT] javax.naming.NameNotFoundException: UserSession not bound
19:29:13,135 INFO [STDOUT] at org.jnp.server.NamingServer.getBinding(NamingServer.java:491)
19:29:13,135 INFO [STDOUT] at org.jnp.server.NamingServer.getBinding(NamingServer.java:499)
19:29:13,135 INFO [STDOUT] at org.jnp.server.NamingServer.getObject(NamingServer.java:505)
19:29:13,135 INFO [STDOUT] at org.jnp.server.NamingServer.lookup(NamingServer.java:278)
19:29:13,135 INFO [STDOUT] at org.jnp.server.NamingServer.lookup(NamingServer.java:252)
19:29:13,135 INFO [STDOUT] at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:544)
19:29:13,135 INFO [STDOUT] at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:520)
19:29:13,135 INFO [STDOUT] at javax.naming.InitialContext.lookup(InitialContext.java:351)
19:29:13,135 INFO [STDOUT] at com.pspl.common.delegate.CommonDelegate.getUserRemoteObject(CommonDelegate.java:46)
I am not getting where i did mistake????
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4047262#4047262
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4047262
18 years, 11 months
JBoss 4.2.0 seam blog example
by Jason Porter
I am unable to deploy the blog example that comes with Seam on JBoss AS
4.2.0. Here's the exception that I get when I try (note that facelets
is included in the jboss-seam-blog.war):
08:22:46,377 ERROR [[/seam-blog]] Exception sending context initialized
event to listener instance of class org.jboss.we
b.jsf.integration.config.JBossJSFConfigureListener
java.lang.NoClassDefFoundError: com/sun/facelets/compiler/Compiler
at java.lang.Class.getDeclaredConstructors0(Native Method)
at
java.lang.Class.privateGetDeclaredConstructors(Class.java:2357)
at java.lang.Class.getConstructor0(Class.java:2671)
at java.lang.Class.newInstance0(Class.java:321)
at java.lang.Class.newInstance(Class.java:303)
at
com.sun.faces.config.ConfigureListener.configure(ConfigureListener.java:
852)
at
com.sun.faces.config.ConfigureListener.configure(ConfigureListener.java:
502)
at
com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListe
ner.java:402)
at
org.jboss.web.jsf.integration.config.JBossJSFConfigureListener.contextIn
itialized(JBossJSFConfigureListener.j
ava:69)
at
org.apache.catalina.core.StandardContext.listenerStart(StandardContext.j
ava:3854)
at
org.apache.catalina.core.StandardContext.start(StandardContext.java:4359
)
at
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.ja
va:761)
at
org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:741)
at
org.apache.catalina.core.StandardHost.addChild(StandardHost.java:553)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav
a:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
Impl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at
org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java
:297)
at
org.jboss.mx.server.RawDynamicInvoker.invoke(RawDynamicInvoker.java:164)
at
org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
at
org.apache.catalina.core.StandardContext.init(StandardContext.java:5310)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav
a:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
Impl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at
org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java
:297)
at
org.jboss.mx.server.RawDynamicInvoker.invoke(RawDynamicInvoker.java:164)
at
org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
at
org.jboss.web.tomcat.service.TomcatDeployer.performDeployInternal(Tomcat
Deployer.java:301)
at
org.jboss.web.tomcat.service.TomcatDeployer.performDeploy(TomcatDeployer
.java:104)
at
org.jboss.web.AbstractWebDeployer.start(AbstractWebDeployer.java:375)
at org.jboss.web.WebModule.startModule(WebModule.java:83)
at org.jboss.web.WebModule.startService(WebModule.java:61)
at
org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupp
ort.java:289)
at
org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBean
Support.java:245)
at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
Impl.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.jav
a: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(DelegatingMethodAccessor
Impl.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.jav
a:264)
at
org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
at
org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
at $Proxy45.start(Unknown Source)
at
org.jboss.web.AbstractWebContainer.start(AbstractWebContainer.java:466)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav
a:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
Impl.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(ModelMBea
nOperationInterceptor.java:142)
at
org.jboss.mx.interceptor.DynamicInterceptor.invoke(DynamicInterceptor.ja
va:97)
at
org.jboss.system.InterceptorServiceMBeanSupport.invokeNext(InterceptorSe
rviceMBeanSupport.java:238)
at
org.jboss.ws.integration.jboss42.DeployerInterceptor.start(DeployerInter
ceptor.java:93)
at
org.jboss.deployment.SubDeployerInterceptorSupport$XMBeanInterceptor.sta
rt(SubDeployerInterceptorSupport.java
:188)
at
org.jboss.deployment.SubDeployerInterceptor.invoke(SubDeployerIntercepto
r.java:95)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
at
org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.jav
a:264)
at
org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
at
org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
at $Proxy46.start(Unknown Source)
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.GeneratedMethodAccessor18.invoke(Unknown Source)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
Impl.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(ModelMBea
nOperationInterceptor.java:142)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
at
org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.jav
a: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(URLDeploymentSc
anner.java:421)
at
org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScan
ner.java:610)
at
org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doS
can(AbstractDeploymentScanner.java:26
3)
at
org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.loo
p(AbstractDeploymentScanner.java:274)
at
org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run
(AbstractDeploymentScanner.java:225)
Jason Porter
O.C. Tanner
Information Services
Technical Specialist
18 years, 11 months