[EJB3] - EJB java.lang.NoClassDefFoundError: javax/persistence/EntityManager
by marco squarcini
marco squarcini [https://community.jboss.org/people/squarcio] created the discussion
"EJB java.lang.NoClassDefFoundError: javax/persistence/EntityManager"
To view the discussion, visit: https://community.jboss.org/message/826760#826760
--------------------------------------------------------------
Hello to all,
I'm new to javaEE and JBoss AS and i'm trying to learn developing EJB applications but i have a problem i don't know how to solve.
I use NetBeans 7.3 and JBoss AS 7.1.1.
I have been created an EJB 3.1 module with an entity bean and a session bean with remote interface that performs the database operations using the entity bean.
After i have been created a java application to access the EJB module:
1. inside the library of the project i put the jboss-client.jar and the EJB module.jar files
2. i have been created a config package with the jboss-ejb-client.properties file
3. i lookup the bean with the method :
public static ControllerPrenotazioniRemote lookupRemoteControllerPrenotazioni() throws NamingException {
final Hashtable jndiProperties = new Hashtable();
jndiProperties.put(Context.URL_PKG_PREFIXES, "org.jboss.ejb.client.naming");
final Context context = new InitialContext(jndiProperties);
final String appName = "";
final String moduleName = "EJBModule1";
final String distinctName = "";
final String beanName = ControllerPrenotazioni.class.getSimpleName();
final String viewClassName = ControllerPrenotazioniRemote.class.getName();
System.out.println("Looking EJB via JNDI ");
System.out.println("ejb:" + appName + "/" + moduleName + "/" + distinctName + "/" + beanName + "!" + viewClassName);
return (ControllerPrenotazioniRemote) context.lookup("ejb:/EJBModule1/ControllerPrenotazioni!"
+ ControllerPrenotazioniRemote.class.getName() + "?stateful");
}
I deploy the EJB module less problems,but when i try to run the java application i see thi error in the output tab of NetBeans:
Exception in thread "main" java.lang.NoClassDefFoundError: javax/persistence/EntityManager
at controllers.ControllerPrenotazioni.trovaPrenotazione(ControllerPrenotazioni.java:133)
at principale.Main.main(Main.java:22)
Caused by: java.lang.ClassNotFoundException: javax.persistence.EntityManager
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 2 more
Java Result: 1
I do not know where I'm wrong!Someone can help me to solve this problem?
Thank you to all in advance....
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/826760#826760]
Start a new discussion in EJB3 at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
12 years, 4 months
[jBPM] - Custom JuelScriptEngine
by Marcos Sousa
Marcos Sousa [https://community.jboss.org/people/marcos.sousa] created the discussion
"Custom JuelScriptEngine"
To view the discussion, visit: https://community.jboss.org/message/826736#826736
--------------------------------------------------------------
This is a prodution problem.
We copy paste the orginal JuelScriptEngine from jBPM, so we can create new functions.
We are getting issues in productions using decisions.
To reproduce the issue we create 2 threads invoking startProcessInstante (after task we put decision) then we see what was happen in the code, surprised we found:
1. jBPM creates for those 2 threads our JuelExtendedScriptEngine
2. The ELContext creates 1 new JuelExtendedScriptEngine and use this for those 2 threads - Why? How can I put ELContext to reuse the JuelExtendedScriptEngine created by jBPM?
I see that inside the JuelExtendedScriptEngine every value fits ok. But the evaluation of our new function instead of use the JuelExtendedScriptEngine previous created by jBPM it uses that one created by ELContext.
Remember that the code is the same as the original jBPM 4.3 JuelScriptEngine.
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/826736#826736]
Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
12 years, 4 months
[jBPM] - Is jBPM the right tool for what I'm trying to achieve?
by Egor Kolesnikov
Egor Kolesnikov [https://community.jboss.org/people/eskape] created the discussion
"Is jBPM the right tool for what I'm trying to achieve?"
To view the discussion, visit: https://community.jboss.org/message/826702#826702
--------------------------------------------------------------
Hi everyone,
I've been researching jBPM in on-again-off-again mode since, well, pre-v3 times, circa 2005. Every time it happened to be "not quite what I need", or there was a feature promised "in a future release" and I usually moved on to something else - usually some simple homebrew workflow solutions that nevertheless did their job fine.
Now that it's 2013 and jBPM is at 5.4.0, I kinda started thinking that I may not understand the very purpose of it.
If we take on something as simple as bug tracking or ticketing system - there are tons of possible configurable workflows that just scream "use jBPM dammit!"
Let's start with email confirmation after registration: Start -> call "registration email" service -> human task (wait for email link to be clicked) -> call "confirm registration" service -> End. Loops for "re-send confirmation mail" are optional.
Now after I've added maven dependencies for jbpm-bpmn2 and jbpm-human-task-core, there are already TONS of transi
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/826702#826702]
Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
12 years, 4 months
[EJB3] - Test EJB3 using Junit 4 in Glassfish 3.1.1
by Sharma Ragav
Sharma Ragav [https://community.jboss.org/people/ragav] created the discussion
"Test EJB3 using Junit 4 in Glassfish 3.1.1"
To view the discussion, visit: https://community.jboss.org/message/826697#826697
--------------------------------------------------------------
Hi,
I am using Glassfisg 3.1.1 server and test EJB3 class using junit4.
Below are the code written in setUp() in test class.
Getting below exception:
javax.ejb.EJBException: No EJBContainer provider available: no provider names had been found.
at javax.ejb.embeddable.EJBContainer.reportError(EJBContainer.java:216)
at javax.ejb.embeddable.EJBContainer.createEJBContainer(EJBContainer.java:146)
at javax.ejb.embeddable.EJBContainer.createEJBContainer(EJBContainer.java:102)
@Before
public void setUp() throws Exception {
System.out.println("Inside setUp");
InitialContext context = null;
Properties prop = new Properties();
prop.put("org.glassfish.ejb.embedded.glassfish.instance.root",
"");
prop.put(EJBContainer.MODULES, new File("/classes/"));
EJBContainer container =EJBContainer.createEJBContainer();
settingEJB = (SettingsBean) container.getContext().lookup("java:global/SettingsEJB");
}
Added glassfish-embedded-static-shell.jar in classpath.
Anything missed?
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/826697#826697]
Start a new discussion in EJB3 at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
12 years, 4 months