[Beginners Corner] - NoSuchMethodException InvokerAdaptorService
by tmonteit
I just (for the first time) downloaded, installed and ran JBOSS. I get an Exception. see below.
How do I fix this? I suspect I won't find instructions in the beginner's manual.
Please Help...
-------------------------------------------------------------------------
2006-09-23 21:12:06,656 DEBUG [org.jboss.system.ServiceCreator] About to create xmbean object: jboss.jmx:name=Invoker,type=adaptor with code: org.jboss.jmx.connector.invoker.InvokerAdaptorService with embedded descriptor
2006-09-23 21:12:06,687 DEBUG [org.jboss.mx.modelmbean.ModelMBeanInvoker] Failed to invoke ctor(MBeanInvoker) for: class org.jboss.jmx.connector.invoker.AuthenticationInterceptor
java.lang.NoSuchMethodException: org.jboss.jmx.connector.invoker.AuthenticationInterceptor.(org.jboss.mx.server.MBeanInvoker)
at java.lang.Class.getConstructor0(Class.java:1937)
at java.lang.Class.getConstructor(Class.java:1027)
at org.jboss.mx.modelmbean.ModelMBeanInvoker.getInterceptors(ModelMBeanInvoker.java:739)
at org.jboss.mx.modelmbean.ModelMBeanInvoker.configureInterceptorStack(ModelMBeanInvoker.java:678)
at org.jboss.mx.modelmbean.XMBean.configureInterceptorStack(XMBean.java:400)
at org.jboss.mx.modelmbean.ModelMBeanInvoker.init(ModelMBeanInvoker.java:504)
at org.jboss.mx.modelmbean.ModelMBeanInvoker.invokePreRegister(ModelMBeanInvoker.java:486)
at org.jboss.mx.server.AbstractMBeanInvoker.preRegister(AbstractMBeanInvoker.java:654)
at org.jboss.mx.server.registry.BasicMBeanRegistry.invokePreRegister(BasicMBeanRegistry.java:697)
at org.jboss.mx.server.registry.BasicMBeanRegistry.registerMBean(BasicMBeanRegistry.java:211)
at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
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.server.MBeanServerImpl$3.run(MBeanServerImpl.java:1422)
at java.security.AccessController.doPrivileged(Native Method)
at org.jboss.mx.server.MBeanServerImpl.registerMBean(MBeanServerImpl.java:1417)
at org.jboss.mx.server.MBeanServerImpl.registerMBean(MBeanServerImpl.java:1350)
at org.jboss.mx.server.MBeanServerImpl.createMBean(MBeanServerImpl.java:345)
at org.jboss.system.ServiceCreator.install(ServiceCreator.java:181)
at org.jboss.system.ServiceConfigurator.internalInstall(ServiceConfigurator.java:449)
at org.jboss.system.ServiceConfigurator.install(ServiceConfigurator.java:171)
at org.jboss.system.ServiceController.install(ServiceController.java:226)
at sun.reflect.GeneratedMethodAccessor11.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
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.install(Unknown Source)
at org.jboss.deployment.SARDeployer.create(SARDeployer.java:249)
at org.jboss.deployment.MainDeployer.create(MainDeployer.java:953)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:807)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:771)
at sun.reflect.GeneratedMethodAccessor12.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
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 $Proxy6.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.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:324)
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.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:324)
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:1007)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:808)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:771)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:755)
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:324)
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:464)
at java.lang.Thread.run(Thread.java:534)
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3973768#3973768
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3973768
19 years, 7 months
[JBoss Seam] - Re: Oracle ADF
by jarkko@jab.fi
I tried to get Trinidad to work with Seam/Facelets in a portlet (JSR-168) environment, short research releaved that there're problems with myfaces, facelets, jsf and portlet containers acting together. Most of the problems are how request, response and all sorts of different sessions are handled inside these frameworks.
For example, Myfaces makes a lot of assumptions, like casting general Request to implementation specific Requests etc, casting objects to MyFaces Impl classes with additional accessor (like setExternalContext), which don't hold when used along with other frameworks.
Thus adding one more (ajax4jsf) is likely to cause additional problems which can only made disappear by adding a lot of unmaintable wrappers and compatabily objects, which in turn make the whole more unstable.
Trinidad replaces some of the internal render components (like one for h:commandButton) and i guess ajax4jsf doesn't like that.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3973764#3973764
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3973764
19 years, 7 months
[EJB/JBoss] - Embedded EJB3 and JNDI lookups
by holmes.j
I'm migrating from a Hibernate setup to an EJB3 setup. We got our web application to work with the regular EJB3 patch for JBoss, but we'd like to be able to run tests outside of the AS. So I'm trying to setup the Embedded container for our JUnit tests.
I've got it to the point where it loads the server, finds the datasource, puts the datasource into JNDI, and then finds and loads the EJB3 Session beans.
The problem is I can't locate the GeoFeatureManagerBean (an EJB3 Stateless session bean) in JNDI. I've tried looking up GeoFeatureManagerBean, GeoFeatureManagerBean/remote, motionbased/GeoFeatureManagerBean/remote, motionbased/GeoFeatureManagerBean. Everything says it cannot be found (btw, motionbased is the name of our ear during the AS deploy. I knew it wouldn't be in there, but I'm desperate now).
I know something's working, because I can find the GeoDataSource at "java:/com.free2be.datasource.GeoDataSource". I get a ClassCastException coming back from it - which is fine with me. But I can't for the life of me determine what the JNDI lookup name for a EJB3 Stateless Session Bean in an embedded context is.
I'm not all that familiar with JNDI, but is there a way to print out everything it has? I know I can use the jmx-console under the AS, but that's not really an option here.
| 0 [main] DEBUG KernelFactory - Starting JBoss Kernel construction...
| 125 [main] DEBUG KernelFactory - Completed JBoss Kernel construction. Duration: 125 milliseconds
| 890 [main] DEBUG BeanXMLDeployer - Parsing file:/C:/dev/mb/main/components/server/test/resources/embedded-jboss-beans.xml took 718 milliseconds
| 1109 [main] DEBUG UserTransactionImpl - new UserTx: org.jboss.ejb3.embedded.UserTransactionImpl@1242b11
| 1187 [main] INFO LocalTxDataSource - Bound datasource to JNDI name 'java:/com.free2be.datasource.GeoDataSource'
| 1187 [main] DEBUG BeanXMLDeployer - Deploying file:/C:/dev/mb/main/components/server/test/resources/embedded-jboss-beans.xml took 1015 milliseconds
| 1719 [main] DEBUG JaccHelper - Initialising JACC Context for deployment: UserProfile
| 1922 [main] DEBUG EjbJarDDObjectFactory - found ejb-jar.xml jar:file:/C:/dev/mb/main/build/deploy/ejb/UserProfile.jar!/META-INF/ejb-jar.xml
| 2469 [main] DEBUG JBossDDObjectFactory - found jboss.xml jar:file:/C:/dev/mb/main/build/deploy/ejb/UserProfile.jar!/META-INF/jboss.xml
| 2531 [main] INFO Ejb3Deployment - EJB3 deployment time took: 812
| 2531 [main] DEBUG JaccHelper - Initialising JACC Context for deployment: GpsTrack
| 2531 [main] DEBUG EjbJarDDObjectFactory - found ejb-jar.xml jar:file:/C:/dev/mb/main/build/deploy/ejb/GpsTrack.jar!/META-INF/ejb-jar.xml
| 2781 [main] DEBUG JBossDDObjectFactory - found jboss.xml jar:file:/C:/dev/mb/main/build/deploy/ejb/GpsTrack.jar!/META-INF/jboss.xml
| 2812 [main] INFO Ejb3Deployment - EJB3 deployment time took: 281
| 2812 [main] DEBUG JaccHelper - Initialising JACC Context for deployment: Activity
| 2812 [main] DEBUG EjbJarDDObjectFactory - found ejb-jar.xml jar:file:/C:/dev/mb/main/build/deploy/ejb/Activity.jar!/META-INF/ejb-jar.xml
| 3109 [main] DEBUG JBossDDObjectFactory - found jboss.xml jar:file:/C:/dev/mb/main/build/deploy/ejb/Activity.jar!/META-INF/jboss.xml
| 3156 [main] INFO Ejb3Deployment - EJB3 deployment time took: 344
| 3156 [main] DEBUG JaccHelper - Initialising JACC Context for deployment: Climate
| 3156 [main] DEBUG EjbJarDDObjectFactory - found ejb-jar.xml jar:file:/C:/dev/mb/main/build/deploy/ejb/Climate.jar!/META-INF/ejb-jar.xml
| 3312 [main] DEBUG JBossDDObjectFactory - found jboss.xml jar:file:/C:/dev/mb/main/build/deploy/ejb/Climate.jar!/META-INF/jboss.xml
| 3328 [main] INFO Ejb3Deployment - EJB3 deployment time took: 172
| 3328 [main] DEBUG JaccHelper - Initialising JACC Context for deployment: Equipment
| 3328 [main] DEBUG EjbJarDDObjectFactory - found ejb-jar.xml jar:file:/C:/dev/mb/main/build/deploy/ejb/Equipment.jar!/META-INF/ejb-jar.xml
| 3500 [main] DEBUG JBossDDObjectFactory - found jboss.xml jar:file:/C:/dev/mb/main/build/deploy/ejb/Equipment.jar!/META-INF/jboss.xml
| 3531 [main] INFO Ejb3Deployment - EJB3 deployment time took: 203
| 3531 [main] DEBUG JaccHelper - Initialising JACC Context for deployment: NoaaWeatherServer
| 3531 [main] DEBUG EjbJarDDObjectFactory - found ejb-jar.xml jar:file:/C:/dev/mb/main/build/deploy/ejb/NoaaWeatherServer.jar!/META-INF/ejb-jar.xml
| 3687 [main] DEBUG JBossDDObjectFactory - found jboss.xml jar:file:/C:/dev/mb/main/build/deploy/ejb/NoaaWeatherServer.jar!/META-INF/jboss.xml
| 3703 [main] INFO Ejb3Deployment - EJB3 deployment time took: 172
| 3703 [main] DEBUG JaccHelper - Initialising JACC Context for deployment: GeoFeatureBeans
| 3828 [main] DEBUG Ejb3AnnotationHandler - found EJB3: ejbName=GenericDaoBean, class=com.garmin.mb.dao.GenericDaoBean, type=STATELESS
| 3844 [main] DEBUG ProxyDeployer - no declared remote bindings for : GenericDaoBean
| 3859 [main] DEBUG Ejb3AnnotationHandler - found EJB3: ejbName=GeoFeatureDaoBean, class=com.garmin.mb.dao.gis.feature.GeoFeatureDaoBean, type=STATELESS
| 3859 [main] DEBUG ProxyDeployer - no declared remote bindings for : GeoFeatureDaoBean
| 3890 [main] DEBUG Ejb3AnnotationHandler - found EJB3: ejbName=GeoFeatureManagerBean, class=com.garmin.mb.framework.gis.feature.GeoFeatureManagerBean, type=STATELESS
| 3890 [main] DEBUG ProxyDeployer - no declared remote bindings for : GeoFeatureManagerBean
| 3890 [main] DEBUG ProxyDeployer - there is remote interfaces for GeoFeatureManagerBean
| 3890 [main] DEBUG ProxyDeployer - default remote binding has jndiName of GeoFeatureManagerBean/remote
| 3953 [main] DEBUG DTDEntityResolver - trying to resolve system-id [http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd]
| 3953 [main] DEBUG EJB3DTDEntityResolver - recognized EJB3 ORM namespace; attempting to resolve on classpath under org/hibernate/ejb
| 3953 [main] DEBUG EJB3DTDEntityResolver - located [http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd] in classpath
| 3969 [main] INFO Ejb3Deployment - EJB3 deployment time took: 266
| 3969 [main] DEBUG JaccHelper - Initialising JACC Context for deployment: PrimaryKey
| 3984 [main] DEBUG EjbJarDDObjectFactory - found ejb-jar.xml jar:file:/C:/dev/mb/main/build/deploy/ejb/PrimaryKey.jar!/META-INF/ejb-jar.xml
| 4031 [main] DEBUG JBossDDObjectFactory - found jboss.xml jar:file:/C:/dev/mb/main/build/deploy/ejb/PrimaryKey.jar!/META-INF/jboss.xml
| 4062 [main] INFO Ejb3Deployment - EJB3 deployment time took: 93
| lookup
| UserTransaction: org.jboss.ejb3.embedded.UserTransactionImpl
| lookup
| UserTransaction: org.jboss.ejb3.embedded.UserTransactionImpl
| lookup
| UserTransaction: org.jboss.ejb3.embedded.UserTransactionImpl
| lookup
| UserTransaction: org.jboss.ejb3.embedded.UserTransactionImpl
| lookup
| UserTransaction: org.jboss.ejb3.embedded.UserTransactionImpl
| lookup
| UserTransaction: org.jboss.ejb3.embedded.UserTransactionImpl
| 4062 [main] INFO MCKernelAbstraction - installing bean: persistence.units:jar=GeoFeatureBeans.jar,unitName=GeoFeatureDataSource with dependencies:
| 4062 [main] INFO MCKernelAbstraction - AbstractDemandMetaData(a)8b058b{demand=com.free2be.datasource.GeoDataSource whenRequiredDescribed}
| 4109 [main] DEBUG EJBContainer - Initialising interceptors for GenericDaoBean...
| 4109 [main] DEBUG EJBContainer - Default interceptors: null
| 4109 [main] DEBUG EJBContainer - Class interceptors: []
| 4109 [main] DEBUG EJBContainer - All applicable interceptor classes: []
| 4109 [main] DEBUG EJBContainer - Initialising interceptors for GeoFeatureDaoBean...
| 4109 [main] DEBUG EJBContainer - Default interceptors: null
| 4109 [main] DEBUG EJBContainer - Class interceptors: []
| 4109 [main] DEBUG EJBContainer - All applicable interceptor classes: []
| 4219 [main] DEBUG EJBContainer - Initialising interceptors for GeoFeatureManagerBean...
| 4219 [main] DEBUG EJBContainer - Default interceptors: null
| 4219 [main] DEBUG EJBContainer - Class interceptors: []
| 4219 [main] DEBUG EJBContainer - All applicable interceptor classes: []
| 4219 [main] INFO MCKernelAbstraction - installing bean: jboss.j2ee:jar=GeoFeatureBeans,name=GenericDaoBean,service=EJB3 with dependencies:
| 4219 [main] INFO MCKernelAbstraction - AbstractDemandMetaData@df2d38{demand=persistence.units:jar=GeoFeatureBeans.jar,unitName=GeoFeatureDataSource whenRequiredDescribed}
| 4219 [main] DEBUG Ejb3Deployment - Bound ejb3 container jboss.j2ee:service=EJB3,jar=GeoFeatureBeans,name=GenericDaoBean
| 4219 [main] INFO MCKernelAbstraction - installing bean: jboss.j2ee:jar=GeoFeatureBeans,name=GeoFeatureDaoBean,service=EJB3 with dependencies:
| 4219 [main] INFO MCKernelAbstraction - AbstractDemandMetaData@873723{demand=persistence.units:jar=GeoFeatureBeans.jar,unitName=GeoFeatureDataSource whenRequiredDescribed}
| 4234 [main] DEBUG Ejb3Deployment - Bound ejb3 container jboss.j2ee:service=EJB3,jar=GeoFeatureBeans,name=GeoFeatureDaoBean
| 4234 [main] INFO MCKernelAbstraction - installing bean: jboss.j2ee:jar=GeoFeatureBeans,name=GeoFeatureManagerBean,service=EJB3 with dependencies:
| 4234 [main] INFO MCKernelAbstraction - AbstractDemandMetaData@1f38fc6{demand=jboss.j2ee:jar=GeoFeatureBeans,name=GeoFeatureDaoBean,service=EJB3 whenRequiredDescribed}
| 4234 [main] DEBUG Ejb3Deployment - Bound ejb3 container jboss.j2ee:service=EJB3,jar=GeoFeatureBeans,name=GeoFeatureManagerBean
| lookup
| UserTransaction: org.jboss.ejb3.embedded.UserTransactionImpl
| lookup
| UserTransaction: org.jboss.ejb3.embedded.UserTransactionImpl
|
Here's the test-code ...
package com.garmin.mb.dao.gis.feature.pc;
|
| import static org.junit.Assert.assertEquals;
| import static org.junit.Assert.assertTrue;
| import static org.junit.Assert.fail;
|
| import java.util.NoSuchElementException;
|
| import org.junit.AfterClass;
| import org.junit.Before;
| import org.junit.BeforeClass;
| import org.junit.Test;
|
| import com.garmin.mb.dao.EJB3TestContainer;
| import com.garmin.mb.framework.gis.feature.pc.PopulatedPlaceClassification;
|
| public class PopulatedPlaceClassifcationDAOUnitTest {
|
| private static EJB3TestContainer container;
|
| private PopulatedPlaceClassificationDao dao;
|
| @BeforeClass
| public static void beforeClass() throws Exception {
| container = new EJB3TestContainer();
| container.startup();
| }
|
| @AfterClass
| public static void afterClass() throws Exception {
| container.shutdown();
| }
|
| @Before
| public void setUp() {
| Object daoToCast = EJB3TestContainer.lookup("GeoFeatureManagerBean/remote");
| this.dao = (PopulatedPlaceClassificationDao) daoToCast;
| }
|
| @Test
| public void testFindById() {
| long id = 2;
| PopulatedPlaceClassification value = dao.findById(id, false);
|
| assert value != null;
| long pkValue = value.getPopulatedPlaceClassificationPk();
|
| assertEquals(pkValue, id);
| assertEquals("Medium-High", value.getDatabaseDescription());
| }
|
| @Test
| public void testFindValue() {
| int key = 3;
| PopulatedPlaceClassification value = dao.findByCode(key);
| assertEquals("Medium", value.getDatabaseDescription());
| }
|
| @Test
| public void testFindValueNotPresent() {
| int key = 991;
|
| try {
| dao.findByCode(key);
| fail();
| } catch (NoSuchElementException e) {
| assertTrue(true);
| }
| }
| }
|
jndi.properties ...
java.naming.factory.initial=org.jnp.interfaces.LocalOnlyContextFactory
| java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3973763#3973763
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3973763
19 years, 7 months