[Installation, Configuration & DEPLOYMENT] - Re: Problem deploying a JPA web application
by jimpo
You are correct with your bet, sir. I do have hibernate JARs in my WAR.
I tried removing the hibernate*.jars from my WAR, but I am still getting a classcast error, a different one this time:
12:04:25,625 INFO [TomcatDeployer] deploy, ctxPath=/sujuvuus-webapp-1.0-SNAPSHOT, warUrl=.../tmp/deploy/tmp18674sujuvuus-webapp-1.0-SNAPSHOT-exp.war/
12:04:32,015 INFO [STDOUT] ERROR [ScannerThread] ContextLoader.initWebApplicationContext(203) | Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.transaction.interceptor.TransactionAttributeSou
rceAdvisor': Cannot create inner bean '(inner bean)' of type [org.springframework.transaction.interceptor.TransactionInterceptor] while setting bean proper
ty 'transactionInterceptor'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)': Can
not resolve reference to bean 'transactionManager' while setting bean property 'transactionManager'; nested exception is org.springframework.beans.factory.
BeanCreationException: Error creating bean with name 'transactionManager' defined in class path resource [applicationContext-dao.xml]: Cannot resolve refer
ence to bean 'entityManagerFactory' while setting bean property 'entityManagerFactory'; nested exception is org.springframework.beans.factory.BeanCreationE
xception: Error creating bean with name 'entityManagerFactory' defined in class path resource [applicationContext-dao.xml]: Invocation of init method faile
d; nested exception is java.lang.ClassCastException: org.hibernate.ejb.HibernatePersistence
Caused by:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)': Cannot resolve reference to bean 'transactionManager
' while setting bean property 'transactionManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with n
ame 'transactionManager' defined in class path resource [applicationContext-dao.xml]: Cannot resolve reference to bean 'entityManagerFactory' while setting
bean property 'entityManagerFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityMa
nagerFactory' defined in class path resource [applicationContext-dao.xml]: Invocation of init method failed; nested exception is java.lang.ClassCastExcepti
on: org.hibernate.ejb.HibernatePersistence
Caused by:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transactionManager' defined in class path resource [applicationCont
ext-dao.xml]: Cannot resolve reference to bean 'entityManagerFactory' while setting bean property 'entityManagerFactory'; nested exception is org.springfra
mework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [applicationContext-dao.xml
]: Invocation of init method failed; nested exception is java.lang.ClassCastException: org.hibernate.ejb.HibernatePersistence
Caused by:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [applicationCo
ntext-dao.xml]: Invocation of init method failed; nested exception is java.lang.ClassCastException: org.hibernate.ejb.HibernatePersistence
Caused by:
java.lang.ClassCastException: org.hibernate.ejb.HibernatePersistence
at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:
206)
at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:251)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1201)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1171)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:425)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:251)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:156)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:248)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:160)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:261)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:109)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1099)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:861)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:421)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:251)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:156)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:248)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:160)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:261)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:109)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1099)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:861)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:421)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveInnerBean(BeanDefinitionValueResolver.java:215)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:127)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1099)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:861)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:421)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:251)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:156)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:248)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:160)
at org.springframework.aop.framework.autoproxy.BeanFactoryAdvisorRetrievalHelper.findAdvisorBeans(BeanFactoryAdvisorRetrievalHelper.java:87)
at org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator.findCandidateAdvisors(AbstractAdvisorAutoProxyCreator.java:96)
at org.springframework.aop.aspectj.annotation.AnnotationAwareAspectJAutoProxyCreator.findCandidateAdvisors(AnnotationAwareAspectJAutoProxyCreator.j
ava:83)
at org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator.findEligibleAdvisors(AbstractAdvisorAutoProxyCreator.java:83)
at org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator.getAdvicesAndAdvisorsForBean(AbstractAdvisorAutoProxyCreator.java:66
)
at org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator.postProcessAfterInitialization(AbstractAutoProxyCreator.java:296)
In any case, I do not want to use the hibernate which is bundled with JBoss. I want to be able to pick and choose the hibernate version freely by updating the WAR. I tried to make JBoss classloading "isolated" from server classes using the instructions in
http://wiki.jboss.org/wiki/Wiki.jsp?page=ClassLoadingConfiguration
so - I added this jboss-web.xml in WAR's WEB-INF:
<jboss-web>
<class-loading java2ClassLoadingCompliance="false">
<loader-repository>
com.example.loaderrepository:loader=sujuvuus-webapp.war
<loader-repository-config>java2ParentDelegation=false</loader-repository-config>
</loader-repository>
</class-loading>
</jboss-web>
and included the hibernate JARs once again.
No help - I am still getting the
java.lang.ClassCastException: org.hibernate.search.event.FullTextIndexEventListener
errors.
Am I doing something wrong, how can I use my own hibernate JARs?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4090926#4090926
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4090926
18Â years, 6Â months
[JBoss jBPM] - async processes : favour termination instead of inception
by gogoasa
Hello,
I have a process that contains several nodes that may take a long time to execute (hours). I order to be able to have a trace of what's happening, I use asynchronous continuations (async="true" for the slow nodes).
The whole things goes like this: a process initiator send lots (hundreds) of JMS StartProcessInstanceCommands on the jms/JbpmCommandQueue. The command queue is rapidly depleted by the CommandListenerBean which starts a new process and then starts the execution of the first node by sending a message to jms/JmsJobQueue. What happens next is that there are lots of processes that start and very few (if any) that finish. When the first node finishes, because of the async="true"behaviour, another jms message is sent to the JobQueue, at the end of the queue.
This way, for async processes, the start of new processes is favoured instead of finishing the already started.
Do you have any idea on how to tackle this?
As for me, I came up with the idea of associating a priority to a node which would be transferred to the JobCommand and then to the JMS message as a JMS priority parameter. Some modifications of jBPM are required though, so that sending a JMS message be done with the proper priority. You guys might have better ideas, I am eager to hear them...
Thank you.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4090923#4090923
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4090923
18Â years, 6Â months
[JBoss Seam] - Re: #{conversationList} appears to be empty
by omilian3
I'm having a few difficulties with long running conversations, so I've added the "conversationLogger" event listener above to help debug the problem. However, I'm finding that when my @Begin method is invoked the logConversationBegin() method is not called.
I've added some extra methods to the logger which observe other events, such as "org.jboss.seam.postCreate.xxx", where xxx is one of my components, e.g.
| @Name("conversationLogger")
| public class ConversationLogger implements Serializable {
|
| private Log log = Logging.getLog(ConversationLogger.class);
|
| @Observer("org.jboss.seam.beginConversation")
| public void logConversationBegin() {
| Conversation currentConversation = Conversation.instance();
| log.info("Beginning conversation: #0, Parent Id: #1", currentConversation.getId(), currentConversation
| .getParentId());
| }
|
| @Observer("org.jboss.seam.postCreate.businessProfileQuestionnaireController")
| public void logPostCreateBegin() {
| Conversation currentConversation = Conversation.instance();
| System.out.println(">>>>>>>>>>>>>>POST CREATE>>>>>>>>>>>>>");
| log.info("Beginning conversation: #0, Parent Id: #1", currentConversation.getId(), currentConversation
| .getParentId());
| }
|
| @Observer("org.jboss.seam.endConversation")
| public void logConversationEnd() {
| Conversation currentConversation = Conversation.instance();
| log.info("Ending conversation: #0, Parent Id: #1", currentConversation.getId(), currentConversation
| .getParentId());
| }
| }
I see these events being raised and the conversationLogger is called, so I'm comfortable the logger is working:
18:38:53,421 INFO [STDOUT] >>>>>>>>>>>>>>POST CREATE>>>>>>>>>>>>>
| 18:38:53,421 INFO [ConversationLogger] Beginning conversation: 2, Parent Id: null
It would appear then that the Manager methods which raise the 'org.jboss.seam.beginConversation' event are not being called, yet I can see that I have a long running conversation by the following 3 means:
1 - In my @Begin method I do:
Conversation currentConversation = Conversation.instance();
| System.out.println("Conversation id " + currentConversation.getId());
This prints "Conversation id 2"
2 - In my pages I've included:
Current converstation is long running #{org.jboss.seam.core.conversation.longRunning}
This displays "Current converstation is long running true"
3 - I can see the conversation with id 2 listed on the seam debug page
These 3 facts lead me to believe I've got a conversation, yet they don't seem to raise the 'org.jboss.seam.beginConversation' event; what could be going on here? Any ideas?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4090922#4090922
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4090922
18Â years, 6Â months
[JBoss Seam] - Problems with links in pageflow pages based on templates
by chawax
Hi,
In a Seam application, I use JPDL to define pageflows. All pages of my application use facelet templates. Transitions modeled in my pageflow work well, but I have a problem with links defined with s:link component in my template (for example a link to home page in a header) : Seam throws a "Illegal navigation" error.
I understood this message is thrown because there is no transition to home page modeled in my pageflow. But I can't do this because when I model my pageflow I have no idea which links will exist in the templates my pageflow pages will be based on.
I found two solutions for this, but I am fully happy with none of them ...
1 - I added propagation="node" attribute to s:link :
<s:link view="/home" value="Accueil" propagation="none" />
The problem with this solution is that it keeps conversations opened, while I'd like them to be closed.
2 - I added propagation="end" attribute to s:link
<s:link view="/home" value="Accueil" propagation="end" />
With this solution, the conversations end. But the problem is I have to click the link twice to go to home page :
- The first click ends the conversation
- The second click redirects to the home page.
Does anyone have a solution for this ?
I work with Seam 2.0.0.CR1 and JBPM 3.2.2
Any help appreciated ;)
Thanks in advance
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4090915#4090915
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4090915
18Â years, 6Â months
[EJB/JBoss] - NullPointerException while deserializing response from remot
by klease
Hi all,
I have ejb client code which is being called via JNI from a third-party application (an xml editor). In some cases, I get the following error when I call a remote EJB (it happens on several different ones):
Caused by: java.lang.NullPointerException
| at org.jboss.invocation.MarshalledValueInputStream.resolveClass(MarshalledValueInputStream.java:101)
| at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1538)
| at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1460)
| at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1693)
| at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1299)
| at java.io.ObjectInputStream.readObject(ObjectInputStream.java:339)
| at org.jboss.invocation.MarshalledValue.get(MarshalledValue.java:91)
| at org.jboss.invocation.unified.interfaces.UnifiedInvokerProxy.invoke(UnifiedInvokerProxy.java:195)
| at org.jboss.invocation.InvokerInterceptor.invokeInvoker(InvokerInterceptor.java:365)
| at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:197)
| at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:61)
| at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:70)
| at org.jboss.proxy.ejb.StatefulSessionInterceptor.invoke(StatefulSessionInterceptor.java:121)
| at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:100)
| at $Proxy3.getMetaData(Unknown Source)
| at com.XXXX (my client code method)
|
After doing various experiments, I figured out that the problem is that the context class loader is not set on the thread when this happens. I have filed this as a bug with xml editor provider.
This problem occurs using jboss-4.2.1.GA (jbossall-client.jar) and the java VM used by the JNI is 1.5.0_04-b05, running on Windows XP Pro.
I wasn't having this problem with jboss 4.0.4.GA and I haven't changed my client-side code or the xml editor version since then.
Wouldn't it be reasonable for MarshalledValueInputStream to fall back to the parent classloader if no context classloader is set ?
The java doc for the getContextClassLoader() method in java.lang.Thread says: anonymous wrote : Returns the context ClassLoader for this Thread. The context ClassLoader is provided by the creator of the thread for use by code running in this thread when loading classes and resources. If not set, the default is the ClassLoader context of the parent Thread
I'm not sure this means that the VM should do this (in which case the bug is in my java and not jboss), or whether callers of this method should handle the case where it returns null.
Thanks in advance for any advice,
Karen
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4090912#4090912
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4090912
18Â years, 6Â months
[JNDI/Naming/Network] - JNDI lookup across partitions and local
by haribaasha
Hi
I use a servicelocator which is a generic class which will return to me a remote stub based on the ejb requested with a jndi name. so i have about 3 different ejbs providing different services running in a cluster. now one of the ejb runs in a totally different partition. I do the lookup using
Properties p = new Properties();
p.put("jnp.partitionName", "IndicsPartition"); //indicspartition is my partition name
p.put("jnp.discoveryGroup", "230.0.0.4");
Context initial = new InitialContext(p);
the other ejb's are deployed locally or in the same cluster. for the local or remote lookup in a cluster we already have
Properties p = new Properties();
p.put(Context.INITIAL_CONTEXT_FACTORY,"org.jnp.interfaces.NamingContextFactory");
p.put(Context.URL_PKG_PREFIXES,"jboss.naming:org.jnp.interfaces");
p.put(Context.PROVIDER_URL, "localhost:1100"); // HA-JNDI port
initial = new InitialContext(p);
Do i need to have these both as different cases and try each or can i have one context which will be able to load it from IndicsPartition if available or from teh local cluster if availbale ?
Thanks
hari
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4090905#4090905
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4090905
18Â years, 6Â months