[Beginners Corner] - Exextion when deploying EJB's
by md_tanveer_pasha
Hi all
, iam getting an exception when iam deploying EJB 's on Jboss can anybody suggest me whats wrong and a solution to this problem
Regards Tanveer Pasha
13:46:03,233 INFO [EjbModule] Deploying TodoEntityBean
13:46:03,327 WARN [EjbModule] Could not load the org.jboss.resource.connectionmanager.CachedConnectionInterceptor interceptor for this container
javax.management.InstanceNotFoundException: jboss.jca:service=CachedConnectionManager is not registered.
at org.jboss.mx.server.registry.BasicMBeanRegistry.get(BasicMBeanRegistry.java:354)
at org.jboss.mx.server.MBeanServerImpl.getAttribute(MBeanServerImpl.java:442)
at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.(CachedConnectionInterceptor.java:72)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at java.lang.Class.newInstance0(Unknown Source)
at java.lang.Class.newInstance(Unknown Source)
at org.jboss.ejb.EjbModule.addInterceptors(EjbModule.java:812)
at org.jboss.ejb.EjbModule.initializeContainer(EjbModule.java:698)
at org.jboss.ejb.EjbModule.createEntityContainer(EjbModule.java:552)
at org.jboss.ejb.EjbModule.createContainer(EjbModule.java:466)
at org.jboss.ejb.EjbModule.createService(EjbModule.java:280)
at org.jboss.system.ServiceMBeanSupport.create(ServiceMBeanSupport.java:158)
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)
at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:546)
at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:976)
at $Proxy14.create(Unknown Source)
at org.jboss.system.ServiceController.create(ServiceController.java:310)
at org.jboss.system.ServiceController.create(ServiceController.java:243)
at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:546)
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
at $Proxy12.create(Unknown Source)
at org.jboss.ejb.EJBDeployer.create(EJBDeployer.java:523)
at org.jboss.deployment.MainDeployer.create(MainDeployer.java:786)
at org.jboss.deployment.MainDeployer.create(MainDeployer.java:778)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:641)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:605)
at sun.reflect.GeneratedMethodAccessor30.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:546)
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
at $Proxy6.deploy(Unknown Source)
at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:302)
at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:476)
at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:201)
at org.jboss.deployment.scanner.AbstractDeploymentScanner.startService(AbstractDeploymentScanner.java:274)
at org.jboss.system.ServiceMBeanSupport.start(ServiceMBeanSupport.java:192)
at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:546)
at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:976)
at $Proxy0.start(Unknown Source)
at org.jboss.system.ServiceController.start(ServiceController.java:394)
at sun.reflect.GeneratedMethodAccessor8.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:546)
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
at $Proxy4.start(Unknown Source)
at org.jboss.deployment.SARDeployer.start(SARDeployer.java:226)
at org.jboss.deployment.MainDeployer.start(MainDeployer.java:832)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:642)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:605)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:589)
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)
at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:546)
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
at $Proxy5.deploy(Unknown Source)
at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:384)
at org.jboss.system.server.ServerImpl.start(ServerImpl.java:291)
at org.jboss.Main.boot(Main.java:150)
at org.jboss.Main$1.run(Main.java:395)
at java.lang.Thread.run(Unknown Source)
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3993741#3993741
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3993741
19 years, 7 months
[JBoss Seam] - Re: Basic Seam questions
by lightbulb432
I have made a simple example below that doesn't seem to be working. It creates an entity (Person) over two independent JSF action methods:
@Stateful
| @Name("register")
| public class RegisterBean implements Register {
|
| @PersistenceContext(type=EXTENDED)
| private EntityManager em;
|
| @In(create=true) @Out
| private Person person;
|
| private String firstName;
| private String lastName;
|
| public String firstName() {
|
| person.setFirstName(getFirstName());
|
| em.persist(person);
|
| return "success";
|
| }
|
| public String lastName() {
|
| person.setLastName(getLastName());
|
| em.merge(person);
|
| return "success";
|
| }
|
| @Remove
| @Destroy
| public void destroy() {
|
| }
|
| }
I have a few questions on this example, but first, am I doing this correctly? Do I have the persist() and merge() in the correct places? Or should I remove the persist() and merge() and just have one persist() in lastName() - assuming lastName() is the second method to be called?
Is an EXTENDED persistence context correct here?
I'm getting an error in the second method, saying that "Exception during INVOKE_APPLICATION(5): javax.persistence.PersistenceException: org.hibernate.PropertyValueException: not-null property references a null or transient value: "
Here's the problem. When I call the firstName() method, followed by the lastName() method, the lastName() method seems to create a brand new Person. This Person gets a lastName, does not pick up the firstName from the previous method invocation, and triggers a PropertyValueException because of the validation annotation on the entity...whoa!
What am I doing wrong? Any help would be greatly appreciated. Thanks.
P.S. I don't call the destroy() method anywhere in the code at all. And, while I define destroy in the business interface, I don't define the annotations there...should I?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3993733#3993733
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3993733
19 years, 7 months
[Security & JAAS/JBoss] - Re: User credentials lost after remote EJB call
by annie1234
I have tried this with SP1 & with 4.0.5GA as suggested and still encountered the same problem.
Just to clarify:
Before we make the remote call, we can see the original user:
org.jboss.security.SecurityAssociation.pushSubjectContext,subject=Subject: Principal:AdminPrincipal:Roles(members:Admin),sc=org.jboss.security.SecurityAssociation$SubjectContext@1dadaa{principal=Admin,subject=7645779}
org.jboss.security.SecurityAssociation.getSubject,sc=org.jboss.security.SecurityAssociation$SubjectContext@1dadaa{principal=Admin,subject=7645779}
And then when we make the remote call, we can see the remote user being setup:
org.jboss.security.SecurityAssociation.setCredential,sc=org.jboss.security.SecurityAssociation$SubjectContext@1bb7285{principal=null,subject=null}
org.jboss.security.SecurityAssociation.setPrincipal,p=remoteAdmin,server=true
org.jboss.security.SecurityAssociation.setPrincipal,sc=org.jboss.security.SecurityAssociation$SubjectContext@1bb7285{principal=remoteAdmin,subject=null}
org.jboss.security.SecurityAssociation.getPrincipal,principal=remoteAdmin
And then we see the original security logs I posted before.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3993731#3993731
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3993731
19 years, 7 months
[JNDI/Naming/Network] - java.lang.ClassNotFoundException: org.jnp.interfaces.NamingC
by forumer
JBoss 4.0.4-CR2, EJB 3.0
I have a client which accesses EJB's successfully when I create the InitialContext as follows:
| ctx.addToEnvironment("java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory");
| ctx.addToEnvironment("java.naming.factory.url.pkgs", "org.jboss.naming:org.jnp.interfaces");
| ctx.addToEnvironment(Context.PROVIDER_URL,"jnp://localhost:1099");
|
|
|
However, if I place these properties in a jndi.properties file, instead, under a folder and include this folder in the classpath
|
| java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
| java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
| java.naming.provider.url=jnp://localhost:1099
|
|
I get the error:
|
| javax.naming.NoInitialContextException: Cannot instantiate class: org.jnp.interfaces.NamingContextFactory [Root exception is java.lang.ClassNotFoundException: org.jnp.interfaces.NamingContextFactory ]
| at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:657)
| at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:247)
| at javax.naming.InitialContext.init(InitialContext.java:223)
| at javax.naming.InitialContext.<init>(InitialContext.java:175)
|
|
I'd like to use a jndi.properties file instead of doing it in the code.
I'd appreciate any suggestions on why this might be happening.
Thanks
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3993730#3993730
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3993730
19 years, 7 months
[Security & JAAS/JBoss] - How to avoid caching username and password in sharedstate
by purna_cherukuri
Hi,
My login-config.xml is like this.
Code:
| <?xml version='1.0'?>
| <!DOCTYPE policy PUBLIC
| "-//JBoss//DTD JBOSS Security Config 3.0//EN"
| "http://www.jboss.org/j2ee/dtd/security_config.dtd">
| <policy>
| <!-- For the JCR CMS -->
| <application-policy name="cms">
| <authentication>
| <login-module code="org.apache.jackrabbit.core.security.SimpleLoginModule" flag="required"/>
| </authentication>
| </application-policy>
|
| <application-policy name="portal">
| <authentication>
| <login-module code="com.tsky.customlogin.CustomLoginModule" flag="required">
| <module-option name="unauthenticatedIdentity">guest</module-option>
| <module-option name="userModuleJNDIName">java:/portal/UserModule</module-option>
| <module-option name="roleModuleJNDIName">java:/portal/RoleModule</module-option>
| <module-option name="additionalRole">Authenticated</module-option>
| </login-module>
| </authentication>
| </application-policy>
| </policy>
|
My requirement is to avoid concurrent login. Means user should not login from more than one session at a time. Once he is in logged in state, we should not allow him to login in another session. So i am overriding LoginModule and writing some logic to avoid. But the problem is, If the user is looged in, It is not even going to Login module. It is directly taking from cache and allowing him to access the application. So i have removed password-stacking mocule option. Even then, It is behaving as same.
Can anybody halp he out in this?
thanks in advance...
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3993717#3993717
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3993717
19 years, 7 months
[Security & JAAS/JBoss] - Re: how to disable password-stacking property
by purna_cherukuri
Hi,
I have removed that option in my login-config.xml
Now my login-config.xml is like this.
<?xml version='1.0'?>
| <!DOCTYPE policy PUBLIC
| "-//JBoss//DTD JBOSS Security Config 3.0//EN"
| "http://www.jboss.org/j2ee/dtd/security_config.dtd">
| <policy>
| <!-- For the JCR CMS -->
| <application-policy name="cms">
| <authentication>
| <login-module code="org.apache.jackrabbit.core.security.SimpleLoginModule" flag="required"/>
| </authentication>
| </application-policy>
|
| <application-policy name="portal">
| <authentication>
| <login-module code="com.tsky.customlogin.CustomLoginModule" flag="required">
| <module-option name="unauthenticatedIdentity">guest</module-option>
| <module-option name="userModuleJNDIName">java:/portal/UserModule</module-option>
| <module-option name="roleModuleJNDIName">java:/portal/RoleModule</module-option>
| <module-option name="additionalRole">Authenticated</module-option>
| </login-module>
| </authentication>
| </application-policy>
| </policy>
It is still caching the username and passwords. I want it to go to CustomLoginModule each time.
Can anyone help me out in this?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3993707#3993707
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3993707
19 years, 7 months
[JBoss Seam] - Re: Basic Seam questions
by lightbulb432
Some questions below:
1) Could somebody describe the difference between the Seam-Managed Persistence Context that I've been reading about and the regular persistence contexts (Transaction and Extended)? Which one is it more similar to, and what should a Seam user know about it?
2) If you have an entity whose fields you populate over several steps in a conversation, business process, or just a session, would you need to avoid validation annotations like @NotNull?
I tried it and, after the first step in the multi-step process, it expectedly says that you're violating a null condition (because you've entered only a few fields and not all). Is there any way to get around this, short of moving everything to a single page or getting rid of annotations...or is this just a downside of such multi-step processes?
3) If you have an existing entity that is detached, what's the difference between calling EntityManager.persist and EntityManager.merge? Is persist simply not meant to be used in such a case (though couldn't it find the current existing row in the database using the primary key of the Java entity and update that row based on changes)?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3993705#3993705
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3993705
19 years, 7 months
[Clustering/JBoss] - Clustering local interfaces.
by sajid2045
Hi all,
We have developed an web based application on a single jboss server. We have stateful session bean/ stateless session bean/ entity beans. However, Since all the clients of ejb are in the same container, we have implemented the whole module using local interface. None of our components so far has remote interface. Now, we want to cluster the system. bypassing the ejb clustering/stateful session bean clustering is not an option for us.
Now, My question is can we cluster the whole system with the local interfaces so far we have used? We want session state replication of stateful session beans. I want to understand the whole picture before rushing into any perticular solution. any help will be much appriciated.
Regards,
Sajid.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3993694#3993694
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3993694
19 years, 7 months
[JBoss jBPM] - Timer is still running when token has left the node..
by sducas
Hello!!
I defined a timer on a state with repeat="true" and duration="1 minutes"...
My goal is to check each minutes if the state is over..
Inside the timer I've put a
node.leave(..) which seems to signal the token because i can see the task instance that have defined after the state node...
But the timer is still running each minutes!!!!
Because I've putted a node.leave(..) inside my process go on node by node each minutes...
Is this behavior normal???
How can I do to cancel this timer??(I've tryed a lot of solutions without success!)
Here is the jpdl section:
state name="initial"
timer name="initialTimer" duedate="1 minutes" repeat="true"
action class="com.sdmda.adt.ActionHandler"/
/timer
transition name="" to="traiterFinAccident"/
/state
And the ActionHandler:
public class ActionHandler implements org.jbpm.graph.def.ActionHandler {
public void execute(ExecutionContext arg0) throws Exception {
Integer count = (Integer) arg0.getVariable("count");
String message = (String) arg0.getVariable("message");
if (null == count)
count = 0;
System.out.println("count= " + count);
System.out.println("message= " + message);
if (count == 2) {
System.out.println("signaling");
Node state = arg0.getNode();
state.leave(arg0);
} else
arg0.setVariable("count", ++count);
System.out
.println("-------------------------------------------------------------");
}
}
THANKS!!!!!!!!!!!
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3993686#3993686
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3993686
19 years, 7 months