[Management, JMX/JBoss] - Re: Scheduler Jboss
by norrbom
"ctken" wrote : When I tried using a POJO which implements the Schedulable interface and calls a Session bean's method in it's perform method, it always returns NamingException, although I have already put "depends" tag in the "scheduler-service.xml" file to make sure the session bean's service "jboss.j2ee:service=EJB" and "jboss.j2ee:service=EjbModule" are deployed already before starting the scheduler. Is there any "depends" settings that I have missed?
|
| I am using xDoclet generated Util class of the session bean to locate the Home interface so typo in the JNDI reference is not possible. The session bean has both remote and local interfaces that I have also tried but in vain. Any hints and help will be very much appreciated.
I am experiencing a similar problem, I have a stateless session bean implementing the Schedulable interface and it seems like I cant use any other dependency injected beans from the perform() method.
Do I have to make a JNDI lookup?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3965232#3965232
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3965232
19 years, 10 months
[JBoss Seam] - Re: servlet in seam application
by jason_rency
thanks basel,
I tried to add the your code in my servlet,
em is not null but I got the following exceptions:
2:06:51,995 ERROR [[Calculator]] Servlet.service() for servlet Calculator threw exception
| java.lang.IllegalStateException: No transaction.
| at org.jboss.tm.TxManager.setRollbackOnly(TxManager.java:397)
| at org.hibernate.ejb.AbstractEntityManagerImpl.markAsRollback(AbstractEntityManagerImpl.java:392)
| at org.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException(AbstractEntityManagerImpl.java:545)
| at org.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException(AbstractEntityManagerImpl.java:567)
| at org.hibernate.ejb.AbstractEntityManagerImpl.find(AbstractEntityManagerImpl.java:168)
| at src.reg.server.Calculator.doPost(Calculator.java:46)
another question, I should place the servlet class in the war file if it a pure servlet?
thanks a lot
Jason
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3965228#3965228
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3965228
19 years, 10 months
[JBoss jBPM] - Re: how to retrieve task instance/process instances in a spe
by Olivier_Debels
anonymous wrote : Yes. It is partially true. It is only needed to change the hibernate.cfg.xml to include something like:
That's what I said. You need to create a hibernate.cfg.xml with an additional mapping to your own queries xml.
anonymous wrote : I just don't understand how to add my own jbpm.cfg.xml file. If i do this, what will happen to the existing configuration items in the original jbpm.cfg.xml file?
You can create your own configuration file (default name is "jbpm.cfg.xml" but you can specify another name if you want to in JbpmConfiguration.getInstance() call). This will overwrite the configurations in default.jbpm.cfg.xml. So you just need to add the configuration settings you would like to change in your configuration file.
anonymous wrote : After going through the source code, i found that all the Sessions like GraphSession, TaskMgntSession etc are obtained from JbpmContext which use the DBPersistenceService. And DBPersistenceService hardcode these sessions there.
|
| What i can do is to create my own class like XXXSessioin and initialize it manually because it cannot be availalbe from JbpmContext.
|
| Is this right?
|
| comments?
You can create your own persistenceService and use this one by adding your own DbPersistenceServiceFactory in your configuration file. There you can do whatever your want. Best is to subclass the existing DbPersistenceService and start from there I guess.
Olivier
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3965220#3965220
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3965220
19 years, 10 months
[JBoss Seam] - Re: servlet in seam application
by Basel
Injecting an EntityManager into a servlet is not recommended since the former is not thread safe. Here is what I do in my current web application:
| @PersistenceUnit(name = "myPU")
| private EntityManagerFactory factory;
|
| protected void doGet(HttpServletRequest request,
| HttpServletResponse response) throws ServletException,
| IOException{
| try{
| if(factory == null){
| String name = "java:/myEntityManagerFactory";
| factory = (EntityManagerFactory)
| Naming.getInitialContext().lookup(name);
| }
| if(em == null){
| em = factory.createEntityManager();
| }
| }
| }catch(NamingException e){
| err.println("NamingException when trying to get an " +
| "EntityManager: "+e.getMessage());
| e.printStackTrace();
| }
| }
|
|
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3965218#3965218
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3965218
19 years, 10 months