[Management, JMX/JBoss] - Bug? Multiple interfaces in the implementation causes Deploy
by dsteinwe
Hi,
i have declared a mbean like that example:
MyServiceMBean.java
@Service(objectName="MyApplication:service=MyService")
| @Management(MyManagementInterface.class)
| public class MyServiceMBean implements MyManagementInterface {
|
| public void printOut(String text) {
| System.out.println("Given text: " + text);
| }
|
| }
MyManagementInterface.java:
public interface MyManagementInterface {
| public void printOut(String text);
| }
Works so far fine. BUT if I write following in "MyServiceMBean.java":
public class MyServiceMBean implements MyManagementInterface, org.quartz.TriggerListener {
| ...
| }
I get a deployment exception:
org.jboss.deployers.spi.DeploymentException: Error deploying xyz.jar: Error creating ejb container MyServiceMBean: Bean Class xyz.MyServiceMBean has no local, webservice, or remote interfaces defined and does not implement at least one business interface: MyServiceMBean
I was a little bit confused about this message. Extending MyManagementInterface from org.quartz.TriggerListener works fine but trashes the management interface in the jmx-console. Adding @Local(MyManagementInterface.class) to the MBean the deployment works fine and keeps the management interface clean.
But is the annotation really neccessary? Is this behaviour intended?
Cheers Dieter.
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4208641#4208641
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4208641
17 years, 5 months
[EJB 3.0] - Is it possible to inject a Remote bean in a client servlet?
by rnicholson10
I'm using a remote bean from a servlet to make a remote call. The code snippet below works. But I'm wondering is it possible to inject this bean without needing to do the remote JNDI lookup.
When using JMS I setup a RemoteJMSProvider and can inject both the connection factory and destination queue from a servlet (I'm using the web 2.5 spec).
Is something similar possible with EJB's? Or am I stuck with the JNDI lookup code. Maybe some kind of mbean provider where I can specify the remote machine IP?
Cheers,
Ross
P.S. I've commented out the @EJB annotation as it does nothing.
| //@EJB
| private MyTestBeanRemote remoteBean;
|
| protected void doGet(HttpServletRequest request,
| HttpServletResponse response) throws ServletException, IOException {
|
| try {
| Properties properties = new Properties();
| properties.put(Context.INITIAL_CONTEXT_FACTORY,
| "org.jnp.interfaces.NamingContextFactory");
| properties.put(Context.URL_PKG_PREFIXES,
| "org.jboss.naming:org.jnp.interfaces");
| properties.put(Context.PROVIDER_URL, "jnp://172.16.8.52:1099");
|
| Context ctx = new InitialContext(props);
| remoteBean = (MyTestBeanRemote) ctx.lookup("TestEAR/MyTestBeanRemote/remote");
|
|
| } catch (Exception ex) {
| System.out.println("Could not create bean. "+
| ex.getMessage());
| }
|
| if (remoteBean != null) remoteBean.doSomething();
| }
|
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4208628#4208628
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4208628
17 years, 5 months
[JBoss Tools (users)] - Re: Full server capabilities only on localhost?
by bmelloni
1) I see that it is difficult to do remote Start since you have nothing that you can be sure is listening. In Unix servers you might be able to use SSH as a way to access the remote server. I am not sure about windows.
3) I meant:
3a) Admins are likely to expose 'a folder' to the network (where the temporary copy from developer's PC to server computer can happen).
3b) Admins are NOT likely to expose the 'deploy' folder to the network. Most will flat out refuse, citing security reasons.
3c) If 3b is the case, only a process running on the server computer can move the file, because processes running on the developer's PC cannot see that folder.
3d) A web service would allow executing the move from temporary to deploy folder, since the process would be running on the server computer and have access to both folders. Any other mechanism that executes the move using the CPU of the server would work just as well.
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4208624#4208624
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4208624
17 years, 5 months
[JBoss jBPM] - Jbpm 3.3.1 Timer Exception on executionContext.leaveNode()
by dleerob
Hi,
In Jbpm 3.2.x, I never had this problem. But I recently upgraded to Jbpm 3.3.1, and now, on a State Node, if I have a timer set which repeats, and on the timers action I call executionContext.leaveNode(), I get an exception. If my timer is not set to repeat, I don't get the exception. This is a bit of a showstopper for me. Any ideas would be appreciated?
Here is my simple process definition:
<process-definition
| xmlns="urn:jbpm.org:jpdl-3.2" name="ITD Sick Leave">
| <swimlane name="Initiator"></swimlane>
| <start-state name="Record Sick Leave">
| <transition to="Wait for Tomorrow"></transition>
| </start-state>
|
|
| <state name="Wait for Tomorrow">
| <timer duedate="5 seconds" name="Wait for Tomorrow" repeat="5 seconds">
| <action class="za.co.workflow.itdsickleave.action.WaitForTomorrow"></action>
| </timer>
| <transition to="Complete"></transition>
| </state>
|
|
| <end-state name="Complete"></end-state>
| </process-definition>
Here is my action's execute method attached to the timer:
public void handle(ExecutionContext executionContext) throws Exception {
| executionContext.leaveNode();
| }
Here is the exception being thrown:
INFO JbpmJobExecutor:10.11.5.61:1 org.jbpm.persistence.db.DbPersistenceService - problem committing transaction: optimistic locking failed
| INFO JbpmJobExecutor:10.11.5.61:1 org.jbpm.svc.Services - problem closing service 'persistence': optimistic locking failed
| ERROR JbpmJobExecutor:10.11.5.61:1 org.hibernate.event.def.AbstractFlushingEventListener - Could not synchronize database state with session
| org.hibernate.StaleObjectStateException: Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect): [org.jbpm.job.Timer#2480]
| at org.hibernate.persister.entity.AbstractEntityPersister.check(AbstractEntityPersister.java:1765)
| at org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:2407)
| at org.hibernate.persister.entity.AbstractEntityPersister.updateOrInsert(AbstractEntityPersister.java:2307)
| at org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:2607)
| at org.hibernate.action.EntityUpdateAction.execute(EntityUpdateAction.java:92)
| at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:250)
| at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:234)
| at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:142)
| at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:298)
| at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27)
| at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000)
| at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:338)
| at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:106)
| at org.jbpm.persistence.db.DbPersistenceService.commit(DbPersistenceService.java:266)
| at org.jbpm.persistence.db.DbPersistenceService.close(DbPersistenceService.java:222)
| at org.jbpm.svc.Services.close(Services.java:294)
| at org.jbpm.JbpmContext.close(JbpmContext.java:136)
| at org.jbpm.job.executor.JobExecutorThread.executeJob(JobExecutorThread.java:190)
| at org.jbpm.job.executor.JobExecutorThread.run(JobExecutorThread.java:60)
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4208614#4208614
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4208614
17 years, 5 months