[Beginners Corner] - Patch for drools examples pom.xml
by nuttycom
I found that I had to make some changes to the pom.xml file of the drools examples project to get it to build. Here's the patch:
| --- pom.xml 2008-06-26 11:24:57.000000000 -0600
| +++ pom.xml 2008-06-26 11:26:42.000000000 -0600
| @@ -5,21 +5,23 @@
| <parent>
| <artifactId>drools</artifactId>
| <groupId>org.drools</groupId>
| - <version>4.0.7.SNAPSHOT</version>
| + <version>4.0.7</version>
| </parent>
|
| <!--
| TODO make this packing pom and make 2 submodules: example-waltz and example-manners
| (and possibly example-common too)
| -->
| + <groupId>org.drools</groupId>
| <artifactId>drools-examples</artifactId>
| <packaging>jar</packaging>
| <name>Drools :: examples</name>
|
| <repositories>
| <repository>
| - <id>basedir</id>
| - <url>file://${basedir}/../m2_repo</url>
| + <id>drools</id>
| + <name>JBoss Drools Repository for Maven</name>
| + <url>http://repository.jboss.com/maven2</url>
| </repository>
| </repositories>
|
I switched the examples to use the jboss maven2 repository because the m2_repo directory is empty in the examples zipfile.
Kris
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4160944#4160944
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4160944
17 years, 9 months
[JNDI/Naming/Network] - JNDI EJB local lookup is ok, but the bean cannot be invoked
by j2ee4cxw
We are building application based on Struts 2 and EJB 3. The server we use is JBOSS 4.2.2 GA. In the struts action class, we try to save data to database via ejb session bean. When the ejb was obtained via jndi romote look up, everything is fine. The bean is found and data is saved. However, when we do a local jndi lookup, the bean is found, but upon invoking the bean JBOSS threw following error:
javax.ejb.EJBException: java.lang.IllegalArgumentException: Wrong target. class com.boeing.he.bessy.bean.ShipperManagerBean for public long com.boeing.he.bessy.bean.ShipperManagerBean.createShipper(com.boeing.he.bessy.domain.Shipper) throws com.boeing.he.bessy.exception.BessyException.
This has happened to three of our developers with different beans. The bottom line is the local lookup is succeful, but the bean cannot be invoked. Any kind of suggestion is greatly appreciated. Thanks. Here are our codes:
////This is the save method of our Struts action class/////
public String save()
{
try
{
//Shipper(spr) is our entity.
com.boeing.he.bessy.domain.Shipper spr = new com.boeing.he.bessy.domain.Shipper();
spr.setManifest("ABC");
spr.setSite("PHL100");
spr.setLocation("PHL");
spr.setDocTypeCode("DOC100");
//remote call. WORKS!
// String SHIPPER_JNDI_NAME = "BessyEAR/ShipperManagerBean/remote";
// Object ref1 = ServiceLocator.getEJB(SHIPPER_JNDI_NAME);//jndi lookup
// ShipperManagerRemote smbean1 = (ShipperManagerRemote)ref1;
// long shipperId1 = smbean1.createShipper(spr);
// setMessage("Shipper Created with Id:" + shipperId1);
//local call. Errors
String SHIPPER_JNDI_NAME = "BessyEAR/ShipperManagerBean/local";
Object ref2 = ServiceLocator.getEJB(SHIPPER_JNDI_NAME);//jndi lookup
ShipperManagerLocal smbean2 = (ShipperManagerLocal) ref2;
long shipperId2 = smbean2.createShipper(spr); ////<==ERROR OCURRED ON THIS LINE. ERROR OCURRED ON THIS LINE
setMessage("Shipper Created with Id:" + shipperId2);
}
catch(Exception ex)
{
log.error(ex);
setMessage("some error occurred");
}
return SUCCESS;
}
///Interfaces////////
public interface IShipperManager {
public long createShipper(Shipper shipper) throws BessyException;
}
@Local
public interface ShipperManagerLocal extends IShipperManager{}
@Remote
public interface ShipperManagerRemote extends IShipperManager {}
////The EJB session bean/////////
@Stateless
public class ShipperManagerBean implements ShipperManagerLocal,ShipperManagerRemote {
@PersistenceContext(unitName="BessyPU")
private EntityManager manager;
public long createShipper(Shipper shipper) throws BessyException
{
manager.persist(shipper);
return shipper.getShipperId();
}
}
////ServiceLocator///////
public static Object getEJB(String jndiName) {
Object object = null;
try {
InitialContext ctx = new InitialContext();
object = ctx.lookup(jndiName);
} catch (Exception e) {
e.printStackTrace();
}
return object;
}
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4160940#4160940
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4160940
17 years, 9 months
cluster problem
by Stefan Lambrev
Greetings,
I'm having a weird problem with jboss4 under freebsd7 amd64
I'm trying to get two instances of jboss4 to run on two servers in
cluster mode.
The problem is that when they try to exchange the TreeCache it just does
not work.
I'm getting this error message (on the server that is launched second) :
-------------------------------------------------------
GMS: address is 192.168.2.188:58346
-------------------------------------------------------
18:26:44,311 INFO [TreeCache] viewAccepted(): [192.168.3.202:54013|1]
[192.168.3.202:54013, 192.168.2.188:58346]
18:26:44,322 INFO [TreeCache] TreeCache local address is
192.168.2.188:58346
18:27:14,340 WARN [ServiceController] Problem starting service
jboss.cache:service=TomcatClusteringCache
org.jboss.cache.CacheException: Initial state transfer failed:
Channel.getState() returned false
at
org.jboss.cache.TreeCache.fetchStateOnStartup(TreeCache.java:3363)
at org.jboss.cache.TreeCache.startService(TreeCache.java:1555)
at org.jboss.cache.aop.PojoCache.startService(PojoCache.java:94)
at
org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
at
org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
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(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
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.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
at $Proxy4.start(Unknown Source)
at org.jboss.deployment.SARDeployer.start(SARDeployer.java:302)
at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1025)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at
org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
at
org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
at
org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
at
org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
at
org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
at $Proxy9.deploy(Unknown Source)
at
org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:421)
at
org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:634)
at
org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:263)
at
org.jboss.deployment.scanner.AbstractDeploymentScanner.startService(AbstractDeploymentScanner.java:336)
at
org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
at
org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
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(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
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.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
at $Proxy4.start(Unknown Source)
at org.jboss.deployment.SARDeployer.start(SARDeployer.java:302)
at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1025)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:766)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at
org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
at
org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
at
org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
at
org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
at
org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
at $Proxy5.deploy(Unknown Source)
at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:482)
at org.jboss.system.server.ServerImpl.start(ServerImpl.java:362)
at org.jboss.Main.boot(Main.java:200)
at org.jboss.Main$1.run(Main.java:508)
at java.lang.Thread.run(Thread.java:595)
18:27:14,397 INFO [STDOUT] no object for null
18:27:14,399 INFO [STDOUT] no object for null
18:27:14,412 INFO [STDOUT] no object for null
18:27:14,425 INFO [STDOUT] no object for
{urn:jboss:bean-deployer}supplyType
18:27:14,432 INFO [STDOUT] no object for
{urn:jboss:bean-deployer}dependsType
18:27:15,700 INFO [NativeServerConfig] JBoss Web Services - Native
18:27:15,701 INFO [NativeServerConfig] jbossws-native-2.0.1.SP2
(build=200710210837)
18:27:16,138 INFO [SnmpAgentService] SNMP agent going active
18:27:16,372 INFO [StagePartition] Initializing
18:27:16,397 INFO [STDOUT]
and this one on the server, that is started first (and already served a
request)
18:27:13,563 INFO [TreeCache] locking the subtree at / to transfer state
18:27:13,569 INFO [StateTransferGenerator_140] returning the state for
tree rooted in /(65536 bytes)
18:27:28,615 INFO [TreeCache] viewAccepted(): [192.168.3.202:54013|2]
[192.168.3.202:54013]
18:27:47,694 INFO [StagePartition] New cluster view for partition
StagePartition (id: 1, delta: 1) : [192.168.3.202:1099, 192.168.2.188:1099]
18:27:47,696 INFO [StagePartition] I am (192.168.3.202:1099) received
membershipChanged event:
18:27:47,696 INFO [StagePartition] Dead members: 0 ([])
18:27:47,696 INFO [StagePartition] New Members : 1 ([192.168.2.188:1099])
18:27:47,696 INFO [StagePartition] All Members : 2
([192.168.3.202:1099, 192.168.2.188:1099])
I found similar error reported here -
https://strobe.uwaterloo.ca/~twiki/bin/view/ISTCSS/CasAuthServer
where is suggested to increase InitialStateRetrievalTimeout and to
reduce keep alive time for sockets.
I tried both but still no joy.
Any ideas what's going wrong and how to get the cluster up and running?
P.S. sorry if this is not the proper list, and let me know where is best
place to forward my questions.
--
Best Wishes,
Stefan Lambrev
ICQ# 24134177
17 years, 9 months