[JBossCache] - Re: JBC 2 performance
by aditsu
Besides that, I also got a bunch of ConcurrentModificationException's while doing a multi-threaded benchmark just now:
java.util.ConcurrentModificationException
at java.util.HashMap$HashIterator.nextEntry(HashMap.java:841)
at java.util.HashMap$EntryIterator.next(HashMap.java:883)
at java.util.HashMap$EntryIterator.next(HashMap.java:881)
at org.jboss.cache.util.MapCopy.(MapCopy.java:40)
at org.jboss.cache.UnversionedNode.getDataDirect(UnversionedNode.java:205)
at org.jboss.cache.CacheImpl._remove(CacheImpl.java:2545)
at sun.reflect.GeneratedMethodAccessor21.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.jgroups.blocks.MethodCall.invoke(MethodCall.java:330)
at org.jboss.cache.interceptors.CallInterceptor.invoke(CallInterceptor.java:49)
at org.jboss.cache.interceptors.Interceptor.invoke(Interceptor.java:76)
[...]
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4066083#4066083
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4066083
18Â years, 9Â months
[EJB 3.0] - Problems with TestNG
by chawax
Hi,
I use AndroMDA to generate a project with EJB3. It generates test classes with TestNG, which use Jboss EJB3 embedded container.
But when I run the tests, they fail with the following exception :
java.lang.RuntimeException: java.net.MalformedURLException: no protocol: and
The full stack trace :
-------------------------------------------------------
| T E S T S
| -------------------------------------------------------
| WARN 20-07 10:19:43,713 (Ejb3Configuration.java:addXMLEntities:365) -Persistence provider caller does not implements the EJB3 spec correctly. PersistenceUnitInfo.getNewTempClassLoader() is null.
| WARN 20-07 10:19:44,119 (AnnotationBinder.java:bindClass:543) -Illegal use of @Table in a subclass of a SINGLE_TABLE hierarchy: fr.horoquartz.t4.core.absence.DemandeAbsence
| WARN 20-07 10:19:47,230 (JBossTimerServiceFactory.java:restoreTimerService:112) -TIMER SERVICE IS NOT INSTALLED
| WARN 20-07 10:19:47,324 (JBossTimerServiceFactory.java:restoreTimerService:112) -TIMER SERVICE IS NOT INSTALLED
| WARN 20-07 10:19:47,371 (JBossTimerServiceFactory.java:restoreTimerService:112) -TIMER SERVICE IS NOT INSTALLED
| WARN 20-07 10:19:47,464 (JBossTimerServiceFactory.java:restoreTimerService:112) -TIMER SERVICE IS NOT INSTALLED
| WARN 20-07 10:19:47,527 (JBossTimerServiceFactory.java:restoreTimerService:112) -TIMER SERVICE IS NOT INSTALLED
| WARN 20-07 10:19:47,589 (JBossTimerServiceFactory.java:restoreTimerService:112) -TIMER SERVICE IS NOT INSTALLED
| WARN 20-07 10:19:47,652 (JBossTimerServiceFactory.java:restoreTimerService:112) -TIMER SERVICE IS NOT INSTALLED
| WARN 20-07 10:19:47,902 (JBossTimerServiceFactory.java:restoreTimerService:112) -TIMER SERVICE IS NOT INSTALLED
| WARN 20-07 10:19:47,965 (JBossTimerServiceFactory.java:restoreTimerService:112) -TIMER SERVICE IS NOT INSTALLED
| WARN 20-07 10:19:47,980 (JBossTimerServiceFactory.java:restoreTimerService:112) -TIMER SERVICE IS NOT INSTALLED
| WARN 20-07 10:19:48,027 (JBossTimerServiceFactory.java:restoreTimerService:112) -TIMER SERVICE IS NOT INSTALLED
| WARN 20-07 10:19:48,074 (JBossTimerServiceFactory.java:restoreTimerService:112) -TIMER SERVICE IS NOT INSTALLED
| WARN 20-07 10:19:48,105 (JBossTimerServiceFactory.java:restoreTimerService:112) -TIMER SERVICE IS NOT INSTALLED
| WARN 20-07 10:19:48,136 (JBossTimerServiceFactory.java:restoreTimerService:112) -TIMER SERVICE IS NOT INSTALLED
| WARN 20-07 10:19:48,168 (JBossTimerServiceFactory.java:restoreTimerService:112) -TIMER SERVICE IS NOT INSTALLED
| WARN 20-07 10:19:48,230 (JBossTimerServiceFactory.java:restoreTimerService:112) -TIMER SERVICE IS NOT INSTALLED
| WARN 20-07 10:19:48,262 (JBossTimerServiceFactory.java:restoreTimerService:112) -TIMER SERVICE IS NOT INSTALLED
| WARN 20-07 10:19:48,340 (JBossTimerServiceFactory.java:restoreTimerService:112) -TIMER SERVICE IS NOT INSTALLED
| WARN 20-07 10:19:48,387 (JBossTimerServiceFactory.java:restoreTimerService:112) -TIMER SERVICE IS NOT INSTALLED
| WARN 20-07 10:19:48,418 (JBossTimerServiceFactory.java:restoreTimerService:112) -TIMER SERVICE IS NOT INSTALLED
| WARN 20-07 10:19:48,449 (JBossTimerServiceFactory.java:restoreTimerService:112) -TIMER SERVICE IS NOT INSTALLED
| WARN 20-07 10:19:48,496 (JBossTimerServiceFactory.java:restoreTimerService:112) -TIMER SERVICE IS NOT INSTALLED
| WARN 20-07 10:19:48,543 (JBossTimerServiceFactory.java:restoreTimerService:112) -TIMER SERVICE IS NOT INSTALLED
| WARN 20-07 10:19:48,715 (JBossTimerServiceFactory.java:restoreTimerService:112) -TIMER SERVICE IS NOT INSTALLED
| WARN 20-07 10:19:48,762 (JBossTimerServiceFactory.java:restoreTimerService:112) -TIMER SERVICE IS NOT INSTALLED
| WARN 20-07 10:19:48,777 (JBossTimerServiceFactory.java:restoreTimerService:112) -TIMER SERVICE IS NOT INSTALLED
| lookup
| CodeHoraireDao: org.jnp.interfaces.NamingContext
| I18nLibelleTraduitDao: org.jnp.interfaces.NamingContext
| I18nAttributDao: org.jnp.interfaces.NamingContext
| SectionHoraireDao: org.jnp.interfaces.NamingContext
| LigneDemandeAbsenceDao: org.jnp.interfaces.NamingContext
| RoleDao: org.jnp.interfaces.NamingContext
| JourneeEmployeDao: org.jnp.interfaces.NamingContext
| ServiceAbsenceBean: org.jnp.interfaces.NamingContext
| ServiceDemandeBean: org.jnp.interfaces.NamingContext
| ServiceEmployeBean: org.jnp.interfaces.NamingContext
| LigneProfilHoraireJournalierDao: org.jnp.interfaces.NamingContext
| ProfilHoraireJournalierDao: org.jnp.interfaces.NamingContext
| MotifAbsenceDao: org.jnp.interfaces.NamingContext
| AbsenceDao: org.jnp.interfaces.NamingContext
| UserTransaction: org.jboss.ejb3.embedded.UserTransactionImpl
| DemandeDao: org.jnp.interfaces.NamingContext
| EmployeDao: org.jnp.interfaces.NamingContext
| DemandeAbsenceDao: org.jnp.interfaces.NamingContext
| ServiceWorkflowBean: org.jnp.interfaces.NamingContext
| ServiceDeclarantBean: org.jnp.interfaces.NamingContext
| I18nLanguageDao: org.jnp.interfaces.NamingContext
| CompteUtilisateurDao: org.jnp.interfaces.NamingContext
| ServiceUtilisateurBean: org.jnp.interfaces.NamingContext
| LigneCodeHoraireDao: org.jnp.interfaces.NamingContext
| AttributionHoraireDao: org.jnp.interfaces.NamingContext
| I18nServiceBean: org.jnp.interfaces.NamingContext
| LigneAttributionHoraireDao: org.jnp.interfaces.NamingContext
| Running t4Seam Services Test
| WARN 20-07 10:19:48,918 (ServiceEmployeTest.java:testCreateEmploye:74) -Failed test testCreateEmploye()
| java.lang.RuntimeException: java.net.MalformedURLException: no protocol: and
| at org.jboss.aop.joinpoint.MethodInvocation.getArguments(MethodInvocation.java:281)
| at org.jboss.ejb3.stateless.StatelessContainer.dynamicInvoke(StatelessContainer.java:258)
| at org.jboss.ejb3.remoting.IsLocalInterceptor.invoke(IsLocalInterceptor.java:58)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.ejb3.stateless.StatelessRemoteProxy.invoke(StatelessRemoteProxy.java:102)
| at $Proxy39.createEmploye(Unknown Source)
| at fr.horoquartz.t4.core.employe.test.ServiceEmployeTest.testCreateEmploye(ServiceEmployeTest.java:70)
| 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.testng.internal.MethodHelper.invokeMethod(MethodHelper.java:552)
| at org.testng.internal.Invoker.invokeMethod(Invoker.java:407)
| at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:778)
| at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:105)
| at org.testng.TestRunner.privateRun(TestRunner.java:682)
| at org.testng.TestRunner.run(TestRunner.java:566)
| at org.testng.SuiteRunner.privateRun(SuiteRunner.java:220)
| at org.testng.SuiteRunner.run(SuiteRunner.java:146)
| at org.testng.TestNG.createAndRunSuiteRunners(TestNG.java:713)
| at org.testng.TestNG.runSuitesLocally(TestNG.java:676)
| at org.apache.maven.surefire.testng.TestNGExecutor.executeTestNG(TestNGExecutor.java:64)
| at org.apache.maven.surefire.testng.TestNGXmlTestSuite.execute(TestNGXmlTestSuite.java:75)
| at org.apache.maven.surefire.Surefire.run(Surefire.java:129)
| 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.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:225)
| at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:747)
| Caused by: java.net.MalformedURLException: no protocol: and
| at java.net.URL.<init>(URL.java:567)
| at java.net.URL.<init>(URL.java:464)
| at java.net.URL.<init>(URL.java:413)
| at sun.rmi.server.LoaderHandler.pathToURLs(LoaderHandler.java:747)
| at sun.rmi.server.LoaderHandler.loadClass(LoaderHandler.java:147)
| at java.rmi.server.RMIClassLoader$2.loadClass(RMIClassLoader.java:620)
| at java.rmi.server.RMIClassLoader.loadClass(RMIClassLoader.java:247)
| at sun.rmi.server.MarshalInputStream.resolveClass(MarshalInputStream.java:197)
| at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1544)
| at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1466)
| at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1699)
| at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1305)
| at java.io.ObjectInputStream.readArray(ObjectInputStream.java:1634)
| at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1299)
| at java.io.ObjectInputStream.readObject(ObjectInputStream.java:348)
| at java.rmi.MarshalledObject.get(MarshalledObject.java:135)
| at org.jboss.aop.joinpoint.MethodInvocation.getArguments(MethodInvocation.java:276)
| ... 29 more
|
My test method :
@org.testng.annotations.Test
| public void testCreateEmploye()
| {
| try
| {
| fr.horoquartz.t4.core.employe.ServiceEmployeRemote serviceEmploye = (fr.horoquartz.t4.core.employe.ServiceEmployeRemote)EJB3Container.getInitialContext().lookup("ServiceEmployeBean/remote");
|
| VOEmploye employe = new VOEmploye();
| employe.setAdresse("adresse");
| employe.setDateNaissance((new GregorianCalendar(1974, Calendar.SEPTEMBER, 7)).getTime());
| employe.setMail("mail");
| employe.setMatricule("000000");
| employe.setNom("nom");
| employe.setPays("FRANCE");
| employe.setPrenom("prenom");
| employe.setTelephone("00 00 00 00 00");
| employe.setVille("VILLE");
|
| serviceEmploye.createEmploye(employe);
| }
| catch (Exception ex)
| {
| logger.warn("Failed test testCreateEmploye()", ex);
| }
| }
|
There is no error when I don't call the serviceEmploye.createEmploye() method, so I think there is no problem while finding the ServiceEmployeBean session bean in JNDI context. But it crashes when I call methods on this session bean.
A piece of the ejb-jar.xml file :
<session>
| <description>
| <![CDATA[
|
| ]]>
| </description>
| <ejb-name>ServiceEmployeBean</ejb-name>
| <remote>fr.horoquartz.t4.core.employe.ServiceEmployeRemote</remote>
| <ejb-class>fr.horoquartz.t4.core.employe.ServiceEmployeBean</ejb-class>
| <session-type>Stateless</session-type>
| <transaction-type>Container</transaction-type>
| </session>
|
For what I understood, the EJB3 embedded container is started with this class :
// license-header java merge-point
| //
| // Generated by: EJB3Container.vsl in andromda-ejb3-cartridge.
| //
| package fr.horoquartz.t4.seam.test;
|
| import java.util.Hashtable;
|
| import javax.naming.Context;
| import javax.naming.InitialContext;
|
| import org.apache.commons.logging.Log;
| import org.apache.commons.logging.LogFactory;
| import org.jboss.ejb3.embedded.EJB3StandaloneBootstrap;
| import org.jboss.ejb3.embedded.EJB3StandaloneDeployer;
|
| import org.testng.annotations.Configuration;
|
| /**
| * Boots the JBoss Microcontainer with an EJB3 configuration.
| *
| * You can also use this class to lookup managed beans from JNDI.
| *
| * @author vancek
| * <p><b>Note</b>. code was copied from christian.bauer(a)jboss.com
| * example on Hibernate's CaveatEmptor application
| * </p>
| */
| public class EJB3Container
| {
| private final static Log logger = LogFactory.getLog(EJB3Container.class);
|
| private EJB3StandaloneDeployer deployer;
|
| @Configuration(beforeTest = true)
| public void startup()
| {
| try
| {
| logger.info("==>Bootstrapping EJB3 container...");
|
| // Boot the JBoss Microcontainer with EJB3 settings, loads ejb3-interceptors-aop.xml
| EJB3StandaloneBootstrap.boot(null);
|
| // Uncomment the following to enable security
| // logger.info("==>Deploying security-beans");
| // EJB3StandaloneBootstrap.deployXmlResource("security-beans.xml");
| // logger.info("==>Deployed security-beans");
|
| // logger.info("==>Deploying jboss-jms-beans - init JBoss MQ core services");
| // EJB3StandaloneBootstrap.deployXmlResource("jboss-jms-beans.xml");
| // logger.info("==>Deployed jboss-jms-beans");
|
| // logger.info("==>Configure test queue and topic");
| // EJB3StandaloneBootstrap.deployXmlResource("testjms.xml");
| // logger.info("==>Configured test queues and topics");
|
| logger.info("==>Deploying ejb3");
| EJB3StandaloneBootstrap.scanClasspath();
|
| // Add all EJBs found in the archive that has this file
| deployer = new EJB3StandaloneDeployer();
|
| // Deploy everything we got
| deployer.setKernel(EJB3StandaloneBootstrap.getKernel());
| deployer.create();
| logger.info("==>Deployer created");
| deployer.start();
| logger.info("==>Deployer started");
| logger.info("==>End of bootstrapping EJB3 container");
| }
| catch (Exception ex)
| {
| logger.error(ex.getMessage(), ex);
| throw new RuntimeException(ex);
| }
| }
|
| @Configuration(afterTest = true)
| public void shutdown()
| {
| try
| {
| logger.info("==>Invoking EJB3.shutdown...");
| deployer.stop();
| deployer.destroy();
| EJB3StandaloneBootstrap.shutdown();
| }
| catch (Exception ex)
| {
| throw new RuntimeException(ex);
| }
| }
|
| private static InitialContext initialContext = null;
| private static InitialContext securedInitialContext = null;
|
| /**
| * Return a new InitialContext based on org.jnp.interfaces.LocalOnlyContextFactory,
| * setting the the default context.
| *
| * @return InitialContext
| * @throws Exception
| */
| public static InitialContext newInitialContext()
| throws Exception
| {
| Hashtable props = getInitialContextProperties();
| initialContext = new InitialContext(props);
| return initialContext;
| }
|
| /**
| * Return a new InitialContext based on org.jboss.security.jndi.JndiLoginInitialContextFactory,
| * setting the default context. Use the specified username and password to set the security context.
| *
| * @param principal
| * @param credential
| * @return InitialContext
| * @throws Exception
| */
| public static InitialContext newInitialContext(String principal, String credential)
| throws Exception
| {
| Hashtable props = getInitialContextProperties(principal, credential);
| securedInitialContext = new InitialContext(props);
| return securedInitialContext;
| }
|
| /**
| * Return the default InitialContext based on org.jnp.interfaces.LocalOnlyContextFactory
| * if one is already instantiated, otherwise create a new InitialContext and set as the default.
| *
| * @return InitialContext
| * @throws Exception
| */
| public static InitialContext getInitialContext()
| throws Exception
| {
| if (initialContext == null)
| {
| Hashtable props = getInitialContextProperties();
| initialContext = new InitialContext(props);
| }
| return initialContext;
| }
|
| /**
| * Return the default InitialContext based on org.jboss.security.jndi.JndiLoginInitialContextFactory
| * if one is already instantiated, otherwise create a new InitialContext and set as the default.
| * Use the specified username and password to set the security context.
| *
| * @param principal
| * @param credential
| * @return
| * @throws Exception
| */
| public static InitialContext getInitialContext(String principal, String credential)
| throws Exception
| {
| if (securedInitialContext == null)
| {
| Hashtable props = getInitialContextProperties(principal, credential);
| securedInitialContext = new InitialContext(props);
| }
| return securedInitialContext;
| }
|
| private static Hashtable getInitialContextProperties()
| {
| Hashtable<String, String> props = new Hashtable<String, String>();
| props.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.LocalOnlyContextFactory");
| props.put(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces");
| return props;
| }
|
| private static Hashtable getInitialContextProperties(String principal, String credential)
| {
| Hashtable<String, String> props = new Hashtable<String, String>();
| props.put(Context.INITIAL_CONTEXT_FACTORY, "org.jboss.security.jndi.JndiLoginInitialContextFactory");
| props.put(Context.SECURITY_PRINCIPAL, principal);
| props.put(Context.SECURITY_CREDENTIALS, credential);
| return props;
| }
| }
|
I am new to EJB3 and TestNG, so it looks like chinese to me. Any idea ?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4066082#4066082
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4066082
18Â years, 9Â months
[JBoss Seam] - PropertyNotFoundException?
by SmokingAPipe
I have an EJB application, which uses a Swing desktop interface. I'm finding that, while Swing can produce better UIs than are possible in web apps, developing in Swing is slower and more painful than developing in good ole' JBoss Seam (side note: it would be super-cool if there were some Seam-style way to build Swing apps).
Anyway, so I'm trying to add Seam and web pages to my existing app. And when I try to access any of the beans, I get an exception:
| 02:06:52,316 ERROR [SeamLoginModule] Error invoking login method
| javax.faces.el.EvaluationException: javax.el.PropertyNotFoundException: Target Unreachable, identifier 'authenticator' resolved to null
| at com.sun.faces.application.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:84)
| at org.jboss.seam.actionparam.ActionParamBindingHelper.invokeTheExpression(ActionParamBindingHelper.java:58)
| at org.jboss.seam.actionparam.ActionParamMethodBinding.invoke(ActionParamMethodBinding.java:75)
| (etc)
|
I have an ejb-jar.xml file which is exactly the same one that comes with jboss.
I'm using JBoss AS 4.2.1 and JBoss Seam 1.2.1 and all this is with Java 6.
Any suggestions? I know this is some very simple configuration issue but I'm not getting past it.
Thanks
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4066081#4066081
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4066081
18Â years, 9Â months