[EJB/JBoss] - Problem in deployment of ejb 3 in JBoss Server using Oracle
by ashusri000
Hi All ,
I have packed a simple stateless bean along with an entity bean but there is an exception thrown during deployment as this :
-----------------------------------------------------------------------------------------------------------------------------------------------------
[ServiceController] Problem starting service persistence.units:ear=sample123.ear,jar=persist.jar,unitName=testApp
java.lang.ClassCastException: oracle.toplink.essentials.ejb.cmp3.EntityManagerFactoryProvider
at org.jboss.ejb3.entity.PersistenceUnitDeployment.start(PersistenceUnitDeployment.java:245)
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.ejb3.ServiceDelegateWrapper.startService(ServiceDelegateWrapper.java:103)
at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
at sun.reflect.GeneratedMethodAccessor18.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
at $Proxy0.start(Unknown Source)
at org.jboss.system.ServiceController.start(ServiceController.java:417)
at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
-----------------------------------------------------------------------------------------------------------------------------------------------------
Please can anybody help me figure out as to why this exception is thrown up .
My persistence.xml looks like this
<?xml version="1.0" encoding="UTF-8"?>
<persistence xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.0" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd">
<persistence-unit name="testApp" >
oracle.toplink.essentials.PersistenceProvider
<jta-data-source>java:comp/env/jdbc/my-ejb-test</jta-data-source>
src.Employee
<!--Use the java2db feature -->
<!-- Generate the sql specific to database -->
</persistence-unit>
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4063327#4063327
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4063327
18Â years, 11Â months
[EJB 3.0] - Problem in deployment of ejb 3 in JBoss Server using Oracle
by ashusri000
Hi All ,
I have packed a simple stateless bean along with an entity bean but there is an exception thrown during deployment as this :
-----------------------------------------------------------------------------------------------------------------------------------------------------
[ServiceController] Problem starting service persistence.units:ear=sample123.ear,jar=persist.jar,unitName=testApp
java.lang.ClassCastException: oracle.toplink.essentials.ejb.cmp3.EntityManagerFactoryProvider
at org.jboss.ejb3.entity.PersistenceUnitDeployment.start(PersistenceUnitDeployment.java:245)
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.ejb3.ServiceDelegateWrapper.startService(ServiceDelegateWrapper.java:103)
at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
at sun.reflect.GeneratedMethodAccessor18.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
at $Proxy0.start(Unknown Source)
at org.jboss.system.ServiceController.start(ServiceController.java:417)
at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
-----------------------------------------------------------------------------------------------------------------------------------------------------
Please can anybody help me figure out as to why this exception is thrown up .
My persistence.xml looks like this
<?xml version="1.0" encoding="UTF-8"?>
<persistence xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.0" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd">
<persistence-unit name="testApp" >
oracle.toplink.essentials.PersistenceProvider
<jta-data-source>java:comp/env/jdbc/my-ejb-test</jta-data-source>
src.Employee
<!--Use the java2db feature -->
<!-- Generate the sql specific to database -->
</persistence-unit>
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4063326#4063326
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4063326
18Â years, 11Â months
[JBoss Seam] - A suggested SeamTest improvement
by matt.drees
I spent some time debugging one of my tests, trying to figure out why the conversation wasn't being propagated. I had something (very roughly) like this:
|
| String cid = new FacesRequest("/page1.xhtml") {
| @Override
| protected void invokeApplication() throws Exception {
| Manager.instance().beginConversation();
| FacesManager.instance().redirect("/page2.xhtml");
| }
|
| }.run();
|
| cid = new FacesRequest("/page2.xhtml", cid) {
| @Override
| protected void invokeApplication() {
| assert Manager.instance().isLongRunningConversation();
| }
| }.run();
|
But the assertion fails, which I learned has to do with the fact that there was nothing rendered in the first request. So, I can fix it by doing this:
|
| String cid = new FacesRequest("/page1.xhtml") {
| @Override
| protected void invokeApplication() throws Exception {
| Manager.instance().beginConversation();
| FacesManager.instance().redirect("/page2.xhtml");
| }
|
| }.run();
|
| cid = new NonFacesRequest("/page2.xhtml", cid) {
| }.run();
|
| cid = new FacesRequest("/page2.xhtml", cid) {
| @Override
| protected void invokeApplication() {
| assert Manager.instance().isLongRunningConversation();
| }
| }.run();
|
But it annoys me to have that empty request in there. So, it'd be nice to have something like this:
| String cid = new FacesRequestAndRedirect("/page1.xhtml", null, "/page2.xhtml") {
| @Override
| protected void invokeApplication() throws Exception {
| Manager.instance().beginConversation();
| FacesManager.instance().redirect(getRedirectedTo());
| }
|
| @Override
| public void renderAfterRedirect() throws Exception {
| assert Manager.instance().isLongRunningConversation();
| }
| }.run();
|
| cid = new FacesRequest("/page2.xhtml", cid) {
| @Override
| protected void invokeApplication() throws Exception {
| assert Manager.instance().isLongRunningConversation();
| }
| }.run();
|
And it turns out that I could make it happen with this convolution:
|
| public class FacesRequestAndRedirect extends FacesRequest {
|
| private String redirectedTo;
|
| public FacesRequestAndRedirect() {
| super();
| }
|
| public FacesRequestAndRedirect(String viewId, String conversationId) {
| super(viewId, conversationId);
| }
|
| public FacesRequestAndRedirect(String viewId) {
| super(viewId);
| }
|
| public FacesRequestAndRedirect(String viewId, String conversationId, String redirectedTo) {
| super(viewId, conversationId);
| setRedirectedTo(redirectedTo);
| }
|
| @Override
| public final void renderResponse() throws Exception {
|
| }
|
| public void renderAfterRedirect() throws Exception {
|
| }
|
| public String getRedirectedTo() {
| return redirectedTo;
| }
|
| public void setRedirectedTo(String redirectedTo) {
| this.redirectedTo = redirectedTo;
| }
|
| @Override
| public String run() throws Exception {
| String cid = super.run();
|
| cid = new NonFacesRequest(getRedirectedTo(), cid) {
|
| @Override
| protected void renderResponse() throws Exception {
| renderAfterRedirect();
| }
| }.run();
| return cid;
| }
| }
|
So, I haven't used it or thought about it much, but it might be worth putting something like this into Seam. Any thoughts?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4063325#4063325
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4063325
18Â years, 11Â months
[JBoss Seam] - Seam 2.0 Beta + JBossas 4.2.1.GA + JBossWS-2.0.0.GA + WebSta
by PatrickMadden
This is just a quick note to say that I'm successfully runing Seam 2.0 Beta with the JBoss 4.2.1.GA from SVN and JBossWS-2.0.0.GA also from SVN.
I was having real problems running web services on client side java applications and Java Web Start applications connecting to my Seam Web Application. (we have multiple views into the data)
I mainly followed the instructions found here:
http://jbws.dyndns.org/mediawiki/index.php?title=Building_From_Source
On July 7, I downloaded the Branch_4_2 of the JBoss Application server and built it with JDK 1.5_12 (it fails to build on JDK 1.6). I then checked out the JBossWS 2.0 and built it with jdk1.6u2.
When building jbossws you cd into the build directory and set two properties in ant.properties. Mine are as follows:
anonymous wrote :
| jboss42.home=c:/apps/jboss/jboss-4.2.1.GA
| jbossws.integration.target=jboss42
|
Inside the build directory there is also a build.conf file where you can tell it to use JDK 6
anonymous wrote :
| ##
| ## Build configuration
| ##
|
| # Uncomment when using JDK 6
| USE_JDK6=true
|
Then you use the build.bat file to build everything. Once its built you CD into the jbossws-core directory and type:
anonymous wrote :
| ant deploy-jboss42
|
This deploys everything to the JBoss-4.2.1 directory and most importantly adds important jar files to the JBoss-4.2.1\lib\endorsed directory
To get everything working on the client side you also need the endorsed jar files to be properly set using the system property -Djava.endorsed.dirs
For me and my Java Web Start Applications I created a jar file called endorsed.jars (jar'd all files in jboss endorsed directory) and download and unzip this jar file during runtime into the java.home/lib/endorsed directory if they don't exist already. If the don't exists already I notify the user that I did some first time client side setup and then shutdown my application and automatically relaunch it using the java.lang.ProcessBuilder class. This is because the endorsed jar files must be there before your JRE starts up. If they do exist my app just continues normally and I can call all my web services on the backend.
Not all code is shown but its goes something like this:
| // Setup the Endorsed Directories
|
| String currentEndorsedDirs = System.getProperty("java.endorsed.dirs");
| File endorsedJRELibDir = new File(currentEndorsedDirs);
| boolean unzipEndorsedJars;
|
| if (!endorsedJRELibDir.exists())
| {
| endorsedJRELibDir.mkdirs();
| unzipEndorsedJars = true;
| }
| else
| {
| // check to see if it has the proper jar files in it
| unzipEndorsedJars = true;
| File[] files = endorsedJRELibDir.listFiles();
|
| if (files != null)
| {
| for (File file : files)
| {
| if (file.getName().equals("jboss-jaxws.jar"))
| {
| // ok we are fine
| unzipEndorsedJars = false;
| break;
| }
| }
| }
|
| }
|
| if (unzipEndorsedJars)
| {
| URL endorsedJarURL = new URL(System.getProperty("ContextRoot") + "desktop/lib/endorsed.jar");
| JarInputStream jarIn = new JarInputStream(endorsedJarURL.openStream());
|
| // unzip the file into jre's lib/endorsed directory - unzip closes the input stream.
| ZipUtils.unzip(endorsedJRELibDir, jarIn);
| }
|
| boolean addSubDirs = false;
| ClassPathModifier.addFiles(endorsedJRELibDir, addSubDirs);
|
| if (unzipEndorsedJars)
| {
| JOptionPane.showMessageDialog(null,
| "We have detected that this is the first time you\n" +
| "have run the Clooster Desktop application with the\n"+
| "current Java Runtime environment.\n\n" +
| "As such, we have performed some initial client side\n"+
| "setup and the application needs to restart.",
| "Clooster, Inc",
| JOptionPane.PLAIN_MESSAGE);
|
|
| ProcessBuilder pb = new ProcessBuilder("javaws",
| System.getProperty("ContextRoot") + "cloosterDesktop.jnlp");
| pb.start();
|
| System.exit(0);
| }
|
This way even if the JRE is updated, my endorsed directories will be just fine.
I'm just posting this because I was pulling my hair out trying to get the webservices running on JRE 1.6 on the client. JRE 1.6 adds extra code that conflicts with the JBoss Web Services and thankfully using endorsed mechanism there is a workaround.
Hope this helps anyone else who is pulling their hair out right now. BTW, have not had any seam related issues at all using the new web services and 4.2.1.GA build from SVN.
In case anyone is curious the ContextRoot property comes from the JNLP file as follows:
<property name="ContextRoot" value="$$codebase"/>
One other thing - when compiling your web services client side code with jdk 1.6u2 you need to tell javac ant task about the jboss endorsed jar files. This can be done using a little trick as follows:
| <target depends="init" name="build-project">
| <echo message="${ant.project.name}: ${ant.file}"/>
| <property name="jbEndorsed" value="-endorseddirs ${jboss.endorsed}"/>
| <javac debuglevel="${javac.debuglevel}" debug="${javac.debug}" destdir="bin" source="${source}" target="${target}">
| <src path="src"/>
| <classpath refid="JBossClient.classpath"/>
| <compilerarg line="${jbEndorsed}" />
| </javac>
| </target>
|
where jboss.endorsed in my case equals c:\apps\jboss\jboss-4.2.1.GA\lib\endorsed. Otherwise you get build errors.
Thanks,
PVM
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4063323#4063323
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4063323
18Â years, 11Â months
[JBoss AOP] - 1.5.5 GA: Problem with InstanceAdvisor->appendInterceptorSta
by jay.guidos
Hi All,
After successfully appending a single interceptor to an advised instance, I am now trying to append an interceptor stack to the same instance. The code looks like this:
| if (managedProcessorService instanceof Advised)
| {
| InstanceAdvisor advisor = ((Advised) managedProcessorService)._getInstanceAdvisor();
|
| // establish basic per-instance interceptor configuration
| advisor.appendInterceptorStack(userTransactions?"transacted-msp":"non-transacted-msp");
|
| // add optional per-instance interceptors
| if (processEventMonitorService != null)
| advisor.appendInterceptor(new ProcessEventInterceptor(processEventMonitorService.get()));
| }
|
The call to advisor.appendInterceptorStack() throws a class cast exception. Digging in the code, it turns out this call is handled by ClassInstanceAdvisor.appendInterceptorStack(). That method calls a private method:
|
| private Object getInstance()
| {
| if (instanceRef != null)
| {
| return (Advisor)instanceRef.get();
| }
| return null;
| }
|
|
The cast here is unnecessary, as the return value of the method is Object. In addition, looking at the code in the appendInterceptorStack method it seems that it is really expecting an Advised class, not an Advisor anyway.
Is this a bug?
Jay Guidos
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4063316#4063316
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4063316
18Â years, 11Â months