[EJB 3.0] - Re: Create timer -
by rruppel
First of all, thanks very much for starting helping me...
let me say what I am trying to do:
get an interval from database and use this interval to schedule my timer
but, I make this twice in the code
1. when the appplication is deployed
2. at the end of each execution I schedule it again (this is the problem!)
ok, now I will write what I did:
first I have made a mistake at my first code and when I corrected it, the error has changed to:
anonymous wrote :
| Trying to start a new tx when old is not completed
| anonymous wrote :
| |
| | well... this error is exactly what I am doing.... (I agree with the error...lol) so how can I commit the transaction and then call the other method to shedule?
| |
| | I tryed some things, and what make me confuse is:
| |
| | when the application is deployed it schedules fine the timer.... maybe because it calls the "schedule" method through a Local interface, like you suggested
| |
| | I suppose that calling the method through the Local interface completes the transactions before calling the method.... but is it right? (I think it shouldnt)
| |
| | well... like the @Timeout method is the one that has to schedule the next execution... i cant call the schedule method through a @Local interface (only if it would be possible to have an instance of the own class injected on it... I can try this... but its ugly)
| |
| | I will help any advice... thanks
| |
| |
| | ps: I havent seem oscar message before
| |
| | oscar, I thought using this solution, but I know that circular reference is a problem with jboss (at least ive never found a solution)
| |
| | thanks for trying to help
| |
| |
| |
| |
| |
| |
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4139495#4139495
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4139495
16 years, 9 months
[EJB 3.0] - Re: Create timer -
by oskar.carlstedt
Hmm... and now you're back where you started, aren't you?
This is a pretty annoying problem. Is there a working example of doing this within an EJB? Is the following solution possible?
| @Stateless
| @Local
| public class A {
|
| @EJB
| B b;
|
| /**
| * this method is the one that is invoked by the 'user'
| **/
| public void someBusinessMethodThatHasToCreateATimer(...) {
| ...
| b.startTimer();
| }
|
|
| /**
| * this method will do the timeout job
| **/
| public void handleTimeout(Timer timer) {
| ...
| }
|
| }
|
|
| /**
| * this is a wrapper class to get a new transaction that only has to
| * deal with one data source in its own transaction.
| **/
| @Stateless
| @Local
| public class B {
|
| @Resource
| EJBContext ejbContext;
|
| @EJB
| A a;
|
| /**
| * this method is invoked by A. the result shall be
| * a created and persisted timer.
| **/
| public void startTimer() {
| ejbContext.getTimerService().createTimer(...);
| }
|
| /**
| * handles the timeout and will not do anything more
| * than just call the handleTimeout in A.
| **/
| @Timeout
| public void timeout(Timer timer) {
| a.handleTimeout(timer);
| }
|
| }
|
|
This is not a nice solution using a circular reference, but is there any other way get around this problem without reconfiguring JBoss?
Cheers
/Oskar
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4139492#4139492
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4139492
16 years, 9 months
[Persistence, JBoss/CMP, Hibernate, Database] - Re: why nobody talks openJPA here?
by ajay662
Let me wrap up my findings for the benefit of others.
I ended up using Hibernate.
With 0.9.7 openjpa, i ran into the error that others have experienced too: org.apache.openjpa.persistence.PersistenceException: Invalid use of
| destroyed classloader, UCL destroyed at:
With 1.0 openjpa, my application came up ok but I saw all kinds of strange runtime errors.
So I gave up on openjpa and switched to hibernate.
But switching to Hibernate was not all that straight forward. It seems there are some inconsistencies between hibernate and openjpa when it comes to @IdClass. The two that I faced were :
1) Hibernate picks up the annotations from @IdClass, whereas openJPA picks up from the Entity class.
2) Hibernate needs both name and type of the id fields to be same in Entity class and IdClass, whereas OpenJPA wants type of the @ManyToOne field in the IdClass to be that of the primary key of the associated table.
Once I aligned my code to what hibernate wants, my application came up ok.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4139482#4139482
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4139482
16 years, 9 months
[JBoss jBPM] - Re: HTTP Status 403 - Access to the requested resource has b
by wootenator
Thanks for the suggestions.
I tried these suggestions but still have the same issue. I added these roles to the web.xml since only admin was present initially and redeployed the war file. I checked this several times and it seems to be OK now.
The URL I am hitting is the one they tell you to use in the book:
http://localhost:8080/jbpm-console
When I go there I see the following sample users listed next to the credentials input fields :
user name_____________password_____________ group
manager **************manager ***********user,manager,admin
-----------------------------------------------------------------------
user ****************** user **************user
-------------------------------------------------------------------
shipper ***************shipper ************** user
-----------------------------------------------------------------
admin ***************admin***************user,admin
I tried adding powellb into the manager and admin groups. He was already in the participants group via the SQL script from the book.
The following security constraint is present in the web.xml:
<security-constraint>
<web-resource-collection>
<web-resource-name>Secure Area</web-resource-name>
<url-pattern>/sa/*</url-pattern>
<http-method>GET</http-method>
<http-method>POST</http-method>
</web-resource-collection>
<auth-constraint>
<role-name>user</role-name>
</auth-constraint>
</security-constraint>
I can login ok as manager/manager and admin/admin. These credentials allow me to login and view all the deployed processes, tokens, tasks,etc so I believe the JPBM process deployed. when I changed the role-name above from "user" to "powellb" then couldn't log in as manager anymore, so changed that back. My assumption is that powellb should take me to the form for swimlane"Talent scout", but the url I am redirected towards is http://localhost:8080/jbpm-console/sa/processes.jsf
In the book the URL seems to be
http://localhost:8080/jbpm-console/search/tasks.jsf
but after logging in as manager/manager I put that URL in the browser and get:
HTTP Status 404 - /jbpm-console/search/tasks.jsf
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4139472#4139472
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4139472
16 years, 9 months