[EJB 3.0] - ClassCastException within an EAR deployment
by heizenberg
DVS3.ear/
| +-Util.jar (J2EE utility project)
| | +-dvs3.Changelist (java interface)
| |
| +-Core.jar/ (EJB Project)
| | +dvs3.code.session.ChangelistService (java interface that extends dvs3.Changelist)
| | +dvs3.code.session.ChangelistServiceBean (stlss sess bean that implements ChangelistService)
| |
| +-WebUI.war/
| | +dvs3.code.action.JSFBackingBean (a bbean that calls a session bean service via JNDI)
|
I'm assuming the manifest files are defined correctly since both Core.jar and Util.jar are referenced in the WebUI.war manifest file and Util.jar is referenced in the Core.jar manifest file.
In the backing bean, I have this piece of code:
String jndi = "DVS3EAR/ChangelistServiceBean/local";
| Object service = new InitialContext().lookup(jndi);
| System.out.println(service instanceof ChangelistService) // prints true
| System.out.println(service instanceof Changelist) // prints false
| Changelist service = (Changelist) obj; // fails with a ClassCastException
|
Why is this?
At some level, isn't this violating a fundamental java principle? Since ChangelistService is a Changelist, why can't I cast the service object to be a Changelist, but can cast it to be of type ChangelistService?
Is this some kind of weird (but legal) classloading?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4127970#4127970
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4127970
18 years, 2 months
[JBoss jBPM] - Is org.jbpm.gd.jpdl plugin up-to-date in CVS (the project co
by jruud
I have loaded the latest org.jbpm.gd.common, org.jbpm.gd.pf, and org.jbpm.gd.jpdl plugins into my Eclipse workspace, but the org.jbpm.gd.jpdl project shows up in Eclipse as containing a number of errors.
According to the plugin manifests the plugins are all: 3.2.0.alpha1, and I loaded them from HEAD (for example: HEAD in jbpm.3/designer/jpdl/org.jbpm.gd.jpdl)
One problem is that dom4j class references are not resolved (due to the dom4j jar not being included in the .classpath file), but there are several other errors as well (for example I needed to add org.eclipse.jface.text as a required bundle).
Is this all due to the latest changes not having been committed to CVS, or have I managed to mess this up somehow?
Thanks, John
BTW, I'm also curious to know which JDK and Eclipse versions are currently being used for GD development.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4127968#4127968
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4127968
18 years, 2 months
[Clustering/JBoss] - Re: Deploying the application in selected nodes in a cluster
by viswanadhvk
I have been tring to do what you explained here.
I am using JBoss 4.2.1 server.
As you explained , in jboss there is folder called
all\deploy\cluster-service.xml file. I changed the
attribute called
|
| <attribute
| name="PartitionName">${jboss.partition.name:DefaultPartition}</attribute>
|
|
and I created 3 nodes Node1 , Node2 ,Node3
Now I would like to deploy an application in in
Node1,Node2 and not in Node3.
So under Node1\deploy\cluster-service.xml ,I changed
the above said attribute name as
| <attribute
| name="PartitionName">${jboss.partition.name:Node1}</attribute>
|
|
and also Node2\deploy\cluster-service.xml , I changed
the above said attribute name as
| <attribute
| name="PartitionName">${jboss.partition.name:Node1}</attribute>
|
|
(** In Node2 also I made it as Node1 as you said.you
said those should be same name).
I didn't changed any thing other than what I said
above.
Now I am trying to deploy the application in all\farm
folder ,so that it has to deploy in Node1,Node2.But
some how it is not deploying in the nodes.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4127966#4127966
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4127966
18 years, 2 months
[JBoss Portal] - Portal data source config problem
by wizumwalt
I'm getting the following error after a build/build.sh deploy and jboss-portal.sar is copied in jboss-4.2.2.GA/server/default/deploy.
| --- MBEANS THAT ARE THE ROOT CAUSE OF THE PROBLEM ---
| ObjectName: jboss.jca:service=DataSourceBinding,name=PortalDS
| State: NOTYETINSTALLED
| Depends On Me:
| portal:service=Hibernate
| portal:service=Hibernate,type=Instance
| portal:service=Hibernate,type=PortalObject
| portal:service=Hibernate,type=Portlet
|
|
| 13:34:04,344 INFO [Http11Protocol] Starting Coyote HTTP/1.1 on http-127.0.0.1-8080
|
added postgres-ds.xml to jboss-4.2.2.GA/server/default/deploy
added postgresql-8.3-603.jdbc4.jar to jboss-4.2.2.GA/server/default/lib
I've changed out the following <jndi-name> tag to PostgresDS as well, but didn't work. This file is basically the same as the postgres-ds.xml found in server/default/deploy.
jboss-portal-2.6.3.GA-src/core/output/resources/setup/portal-ds.xml
| <datasources>
| <local-tx-datasource>
| <jndi-name>PortalDS</jndi-name>
| <connection-url>jdbc:postgresql://192.168.3.10:8080/jbossportal</connection-url>
| <driver-class>org.postgresql.Driver</driver-class>
| <user-name>my</user-name>
| <password>mypass</password>
| <!-- sql to call when connection is created. Can be anything, select 1 is valid for PostgreSQL
| <new-connection-sql>select 1</new-connection-sql>
| -->
| <!-- sql to call on an existing pooled connection when it is obtained from pool. Can be anything, select 1 is valid for PostgreSQL
| <check-valid-connection-sql>select 1</check-valid-connection-sql>
| -->
| <!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml -->
| <metadata>
| <type-mapping>PostgreSQL 8.0</type-mapping>
| </metadata>
| </local-tx-datasource>
| </datasources>
|
Any ideas?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4127964#4127964
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4127964
18 years, 2 months
[JBoss Seam] - Sending email asynchronously
by dthibau@opencs.net
Hello everybody,
My config :
Jboss 4.2.1GA
Seam 2.0.1
I'm trying to send email asynchronously from a Seam Component like this :
| asynchroneNotifier.scheduleSendCR( 1000, selectedCR, server.toString());
|
asynchroneNotifier is another SeamComponent :
| @Name("asynchroneNotifier")
| @AutoCreate
| public class AsynchroneNotifier {
|
| @In
| EntityManager entityManager;
|
| @Logger
| private Log log;
|
| @Asynchronous
| @TransactionAttribute(value=TransactionAttributeType.NOT_SUPPORTED)
| public void scheduleSendCR(@Duration
| long delay, CR cr, String server) {
|
| cr = entityManager.find(CR.class,cr.getId());
| for (Account a : cr.getDestinataires()) {
| Contexts.getEventContext().set("cr", cr);
| Contexts.getEventContext().set("sender", cr.getAuteur());
| Contexts.getEventContext().set("receiver", a);
| Contexts.getEventContext().set("server", server);
| try {
| Renderer.instance().render("/mail/envoiCRMail.xhtml");
| } catch (FacesException e) {
| e.printStackTrace();
| log.error(" Impossible d'envoyer la notification de CR ÃÂ "+a.getNomComplet(), e);
| }
|
| }
| }
|
| }
|
|
This code used to work fine with Seam 1.2 and JBoss 4.0.5. But with my
new config, I encounter classpath problem.
This occurs when Seam tries to create a MockFacesContext.
Here is the trace log :
20:11:44,337 ERROR [TimerImpl] Error invoking ejbTimeout: javax.ejb.EJBException: java.lang.IllegalStateException: Application was not properly initialized at startup, could not find Factory: javax.faces.application.ApplicationFactory
Did I code something badly or is it a bug ?
Thanks in advance
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4127963#4127963
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4127963
18 years, 2 months