[EJB 3.0] - Re: injection SFSB to SLSB
by xmedeko
I have a similar problem with JBoss 5.0.1 GA. I have one SFSB (which holds some data) with only local business interface . And several SLSBs with remote interfaces. All SLSBs inject the SFSB using @EJB. I have a standalone Swing client accessing the SLBS. I have observed that:
- Each SLSB inject new SFSB although the session is the same.
- When the session is removed (by a business method marked as @Remove), the next call to a SLBS throws "javax.ejb.NoSuchEJBException: Could not find stateful bean: all5z-81lkw2-ftl86qub-1-ftl9srgf-a0". I suspect (like the previous post), that @EJB is not refreshed each time the SLBS is called, but only when it is created.
Is this a normal behaviour or a bug?
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4225854#4225854
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4225854
17 years, 3 months
[EJB 3.0] - Using remote EJB by annotation
by abednarski
Hi,
My scenario is:
a) jboss server A (ip a.a.a.a) - client - application wants to access through annotation (inject and execute method) on ejb located on other server
b) jboss server B (ip b.b.b.b) - ejb - other server containing ejb which I want to access
Where:
a) jboss server A ip address is a.a.a.a and name dns name is jbossa
b) jboss server B ip address is b.b.b.b and name dns name is jbossb
I was trying to follow this article: http://www.mastertheboss.com/en/jboss-application-server/49-jboss-ejb3-in... part: "
How can a remote client access a clustered EJB ?" but I don't want to cluster 2 jboss servers
I added to jboss server A in ...jboss/server/default/conf/jndi.properties new line (none of them allowed to pass my scenario):
a) java.naming.provider.url=jbossb:1099
b) java.naming.provider.url=jnp://b.b.b.b:1099
c) java.naming.provider.url=jbossa:1099,jbossb:1099
d) java.naming.provider.url=jnp://a.a.a.a:1099,jnp://b.b.b.b:1099
and according to article I should add @Clustered but I did not (I don't want to use cluster).
When I'm trying to inject EJB in client on jboss server A I got typical exception "MyBean is not bound".
My questions:
1) Is it possible to access remote EJB using annotation without clustering jboss servers ?
2) Is it possible to use access EJB using annotation clustering jboss servers?
3) Is clustering only option to access remote EJB when using annotation?
4) What is the overhead when two jboss servers are clustered?
5) Is it possible to setup clustering in a way that it will only support using remote ejb without other functionality (to limit overhead)?
Regards,
Adam.
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4225843#4225843
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4225843
17 years, 3 months
[JBoss Portal] - JBossRenderResponse cannot be cast to HttpServletResponse
by Likurg
Hello. I have to make some additional code changes in project, which is built on jboss portal. Deployment is ok, but when I try to refres localhost:8080/portal page after deployment I get this:
| java.lang.ClassCastException: org.jboss.portlet.JBossRenderResponse cannot be cast to javax.servlet.http.HttpServletResponse
|
This exception occurs in PhaseListener:
| FacesContext facesContext = event.getFacesContext();
| HttpServletResponse response = (HttpServletResponse)facesContext.getExternalContext().getResponse();
|
Here is configuration:
portlet.xml:
| <portlet-app
| xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
| xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
| version="1.0">
| <portlet>
| <portlet-name>SomePortlet</portlet-name>
| <portlet-class>
| some.some.MyfacesRepairedPortlet
| </portlet-class>
| <init-param>
| <name>default-view</name>
| <value>/jsp/welcome.jsp</value>
| </init-param>
| <supports>
| <mime-type>text/html</mime-type>
| <portlet-mode>VIEW</portlet-mode>
| </supports>
| <portlet-info>
| <title>Some Portlet</title>
| </portlet-info>
| <security-role-ref>
| <role-name>ADMIN</role-name>
| <role-name>ADMIN</role-name>
| </security-role-ref>
|
| <security-constraint>
| <portlet-collection>
| <web-resource-name>SomePortlet</web-resource-name>
| <url-pattern>*.jsp</url-pattern>
| </portlet-collection>
| <!--auth-constraint>
| <role-name>ADMIN</role-name>
| </auth-constraint-->
| <user-data-constraint>
| <transport-guarantee>NONE</transport-guarantee>
| </user-data-constraint>
| </security-constraint>
|
| </portlet>
| </portlet-app>
|
portlet-instances.xml:
| <?xml version="1.0" standalone="yes"?>
| <deployments>
| <deployment>
| <instance>
| <instance-id>SomeInstance</instance-id>
| <portlet-ref>SomePortlet</portlet-ref>
| </instance>
| </deployment>
| </deployments>
|
some-object.xml:
| <?xml version="1.0" encoding="UTF-8"?>
| <deployments>
| <deployment>
| <if-exists>overwrite</if-exists>
| <parent-ref>default.default</parent-ref>
| <window>
| <window-name>SomePortletWindow</window-name>
| <instance-ref>SomeInstance</instance-ref>
| <region>center</region>
| <height>1</height>
| </window>
| <security-constraint>
| <policy-permission>
| <role-definition>ADMIN</role-definition>
| <action-name>viewrecursive</action-name>
| </policy-permission>
| </security-constraint>
| </deployment>
| </deployments>
|
jboss-web.xml:
| <?xml version="1.0" encoding="UTF-8"?>
| <!DOCTYPE jboss-web
| PUBLIC "-//JBoss//DTD Web Application 2.2//EN"
| "http://www.jboss.org/j2ee/dtd/jboss-web.dtd">
|
| <jboss-web>
| <security-domain>java:/jaas/some</security-domain>
| </jboss-web>
|
jboss-portlet.xml:
| <?xml version="1.0" encoding="UTF-8"?>
| <portlet-app>
| <portlet>
| <portlet-name>SomePortlet</portlet-name>
| <header-content>
| <link rel="stylesheet" type="text/css" href="/css/styles.css" title="" media="screen"/>
| </header-content>
| </portlet>
| </portlet-app>
|
And finally:
MyFacesRepairedPortlet:
| public class MyfacesRepairedPortlet extends MyFacesGenericPortlet{
|
| protected void facesRender(RenderRequest request, RenderResponse response) throws PortletException,
| java.io.IOException {
| if (sessionTimedOut(request) || request.getPortletSession().getAttribute(CURRENT_FACES_CONTEXT) == null) {
| setPortletRequestFlag(request);
| nonFacesRequest(request, response);
| return;
| }
|
| super.facesRender(request, response);
| }
|
|
| }
|
Please help!!
With Best Wishes, Maxim
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4225827#4225827
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4225827
17 years, 3 months