[JBoss Seam] - Seam 2 migration problem
by caye
Hi, first of all, thanks for the release of the Seam 2.0.0.CR1, its nice to see that you are working hard in new releases :)
I tried to migrate my webapp from the beta version of seam 2.0.0 to this one, and i'm getting this error all the time:
ERROR [[/]] Exception sending context initialized event to listener instance of class org.jboss.web.jsf.integration.config.JBossJSFConfigureListener
| java.lang.NoClassDefFoundError: org/ajax4jsf/application/ViewHandlerWrapper
| at java.lang.ClassLoader.defineClass1(Native Method)
| at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
| at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
| at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:1817)
| at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:872)
| at org.jboss.web.tomcat.service.WebAppClassLoader.findClass(WebAppClassLoader.java:139)
| at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1325)
| at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1204)
| at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
| at java.lang.Class.getDeclaredConstructors0(Native Method)
| at java.lang.Class.privateGetDeclaredConstructors(Class.java:2357)
| at java.lang.Class.getConstructor0(Class.java:2671)
| at java.lang.Class.newInstance0(Class.java:321)
| at java.lang.Class.newInstance(Class.java:303)
| at com.sun.faces.config.ConfigureListener.configure(ConfigureListener.java:825)
| at com.sun.faces.config.ConfigureListener.configure(ConfigureListener.java:486)
| at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:381)
| at org.jboss.web.jsf.integration.config.JBossJSFConfigureListener.contextInitialized(JBossJSFConfigureListener.java:69)
| at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3854)
| at org.apache.catalina.core.StandardContext.start(StandardContext.java:4359)
| at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:761)
| at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:741)
| at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:553)
| 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.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:297)
| at org.jboss.mx.server.RawDynamicInvoker.invoke(RawDynamicInvoker.java:164)
| at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
| at org.apache.catalina.core.StandardContext.init(StandardContext.java:5310)
| 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.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:297)
| at org.jboss.mx.server.RawDynamicInvoker.invoke(RawDynamicInvoker.java:164)
| at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
| at org.jboss.web.tomcat.service.TomcatDeployer.performDeployInternal(TomcatDeployer.java:301)
| at org.jboss.web.tomcat.service.TomcatDeployer.performDeploy(TomcatDeployer.java:104)
| at org.jboss.web.AbstractWebDeployer.start(AbstractWebDeployer.java:375)
| at org.jboss.web.WebModule.startModule(WebModule.java:83)
| at org.jboss.web.WebModule.startService(WebModule.java:61)
| at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
| at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
| at sun.reflect.GeneratedMethodAccessor221.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 $Proxy45.start(Unknown Source)
| at org.jboss.web.AbstractWebContainer.start(AbstractWebContainer.java:466)
| at sun.reflect.GeneratedMethodAccessor223.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.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.interceptor.DynamicInterceptor.invoke(DynamicInterceptor.java:97)
| at org.jboss.system.InterceptorServiceMBeanSupport.invokeNext(InterceptorServiceMBeanSupport.java:238)
| at org.jboss.ws.integration.jboss42.DeployerInterceptor.start(DeployerInterceptor.java:93)
| at org.jboss.deployment.SubDeployerInterceptorSupport$XMBeanInterceptor.start(SubDeployerInterceptorSupport.java:188)
| at org.jboss.deployment.SubDeployerInterceptor.invoke(SubDeployerInterceptor.java:95)
| 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 $Proxy46.start(Unknown Source)
| at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1025)
| at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1015)
| at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819)
| at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
| at sun.reflect.GeneratedMethodAccessor18.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.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$ScannerThread.loop(AbstractDeploymentScanner.java:274)
| at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run(AbstractDeploymentScanner.java:225)
It could be nice if you could suggest why i'm getting this all the time (i swear that i have tried all the ways possible before ask this in the forum).
Thanks in advance!
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4088309#4088309
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4088309
18 years, 7 months
[JBoss Seam] - accessing facelet's source tag attributes
by amashtakov
Hi,
After reading a bit about facelets source tags I decided to develop
a small component to display prod. catalog:
This is a facelet taglib snippet:
<tag-name>pc</tag-name>
../test/page2.xhtml
This is a snippet from page2.xhtml:
<ui:component binding="#{pcBrowseTree.me}"
xmlns="http://www.w3.org/1999/xhtml">
<h2>#{title}</h2>
...
</ui:component>
And this is a tag usage snippet:
<t:pc name="Browse for products" parent_id="14" />
I'm trying to access parent_id property from pcBrowseTree bean, but with
no success:
FacesContext fctx = FacesContext.getCurrentInstance();
Application app = fctx.getApplication();
VariableResolver vr = app.getVariableResolver();
log.debug(" - getVariableResolver(): " + vr);
log.debug(" - variable resolved to: " + vr.resolveVariable(fctx, "parent_id"));
The last line outputs null. In case if I replace "parent_id" to
"facesContext" the variable is resolved.
Is any way to access source tag's attributes from Java bean ?
Thank you in advance,
/Alexander
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4088307#4088307
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4088307
18 years, 7 months
[JNDI/Naming/Network] - NameNotFoundException in Web-Application for 'java:comp/env'
by hiro.protagonist
I am deploying a web application into JBoss 4.0.4GA with an embedded Tomcat 5.5 . The deployment descriptor (WEB-INF/web.xml) contains an <env-entry>:
| ...
| <!-- Setup ENC for this webapp -->
| <env-entry>
| <env-entry-name>ecms/configfile</env-entry-name>
| <env-entry-value>server.properties</env-entry-value>
| <env-entry-type>java.lang.String</env-entry-type>
| </env-entry>
| ...
|
This entry I would like to access via JNDI:
| Context initial = new InitialContext();
| Context environment = (Context)initial.lookup("java:comp/env");
|
This results in a NameNotFoundException for "env". The code works with a standalone Tomcat but not inside JBoss. The JNDI-View confirms that there is no "java:comp/env":
| java: Namespace
|
| +- XAConnectionFactory (class: org.jboss.mq.SpyXAConnectionFactory)
| +- DefaultDS (class: org.jboss.resource.adapter.jdbc.WrapperDataSource)
| +- SecurityProxyFactory (class: org.jboss.security.SubjectSecurityProxyFactory)
| +- DefaultJMSProvider (class: org.jboss.jms.jndi.JNDIProviderAdapter)
| +- comp (class: javax.naming.Context)
| +- JmsXA (class: org.jboss.resource.adapter.jms.JmsConnectionFactoryImpl)
| +- ConnectionFactory (class: org.jboss.mq.SpyConnectionFactory)
| +- jaas (class: javax.naming.Context)
| | +- HsqlDbRealm (class: org.jboss.security.plugins.SecurityDomainContext)
| | +- jbossmq (class: org.jboss.security.plugins.SecurityDomainContext)
| | +- JmsXARealm (class: org.jboss.security.plugins.SecurityDomainContext)
| +- timedCacheFactory (class: javax.naming.Context)
| Failed to lookup: timedCacheFactory, errmsg=org.jboss.util.TimedCachePolicy cannot be cast to javax.naming.NamingEnumeration
| +- TransactionPropagationContextExporter (class: org.jboss.tm.TransactionPropagationContextFactory)
| +- StdJMSPool (class: org.jboss.jms.asf.StdServerSessionPoolFactory)
| +- Mail (class: javax.mail.Session)
| +- TransactionPropagationContextImporter (class: org.jboss.tm.TransactionPropagationContextImporter)
| +- TransactionManager (class: org.jboss.tm.TxManager)
|
My question: How can this happen? I thought the ENC has to exist for every application component, including webapps.
How do I need to configure JBoss to make an ENC available for my web application?
Any help really appreciated.
Forgive me my spelling errors since english is not my native language.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4088305#4088305
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4088305
18 years, 7 months
[JBoss Seam] - Re: Further extending an EntityHome
by mustaghattack
Hi, about the EntityHome class I think it would be better to just pass the entity class as a parameter for the constructor, or at least to have a parameterized constructor.
I've done a quick performance test to see the reflection overhead :
with a Sun 1.6 JVM it's > 30.
| package test.java;
|
| import java.lang.reflect.ParameterizedType;
| import java.lang.reflect.Type;
|
| public class GuessParameterizePerformanceTest {
| public static class GuessParam< E > {
| private Class< E > entityClass;
|
| public GuessParam() {
| getEntityClass();
| }
|
| public Class<E> getEntityClass()
| {
| if (entityClass==null)
| {
| Type type = getClass().getGenericSuperclass();
| if (type instanceof ParameterizedType)
| {
| ParameterizedType paramType = (ParameterizedType) type;
| entityClass = (Class<E>) paramType.getActualTypeArguments()[0];
| }
| else
| {
| throw new IllegalArgumentException("Could not guess entity class by reflection");
| }
| }
| return entityClass;
| }
| }
|
| public static class DontGuessParam< E > {
| private Class< E > entityClass;
|
| public DontGuessParam( Class< E > cls ) {
| this.entityClass = cls;
| getEntityClass();
| }
|
| public Class< E > getEntityClass() {
| return entityClass;
| }
| }
|
| public static class GuessParamChild extends GuessParam< String > {
| }
|
| public static class DontGuessParamChild extends DontGuessParam< String > {
| public DontGuessParamChild() {
| super( String.class );
| }
| }
|
| public static void main(String[] args) {
| float avgGuess = 0, avgDontGuess = 0;
| float nbLoop = 5, nbInstanciation = 1000000;
| long time;
|
| for( long i = 0; i < nbLoop; i ++ ) {
| time = System.currentTimeMillis();
| for( long j = 0; j < nbInstanciation; j ++ ) {
| GuessParamChild guess = new GuessParamChild();
| }
| avgGuess += System.currentTimeMillis() - time;
|
| time = System.currentTimeMillis();
| for( long j = 0; j < nbInstanciation; j ++ ) {
| DontGuessParamChild dontGuess = new DontGuessParamChild();
| }
| avgDontGuess += System.currentTimeMillis() - time;
| }
|
| System.out.println("avgGuess = " + (avgGuess / nbLoop));
| System.out.println("avgDontGuess = " + (avgDontGuess / nbLoop));
| System.out.println( "Guess overhead : " + ( avgGuess - avgDontGuess ) / avgDontGuess );
| }
| }
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4088302#4088302
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4088302
18 years, 7 months
[EJB 3.0] - EJB 3.0, Database migration tool
by runar.solberg@adactus.no
Hi,
I have a system which is using JBoss an hibernate, with EJB.3.0. My system can be deployed using diffent database systems, e.g. PostgreSQL, Hypersonic, Oracle, MySql, as I have no database specific code. We use general EJB QL for our queries. So lets say I deploy my application using Mysql. The datamodel is generated in the Mysql DB and everything works fine. Now, after a while I whish to change to say Hypersonic DB or PostgreSQL. I want to keep the allready persisted data. But I have a problem as e.g. enums are translated to different datatypes for the different DBMS. I cannot simply e.g. do an SQL export / import between the different DBMSs, as the O/R mappings will fail. So what I would need is some way to migrate the data through the EJB context, first populating the existing enitities, and do a new O/R mapping to the new DBMS. It there such a tool available? Surely other people must have faced this issue before me?
Thanks for your response.
-R
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4088297#4088297
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4088297
18 years, 7 months