[EJB/JBoss] - org.jboss.ejb3.remoting.BaseRemoteProxy serialid exception
by ycindepalle
Hello
I am deploying my application in jboss 4.2.2GA version. The application accesses ejb services from another application deployed in jboss 405.
I tried using the jboss 405 ejb lib jars along with the deployment.(jboss-annotations-ejb3.jar, jboss-ejb3-client.jar, jboss-ejb3x.jar)
I am getting the following exception when deploying my application.
==========================
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'securityManager' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Cannot resolve reference to bean 'securityServiceRemote' while setting bean property 'securityServiceRemote'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'securityServiceRemote' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is javax.naming.CommunicationException [Root exception is java.io.InvalidClassException: org.jboss.ejb3.remoting.BaseRemoteProxy; local class incompatible: stream classdesc serialVersionUID = 1126421850898582900, local class serialVersionUID = -2711693270411201590]
Caused by:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'securityServiceRemote' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is javax.naming.CommunicationException [Root exception is java.io.InvalidClassException: org.jboss.ejb3.remoting.BaseRemoteProxy; local class incompatible: stream classdesc serialVersionUID = 1126421850898582900, local class serialVersionUID = -2711693270411201590]
Caused by:
javax.naming.CommunicationException [Root exception is java.io.InvalidClassException: org.jboss.ejb3.remoting.BaseRemoteProxy; local class incompatible: stream classdesc serialVersionUID = 1126421850898582900, local class serialVersionUID = -2711693270411201590]
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:722)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:587)
at javax.naming.InitialContext.lookup(InitialContext.java:351)
at org.springframework.jndi.JndiTemplate$1.doInContext(JndiTemplate.java:123)
at org.springframework.jndi.JndiTemplate.execute(JndiTemplate.java:85)
at org.springframework.jndi.JndiTemplate.lookup(JndiTemplate.java:121)
at org.springframework.jndi.JndiTemplate.lookup(JndiTemplate.java:146)
at org.springframework.jndi.JndiLocatorSupport.lookup(JndiLocatorSupport.java:93)
at org.springframework.jndi.JndiObjectLocator.lookup(JndiObjectLocator.java:105)
at org.springframework.jndi.JndiObjectFactoryBean.lookupWithFallback(JndiObjectFactoryBean.java:197)
at org.springframework.jndi.JndiObjectFactoryBean.afterPropertiesSet(JndiObjectFactoryBean.java:184)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1198)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1167)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:427)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:249)
====================
Any help is greatly appreciated. I see some issues with this serialid in the bugs list and looks like they are fixed but i am unable to proceed.
thanks very much in advance
Yugandhar
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4119217#4119217
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4119217
18 years, 3 months
[JBoss Seam] - Representing many kinds of entities in DB with two tables us
by gduq
We have an application for submitting application forms... LOTS of forms. The forms have different fields (obviously) and different validation requirements for the fields.
We are trying to avoid having to create a new table for each form. So we thought we could do this -> have two tables in the DB 'FORMS' and 'FORM_FIELD_VALUES' 'FORM_FIELD_VALUES' having the form, filed name and field value for any form. Problem solved! right? well so we thought anyway until we tried to figure out how to create the model classes and bind the views to them.
I had a couple of ideas of how to do this but they all seam flawed:
First Idea:
Since I like the validation annotations it seems like I will need to have one model class for each type of form with the fields and their respective validation annotations. And then have the controller convert this into a form object with its collection of formFieldValues before saving it. The problem is that to use the validation annotations on the model the classes need to be '@Entitiy's and therefore need to map directly to tables...so again we end up with one table per form (albeit empty tables)
Second Idea:
Use a single groovy class for the Form model with a "fieldValues" hash populated with keys based on what kind of form it is. Use groovy to do method-missing style metta programming magic to present this as a bean setters and getters don't really exist but they work anyway if the key is in the hash. Down side is doing this seems like it would be complex and I would be able to use the lovely validation annotations.
Any advise on a better way to do this would be hugely appreciated.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4119215#4119215
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4119215
18 years, 3 months
[JBoss jBPM] - Re: problem using mail inside timer
by tongz
Thank you all for the reply.
kukeltje, my understanding from the document is that "mail" is an action and "mail-node" is a node? Also, here "mail" does work fine in event, but just not valid in timer.
anuragpaliwal, are you saying you implemented this with "mail" or org.jbpm.mail.Mail? I suppose it's the later. The following code works fine using org.jbpm.mail.Mail:
<state name="resolve-issue">
| <event type="node-enter">
| <mail name="notification"
| to="user1@localhost"
| template="notification">
| </mail>
| </event>
| <timer name="timer-reminder-1" duedate="5 seconds">
| <action class="org.jbpm.mail.Mail">
| <to>user1@localhost</to>
| <template>actor-reminder-1</template>
| </action>
| </timer>
| <transition to="end"></transition>
| </state>
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4119213#4119213
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4119213
18 years, 3 months
[JBoss Seam] - server.log size is too big
by asookazian
In less than a couple of hours today, with one Seam2.0.0.GA app on my JBoss 4.2.1.GA, the server.log exploded to 300MB+.
When I changed the overall threshold to WARN in log4j.xml, the size of the log was much smaller after a few minutes (approx. 5KB).
It seems after perusing the server.log that ajax4jsf and Seam are very verbose at the DEBUG level. I'm not sure how valuable that info is to a corporate developer.
Anybody else encountering this problem and what is the recommended solution (obviously adding filters like below but you need to know what all the culprits are @ DEBUG level to filter out from server.log).
In prod, is the recommendation to set the threshold for server.log to ERROR?
\jboss-4.2.1.GA\server\default\conf\jboss-log4j.xml:
<!-- ================ -->
| <!-- Limit categories -->
| <!-- ================ -->
|
| <!-- 01/11/08 - Limit the org.jboss.seam to INFO as its DEBUG is verbose -->
| <category name="org.jboss.seam">
| <priority value="WARN"/>
| </category>
thx.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4119211#4119211
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4119211
18 years, 3 months
[Beginners Corner] - Referencing EJBs from Scheduler w/JBOSS 4.2.2GA
by mjhammel
I've searched (and read) all messages related to "schedulable" in the forums but I still don't quite understand how I acquire and use an EJB from within a schedulable.
What I have that works:
A web service session bean that can retrieve an EJB using EntityManager.
A schedulable class included in the EAR file that does get launched at deploy time.
My EJB classes are generated by Hibernate using reverse engineering from an existing DB. My schedulable looks like this (sans any EJB references):
import java.util.Date;
| import org.jboss.varia.scheduler.Schedulable;
| import org.apache.log4j.Logger;
|
| public class CronSchedulable implements Schedulable
| {
| private static final Logger log = Logger.getLogger(CronSchedulable.class);
| private String name;
| private long value;
|
| public CronSchedulable(String name, long value)
| {
| this.name = name;
| this.value = value;
| log.info("ctor, name: " + name + ", value: " + value);
| }
|
| public void perform(Date now, long remainingRepetitions)
| {
| log.info("perform, now: " + now +
| ", remainingRepetitions: " + remainingRepetitions +
| ", name: " + name + ", value: " + value);
|
| }
|
| }
This is packaged into a sar:
mjhammel(tty1)$ jar tvf crunch-schedulers.sar
| 0 Fri Jan 11 11:08:06 MST 2008 META-INF/
| 106 Fri Jan 11 11:08:04 MST 2008 META-INF/MANIFEST.MF
| 869 Fri Jan 11 10:54:48 MST 2008 META-INF/jboss-service.xml
| 0 Fri Jan 11 11:08:04 MST 2008 com/
| 0 Fri Jan 11 11:08:04 MST 2008 com/cei/
| 0 Fri Jan 11 11:08:04 MST 2008 com/cei/crunch/
| 0 Fri Jan 11 11:08:04 MST 2008 com/cei/crunch/schedulers/
| 1359 Fri Jan 11 11:08:04 MST 2008 com/cei/crunch/schedulers/CronSchedulable.class
and the jboss-service.xml for this sar looks like this:
<?xml version="1.0" encoding="UTF-8"?>
|
| <!-- Example Scheduler MBean for .Crunch -->
| <server>
| <mbean code="org.jboss.varia.scheduler.Scheduler" name="com.cei.crunch.schedulers:service=Scheduler">
| <depends>jboss.jca:service=DataSourceBinding,name=CrunchDS</depends>
| <depends>jboss.j2ee:module=crunch-ejb.jar,service=EJB3</depends>
| <attribute name="StartAtStartup">true</attribute>
| <attribute name="SchedulableClass">com.cei.crunch.schedulers.CronSchedulable</attribute>
| <attribute name="SchedulableArguments">TheName,123456789</attribute>
| <attribute name="SchedulableArgumentTypes">java.lang.String,long</attribute>
|
| <attribute name="InitialStartDate">NOW</attribute>
| <attribute name="SchedulePeriod">60000</attribute>
| <attribute name="InitialRepetitions">-1</attribute>
| </mbean>
| </server>
That's the correct datasource JNDI name but I'm not sure I've specified the EJB3 depends correctly. The sar file is then packaged into the EJB:
mjhammel(tty1)$ jar tvf Crunch.ear
| 0 Fri Jan 11 11:08:06 MST 2008 META-INF/
| 106 Fri Jan 11 11:08:04 MST 2008 META-INF/MANIFEST.MF
| 100 Fri Jan 11 11:08:06 MST 2008 META-INF/jboss-app.xml
| 6165 Fri Jan 11 11:08:04 MST 2008 crunch-web.war
| 11740 Fri Jan 11 11:07:58 MST 2008 crunch-ejb.jar
| 2119 Fri Jan 11 11:08:04 MST 2008 crunch-schedulers.sar
| 918 Fri Jan 11 11:08:06 MST 2008 META-INF/application.xml
At deploy time, I get the simple scheduler message:
11:08:08,310 INFO [WSDLFilePublisher] WSDL published to: file:/home/mjhammel/src/cei/jboss-4.2.2.GA-cei/server/default/data/wsdl/Crunch.ear/crunch-web.war/SubscriberServicesService59269.wsdl
| 11:08:08,319 INFO [EARDeployer] Started J2EE application: file:/home/mjhammel/src/cei/jboss-4.2.2.GA-cei/server/default/deploy/Crunch.ear
| 11:08:08,878 INFO [CronSchedulable] perform, now: Fri Jan 11 11:08:08 MST 2008, remainingRepetitions: -1, name: TheName, value: 123456789
|
My Web Service looks like this:
package com.cei.crunch.server.ws.SubscriberServices;
|
| import javax.ejb.*;
| import javax.jws.WebService;
| import javax.jws.WebMethod;
| import javax.jws.soap.SOAPBinding;
| import javax.persistence.*;
| import javax.naming.InitialContext;
| import javax.transaction.UserTransaction;
| import javax.annotation.Resource;
|
| import com.cei.crunch.ejb.Subscriber;
|
| /* Make this an EJB3 service endpoint. */
| @Stateless
| @Remote(SubscriberServices.class)
|
| /* Make this an Web Services endpoint. */
| @WebService(
| name = "SubscriberWS",
| endpointInterface = "com.cei.crunch.server.ws.SubscriberServices.SubscriberServicesEndpoint"
| )
| @SOAPBinding(style = SOAPBinding.Style.RPC)
|
| /**
| * The .Crunch interface to Subscriber Services
| */
| public class SubscriberServices implements SubscriberServicesEndpoint {
|
| private UserTransaction utx;
| private EntityManager em;
|
| @WebMethod
| public Subscriber findSubscriber(String guid)
| {
| Subscriber s = null;
|
| InitialContext ctx = null;
| EntityManager em = null;
| try {
| ctx = new InitialContext();
| em = (EntityManager) ctx.lookup("java:/CrunchPersistence");
| utx = (UserTransaction) ctx.lookup("java:/comp/UserTransaction");
| }
| catch (Exception e)
| {
| // throw new WebServiceException(ex);
| System.out.println("Subscriber.find(): context lookup failure.");
| e.printStackTrace();
| return null;
| }
|
| if ( em == null )
| {
| System.out.println("Subscriber.find(): em is null; can't find subscriber");
| }
| else
| {
| System.out.println("Subscriber.find(): em is not null; returning subscriber for guid = " + guid);
| try {
| utx.begin();
| s = em.find(Subscriber.class, guid);
| if ( s != null )
| {
| System.out.println("Subscriber name : " + s.getFirstname());
| System.out.println("Subscriber email: " + s.getEmailAddress());
| }
| utx.commit();
| }
| catch (Exception e)
| {
| System.out.println("Subscriber.find(): find problem.");
| e.printStackTrace();
| }
| }
| if ( s != null )
| return s;
| else
| return null;
| }
| }
The Web Service works as shown with a remote client, but I've not been able to get injection to work for the context, entity manager or transaction. So these are all done manually within the Web Service session bean (as listed in the code here).
As shown, everything works fine. I can query the Web Service from a remote client to get back my Subscriber object. How do I do the same thing from within the Schedulable class? I've found code snippets in the forums but they aren't clear to me how I should be approaching this. Does the schedulable do things just like the Web Service is doing it? Do I try to use injection in the schedulable? If so, what would the equivalent injection look like to perform the same thing the Web Service is doing? And how do I get a UserTransaction? When I tried to copy the code from the Web Services class to the Schedulable class and deployed it I got errors related to the UserTransaction lookup.
In summary: how do I access an EJB from within my schedulable using JBOSS 4.2.2GA and EJB3.0?
All pointers are appreciated. Thanks.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4119204#4119204
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4119204
18 years, 3 months