[JBoss Seam] - Re: Seam 2.0.1GA : EJB Blockers with Weblogic 9.x/10.x
by lauerc
Hi folks,
I'm currently working on the same issues because I'm forced to use BEA WebLogic Server, but like to continue to use JBoss Seam.
I've tried to patch the current Seam version (2.0.1.GA) to get one step beyond the known EJB3 compiler problem. This was quite easy because only one single EJB interface is affected:
org.jboss.seam.async.Dispatcher
I've replaced the varargs definitions (Object...) by Object[], which is what the compiler creates anyway from it. For reasons of convenience, I've also created an method which completely reduces the method to the non variable parts.
Here's an example:
public T scheduleTimedEvent(String type, S schedule, Object... parameters);
was turned into:
public T scheduleTimedEvent(String type, S schedule);
| public T scheduleTimedEvent(String type, S schedule, Object[] parameters);
Maybe this is not as elegant as the varags solution, but it's a pragmatic way to suit our needs as I don't think BEA will fix the related problem in short.
The next problem I stumbled into was a classloading problem related to another problem in BEA WebLogic 10.0 MP1. The server only works properly with it's own jsf implementation which is not deployed by default. It is packed into a war archive located at
wlserver_10.0/common/deployable-libraries/jsf-1.2.war
I tried to deploy this archive which failed, so I unpacked it and placed the included jars into the 'lib' folder below my weblogic domain root.
After that I found out, that one jboss jar, which is needed to run the application under other application servers was missing in the seam distribution. I placed this file (concurrent.jar) into the folder lib below by test application subproject (examples/jee5/lib).
After some more deployment descriptor related changes, which I will not describe in detail, the application seems to work at first.
Unfortunately I detected runtime failures when playing around with the booking application. From time to time the application failed with an InvocationTargetException. After hours of code analyzing and debugging, I found out that the problem has to be a side effect of different EJB lifecycle implementation in WebLogic Server compared to JBoss AS (I don't know which behaviour is wrong or right, and I won't judge it here).
Actually the method postConstruct(...) of class
org.jboss.seam.intercept.SessionBeanInterceptor
seems to rule the initialization of this interceptor. This method seems to be called before any call of aroundInvoke at JBoss AS. On WebLogic Server this is different. As a result of this sometimes the injection field or method invoking for a specific object is executed using the reflection fields and methods of different component classes. To fix this problem, I've copied the initialization calls from method post construct into the method aroundInvoke to make sure that it is called prior to the actual invocation. After this change the booking demo seems to work perfectly.
I've packed all source changes and the missing jar file into one zip archive and will post it into this thread. To use this, simply extract it below the exploded distro archive and rebuild first seam and then the jee5/booking demo.
Best regards,
Christian
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4127228#4127228
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4127228
18 years, 2 months
[JBoss Seam] - Seam Design Question
by tony.herstell@gmail.com
1/
I have a number of resources
say:
Enum {A,B,C,D,E}
I have "Hour Slots" when they are being used.
I have users that can book the resource.
I have created a Conversational Bean to select the resource(s) and now want a show the current bookings (for certain bookings this will be on same page using Ajax as only can book upto 14 days in advance)... so the user can book into slot(s) that are free (this gets more complicated when I have to auto-fit complicated bookings but we won't go there).
My Proposed Solution:
Create a Session Scoped bean (ResourceAllocation) with some members:
AHourSlots
BHourSlots
CHourSlots
etc.
I chose Session as the site won't be hammered so I can afford a few database hits (and storage use) when new users hit the site to book a resource. (I can always move over to Application if need be later)... For now I somehow feel safer (VMS days) to throw away the resources when the session dies as any bugs in keeping it updated are localised to the max duration of a session ;)
I want in my .xhtml page to just have access to the coped variables like:
AHourSlots
BHourSlots
CHourSlots
etc.
And I believe that if I have them in ResourceAllocationImpl anotated with @Factory(scope=ScopeType.SESSION, value="AAllocation")
then this would do the trick.
Is this course likely to cause problems.
(prefer not to have things in components.xml if I can help it as too disjoint from the code).
2/
As the page is ajaxified I end up with the booking all on one page, BUT I want to force the user to log in (or register) before the booking is saved and I cant see a way to do this unless I force them to go to a page which has a loggedIn guard (me thinks a confirmation page)... Is there a way programatically to do summat like this:
public String saveTheBooking() {
String nextNavigationPort = null;
if (!loggedIn) {
seam.core.nestToLogin();
}
if (loggedIn) {
// Park the sucker under the users name
em.persist(booking);
nextNavigationPort = "home";
return nextNavigationPort;
} else {
// Message the user to say refused to login so no-way-hozay
...
}
}
This would be kinda useful for parking the booking part-through (as its quite complicated!)
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4127219#4127219
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4127219
18 years, 2 months