[JBoss Seam] - ManagedEntityIdentityInterceptor and Stateful Session Beans
by wschwendt
Can anyone enlighten me why the ManagedEntityIdentityInterceptor is only added to a Seam component when the scope of the component is CONVERSATION? (-> org.jboss.seam.Component.initDefaultInterceptors() )
My understanding of the ManagedEntityIdentityInterceptor (which could be wrong) is that it serves to ensure that Entities referenced by a stateful component such as a stateful session bean (SFSB) maintain their object identity within the JVM even across passivations and reactivations of this stateful component.
Let's assume that we have a stateful session bean (SFSB) referencing an Entity instance, and the the scope of the SFSB is EVENT_Scope. Since the scope is EVENT Scope and not CONVERSATION scope, no ManagedEntityIdentityInterceptor is added to this SFSB.
Let's imagine further a situation where this SFSB is called multiple times during the life time of the EVENT scope. For example, the SFSB could serve as backing bean for multiple JSF view components and be called multiple times during the render response JSF phase.
This raises the question: Can it happen that the EJB container passivates and then reactivates this SFSB between the different calls to this SFSB? (I'd assume yes, but could be wrong).
If I'm not wrong with my "yes"-assumption, don't we need the ManagedEntityIdentityInterceptor added to this event-scoped SFSB component to maintain the object identity of any Entity instances referenced by the SFSB?
Thanks in advance for any answers.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4084750#4084750
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4084750
18 years, 9 months
[JBoss jBPM] - A tutorial to deploy a Netbeans created BPEL process under J
by ZazzaZ
Hi,
this is a tutorial to deploy a Netbeans created bpel to
jboss 4.0.5 + jbpm-bpel 1.1.3 beta.
So no reply as bug report is necessary.
Suppose the name of the .bpel is processo.bpel and
you have all the wsdl the bpel requires in the same dir.
You've to replace processo with your process name
Follow these steps
1)Go to examples dir of your jbpm-bpel installation and
create a folder with the same name of the .bpel file.
In this tutorial processo.
1.1 Copy from hello example the build file and replace
"hello" with your process dir name (processo)
1.2 Create dir src. Inside src, bpel. Inside bpel META-INF.
1.3 In bpel dir copy all the files .bpel and .wsdl.
1.4 In META-INF copy bpel-application from hello/src/bpel/META-INF
and open it replacing hello with processo.
1.5 If jboss server isn't up, make it running (run.sh or rub.bat)
1.6 From example/process run ant deploy-definition
1.7 You've done a successfull deploy if you got a 200 code response
from the server.
2) From example/process run ant generate-service
This operation will create under the target dir under example/processo
some files...
3) The hottest part. Making artifacts...
3.1 From hello/src/main/resources copy all files and dir to processo/src/main/resources
3.2 Open wscompile.xml and replace hello with processo
E.g.
<?xml version="1.0"?>
3.3 Same operation for wstools.xml
Esempio
<?xml version="1.0"?>
<package-namespace package="org.jbpm.bpel.tutorial.processo"
namespace="http://jbpm.org/examples/processo" />
<wsdl-java file="wsdl/processo-service.wsdl">
</wsdl-java>
3.4 Go to target/resources/web and open processo-service.wsdl
and processo-binding.wsdl. You can now read important info to
correctly fill the fields of files for artifacts.
3.5 Go to src/main/resources/web and open webservice.xml and web.xml
3.6 In web.xml modify the word Greeter with the one you prefer.
3.7 Modify webservice.xml as follows:
3.4.1 web service description name: whatever you want
3.4.2 wsdl-file: the one tool-generated and that you can find under target/resources/web
It is the -service.wsdl terminating file (processo-service.wsdl).
3.4.3 port-component-name : The one you find in the (processo)-service.wsdl as attribute name of port.
3.4.4 service-endpoint-interface: whatever you want. This name will be used to generate a class.
3.4.5 servlet-link: the one you type in web.xml for tag servlet-name
3.4.6 handler-name: whatever you want
3.5 Go to examples/processo and console type ant generate-artifacts
4) The last step: deploy and interface writing
In web.xml you specified a servlet class
<servlet-class>org.jbpm.bpel.tutorial.processo.Client_Impl</servlet-class>
In src/main/java you have to recreate the same dir structure
(/src/main/java/org/jbpm/bpel/tutorial/processo) and the file
(Client_Impl.java).
This class has to implement the interface Client that has been create in
example/target/java/.....
Implement the interface.
4.1 Go to processo-binding you find in target/resources/web/wsdl and add
import for client. I.e. the webservice providing the info for the receive
and reply operation underthe bpel file
Don't type ant deploy or you'll see org.jboss.ws.WSException in server log
saying it isn't able to find the port type in the specified namespace
4.2 Modificy jaxrpc-mapping.xml and processo-service.wsdl. To find the proper values
you have to find the wsdl of the Client. Es Client.wsdl
4.2.1 --> jaxrpc-mapping.xml
<port-name>ClientPortType</port-name>
<java-port-name>ClientPortType</java-port-name>
You can read this values from Client.wsdl in field
<wsdl:portType name="ClientPortType">
Do the same with
<wsdl-port-type xmlns:portTypeNS="http://j2ee.netbeans.org/wsdl/Client">portTypeNS:ClientPortType</wsdl-port-type>
<wsdl-binding xmlns:bindingNS="http://j2ee.netbeans.org/wsdl/Client">bindingNS:ClientBinding</wsdl-binding>
and type for binding the value you find for Client.wsdl for binding
<wsdl:binding name="ClientBinding" type="tns:ClientPortType">
4.3 In examples/processo type ant deploy and if you read in server log something like
INFO [TomcatDeployer] deploy, ctxPath=/processo, warUrl=.../tmp/deploy/tmp28869processo-exp.war/
WARN [ProxyWarnLog] Narrowing proxy to class org.jbpm.bpel.graph.def.CompositeActivity - this operation breaks ==
INFO [IntegrationConfigurator] Message reception enabled for process: HelloWorld
INFO [WSDLFilePublisher] WSDL published to: file:/home/zazzaz/Tesi_Workflow/jboss-4.0.5.GA/server/default/data/wsdl/processo.war/processo-service.wsdl
INFO [ServiceEndpointManager] WebService started: http://zazzaz-desktop:8080/processo/client
you won!
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4084745#4084745
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4084745
18 years, 9 months
[JNDI/Naming/Network] - ejb-jar.xml (env-entry) ignored when jboss.xml is present (.
by n.lindberg
Hello you all!
We have a problem which we've been sitting with for a couple of hours. The problem is that we have an ejb-jar.xml with env-entry for the beans. We have jboss.xml that defines the JNDI names of the beans.
Code uses @Resource to get the string values from the env-entry.
Getting desperate.. (Also posted to EJB3 forum... Hard to define the context).
We're running JBoss 4.2.1
When Jboss.xml is not present we get @Resource injection to work but the default JNDI binding.
When JBoss.xml i present we get the intended JNDI name but ResourceHandler log complains:
Code:
"14:36:16,125 WARN [ResourceHandler] Not injecting nodeID, no matching enc injec
tor env/nodeID found"
| jboss.xml
| <?xml version="1.0" encoding="utf-8" ?>
| <jboss>
| <enterprise-beans>
| <service>
| <ejb-name>WitnessServiceBean</ejb-name>
| <jndi-name>NotaryA/witness1/WitnessServiceBean/remote</jndi-name>
| </service>
| </enterprise-beans>
| </jboss>
| ejb-jar.xml
| <?xml version="1.0" encoding="utf-8" ?>
| <ejb-jar xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd" version="3.0">
| <enterprise-beans>
| <session>
| <ejb-name>WitnessServiceBean</ejb-name>
| <env-entry>
| <env-entry-name>nodeID</env-entry-name>
| <env-entry-type>java.lang.String</env-entry-type>
| <env-entry-value>NotaryA</env-entry-value>
| </env-entry>
| <env-entry>
| <env-entry-name>serviceID</env-entry-name>
| <env-entry-type>java.lang.String</env-entry-type>
| <env-entry-value>witness1</env-entry-value>
| </env-entry>
| </session>
| </enterprise-beans>
| </ejb-jar>
| Code: In StatessSessionBean
| @Resource(name="nodeID")
| private String nodeID;
|
| @Resource(name="serviceID")
| private String serviceID;
Extremly thankful for any help on this... Deadline coming up..
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4084737#4084737
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4084737
18 years, 9 months
[EJB 3.0] - JBoss neglects ejb-jar.xml when jboss.xml is present (EJB3)
by n.lindberg
Hello you all!
We have a problem which we've been sitting with for a couple of hours. The problem is that we have an ejb-jar.xml with env-entry for the beans. We have jboss.xml that defines the JNDI names of the beans.
Code uses @Resource to get the string values from the env-entry.
We're running JBoss 4.2.1
When Jboss.xml is not present we get @Resource injection to work but the default JNDI binding.
When JBoss.xml i present we get the intended JNDI name but ResourceHandler log complains:
"14:36:16,125 WARN [ResourceHandler] Not injecting nodeID, no matching enc injec
| tor env/nodeID found"
jboss.xml
| <?xml version="1.0" encoding="utf-8" ?>
| <jboss>
| <enterprise-beans>
| <service>
| <ejb-name>WitnessServiceBean</ejb-name>
| <jndi-name>NotaryA/witness1/WitnessServiceBean/remote</jndi-name>
| </service>
| </enterprise-beans>
| </jboss>
ejb-jar.xml
| <?xml version="1.0" encoding="utf-8" ?>
| <ejb-jar xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd" version="3.0">
| <enterprise-beans>
| <session>
| <ejb-name>WitnessServiceBean</ejb-name>
| <env-entry>
| <env-entry-name>nodeID</env-entry-name>
| <env-entry-type>java.lang.String</env-entry-type>
| <env-entry-value>NotaryA</env-entry-value>
| </env-entry>
| <env-entry>
| <env-entry-name>serviceID</env-entry-name>
| <env-entry-type>java.lang.String</env-entry-type>
| <env-entry-value>witness1</env-entry-value>
| </env-entry>
| </session>
| </enterprise-beans>
| </ejb-jar>
Code: In StatessSessionBean
| @Resource(name="nodeID")
| private String nodeID;
|
| @Resource(name="serviceID")
| private String serviceID;
Extremly thankful for any help on this... Deadline coming up..
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4084733#4084733
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4084733
18 years, 9 months
[EJB 3.0] - Re: unable to find LoginModule class
by JPagera
Hi friend
thankx vr muh 4 ur hlp
the problem was im using 2 copy of JBoss and i used the one who dont has my login module jar file
i just forgot to chang th JBOSS_HOME...........
but i faced another exception
i run JSF page the code here run oky and the login succed
...............................
String securityDomain = "JPassivateSecurityDomain";
CallbackHandler callbackHandler =
new JPageraCallbackHandler("name","pass");
LoginContext lc =
new LoginContext( securityDomain,
callbackHandler );
lc.login();
......................................................
but when i tried to lookup Session it didnt get me exception
like that
...................................................
Properties pro = new Properties();
pro.put(Context.INITIAL_CONTEXT_FACTORY,"org.jnp.interfaces.NamingContextFactory");
pro.put(Context.URL_PKG_PREFIXES,"org.jboss.naming:org.jnp.interfaces");
pro.put(Context.PROVIDER_URL,"jnp://jpagera:1099");
pro.put(Context.SECURITY_PRINCIPAL,"name");
pro.put(Context.SECURITY_CREDENTIALS,"pass");
try {
final Context context = new InitialContext(pro);
session = context.lookup(sessionName);
} catch (Exception ex) {
ex.printStackTrace();
}
......................................................
but when im tryin to use the Session it gave these exceptions
session.callMethod();
Exception ...
javax.ejb.EJBAccessException: Authentication failure
at org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.handleGeneralSe
curityException(Ejb3AuthenticationInterceptor.java:70)
at org.jboss.aspects.security.AuthenticationInterceptor.invoke(Authentic
ationInterceptor.java:70)
at org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.invoke(Ejb3Auth
enticationInterceptor.java:102)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.
java:101)
at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterce
ptor.java:47)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.
java:101)
at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(Asynchrono
usInterceptor.java:106)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.
java:101)
at org.jboss.ejb3.stateless.StatelessContainer.dynamicInvoke(StatelessCo
ntainer.java:263)
at org.jboss.ejb3.remoting.IsLocalInterceptor.invoke(IsLocalInterceptor.
java:58)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.
java:101)
at org.jboss.ejb3.stateless.StatelessRemoteProxy.invoke(StatelessRemoteP
roxy.java:102)
at $Proxy100.findAllUserTab(Unknown Source)
...........................................................
i dont know where is the problem did my lookedup correctly ???
in OC4J
when using Custom login module u should gave the RMI lookup specefic ROLE
that every user lookingup any Session ( by using my custom login module ) he must has that Role ............
its like that ..................
<grant>
| <grantee>
| <principals>
| <principal>
| <class>com.jpagera.login.JPageraPrincipal</class>
| <name>JPageraAdminRole</name>
| </principal>
| </principals>
| </grantee>
| <permissions>
| <permission>
| <class>com.evermind.server.rmi.RMIPermission</class>
| <name>login</name>
| </permission>
| </permissions>
| </grant>
In %OC4J_HOME%\j2ee\home\config\system-jazn-data.xml
all my user must has this ROLE ( JPageraAdminRole )
it just give him the permission to using RMI to lookup Sessions
....................................
is there anything like that in JBoss ..
( should i gave my Users some kind of role to enable them to lookingup an Session )
and Tnk u vy muh 4 hlp
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4084731#4084731
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4084731
18 years, 9 months