[EJB 3.0] - Re: Parameters by context
by Andre1001
I've tried with...
Client:
| Properties properties = new Properties();
| properties.put("lingua","portugues");
| Context c1 = new InitialContext(properties);
|
EJB (Session Stateless):
@Resource SessionContext ctx;
| String x = ctx.getEnvironment().getProperty("lingua");
|
but getEnvironment() is deprecated...
org.jboss.soa.esb.actions.ActionProcessingException: Unexpected invocation target exception from processor
| at org.jboss.soa.esb.listeners.message.ActionProcessorMethodInfo.processMethods(ActionProcessorMethodInfo.java:127)
| at org.jboss.soa.esb.listeners.message.OverriddenActionLifecycleProcessor.process(OverriddenActionLifecycleProcessor.java:74)
| at org.jboss.soa.esb.listeners.message.ActionProcessingPipeline.process(ActionProcessingPipeline.java:262)
| at org.jboss.soa.esb.listeners.message.MessageAwareListener$1.run(MessageAwareListener.java:297)
| at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
| at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
| at java.lang.Thread.run(Unknown Source)
| Caused by: javax.ejb.EJBException: Deprecated
| at org.jboss.ejb3.BaseSessionContext.getEnvironment(BaseSessionContext.java:265)
| at com.buscape.cep.facade.CepFACADEBean.persiste(CepFACADEBean.java:64)
| at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
| at java.lang.reflect.Method.invoke(Unknown Source)
|
Any tip?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4074527#4074527
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4074527
18Â years, 11Â months
[JNDI/Naming/Network] - Stop starting of JBoss when naming relevant ports already in
by neutro82
Hi,
I have the following Problem, we have an application running in a JBoss 3.2.3 Application Server.
Our clients are communicating with the EJBs using the default ports (1098,1099).
It occured the sometimes these ports are already an use and so the naming services can't be started, or at least they are not reachable from outside JBoss.
Changing the ports to different numbers seemed to help at first, but from time to time these other ports are also already in use.
Of course it is not a big problem to tell our customers how to handle this (shut down JBoss, find out which process blocks the port and kill it and start jboss again, or simply reboot), but the problem is the users might not know the problem occur. After rebooting they check whether the web-application is running (and it is) and so they assume everything is alright.
So, long story, short question:
is it possible to prevent JBoss from starting when any of these ports are already in use?
Thanks in advance
SVen
PS: sorry if this post is in the wrong forum, I wasn't sure whether to post in configuration or here :)
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4074519#4074519
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4074519
18Â years, 11Â months
[JBoss Seam] - session scoped variable lost after page action
by FredF
Hello
I have a facelet view that triggers an page action when it loads.
<page view-id="/userPage.xhtml">
| <param name="member" value="#{visitedUserAction.member}" />
| <action
| execute="#{visitedUserAction.initContentProviderAccount}" />
| </page>
@Stateful
| @Name("visitedUserAction")
| @AutoCreate
| public class VisitedUserActionBean implements VisitedUserAction {
|
| private String segment;
|
| private String member;
|
| @EJB
| private ContentProviderAccountDao contentProviderAccountDao;
|
| @Out(required = false, scope = ScopeType.SESSION)
| private ContentProviderAccount contentProviderAccount;
|
| @Logger
| private Log log;
|
| public void initContentProviderAccount() {
| log.info("getting current visited contentProviderAccount for page=" + member);
|
| ContentProviderAccount contentProviderAccount = null;
| try {
| contentProviderAccount = contentProviderAccountDao.findByStageUrlName(member);
| log.info("fetched contentProviderAccount=" + contentProviderAccount);
| if (contentProviderAccount.getProviderSegment().name().toLowerCase()
| .equals(segment.toLowerCase())) {
| log.info("setting contentProviderAccount to " + contentProviderAccount);
| this.contentProviderAccount = contentProviderAccount;
| } else {
| // fixme: redirect to either user not found page or search page
| throw new RuntimeException("user does not exist in segment, however there is one in: "
| + contentProviderAccount.getProviderSegment().toString());
| }
|
| } catch (ContentProviderAccountDaoException e) {
| // fixme: redirect to either user not found page or search page
| throw new RuntimeException("user is not found ");
| }
|
| }
|
| @Create
| public void logthis() {
| log.info("will this run?");
| }
|
| public String getSegment() {
| return segment;
| }
|
| public void setSegment(String segment) {
| this.segment = segment;
| }
|
| public String getMember() {
| return member;
| }
|
| public void setMember(String member) {
| this.member = member;
| }
|
| @Destroy
| @Remove
| public void destroy() {
| }
|
| }
Then I want to find the sessionscoped variable and inject it into another stateful bean.
@javax.ejb.Stateful
| @Name("artistpresentaton")
| public class ArtistPresentationActionBean extends com.yourstardom.middle.ArtistPresentationActionBase
| implements com.yourstardom.middle.ArtistPresentationActionLocal,
| com.yourstardom.middle.ArtistPresentationActionRemote {
|
| @In
| private ContentProviderAccount contentProviderAccount;
|
| ...
| }
This works fine when I do a non-faces request to the view but when I execute an action in the ArtistPresentationActionBean from the view and the response is rendered, contentProviderAccount is null and I get the exception
Caused by javax.el.ELException with message: "javax.ejb.EJBTransactionRolledbackException: In attribute requires non-null value: artistpresentation.contentProviderAccount"
why?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4074506#4074506
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4074506
18Â years, 11Â months