[JBoss/Spring Integration] - Struts+spring+hibernate+jpa integration problem
by jboss_fan1056
I am in a weird situation. I am using JBoss 4.2.3 AS the following versions
Hibernate 3.2.6
Struts 2.1.6
Spring 2.5.6
If I use the hibernate-annotations.jar and "hibernate-entitymanager.jar" from hibernate website, I get the following error:
13:22:23,977 ERROR [ContextLoader] Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is java.lang.ClassCastException: org.hibernate.search.event.FullTextIndexEventListener
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1338)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:473)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
at java.security.AccessController.doPrivileged(Native Method)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:423)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:728)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:380)
at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:255)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:199)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:45)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3856)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4361)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:790)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:770)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:553)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:296)
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:5312)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:296)
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)
Sample of my applicationContext.xml is:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd"
xmlns:tx="http://www.springframework.org/schema/tx">
<tx:annotation-driven transaction-manager="transactionManager" />
<constructor-arg ref="m735BrokerbrokerService" />
Can somebody told me what I am doing wrong?
But if I get hibernate-annotations.jar and "hibernate-entitymanager.jar" from "jboss-4.2.3.GA\server\default\lib" provide by JBOSS then there is no error but whenever I try to access the pages it gives me 400 error(resource not found). Can somebody please explain me why its happening?
Help would be really appreciated...
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4246279#4246279
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4246279
16 years, 11 months
[JBoss Tools (users)] - Re: Cannot compute classpath in Hibernate console
by asookazian
I removed the WAR from the classpath and replaced it with:
C:\java\projects\ERS\src\model\com\cox\ers\entity
and now I can see my tables under the database "tree" in Hibernate config view/tab.
But when I try to run a simple HQL editor query I get:
Error
| Mon Jul 27 11:26:58 PDT 2009
| org.hibernate.hql.ast.QuerySyntaxException: ApplicationSite is not mapped [from ApplicationSite]
|
| org.hibernate.hql.ast.QuerySyntaxException: ApplicationSite is not mapped [from ApplicationSite]
| at org.hibernate.hql.ast.util.SessionFactoryHelper.requireClassPersister(SessionFactoryHelper.java:158)
| at org.hibernate.hql.ast.tree.FromElementFactory.addFromElement(FromElementFactory.java:87)
| at org.hibernate.hql.ast.tree.FromClause.addFromElement(FromClause.java:70)
| at org.hibernate.hql.ast.HqlSqlWalker.createFromElement(HqlSqlWalker.java:255)
| at org.hibernate.hql.antlr.HqlSqlBaseWalker.fromElement(HqlSqlBaseWalker.java:3056)
| at org.hibernate.hql.antlr.HqlSqlBaseWalker.fromElementList(HqlSqlBaseWalker.java:2945)
| at org.hibernate.hql.antlr.HqlSqlBaseWalker.fromClause(HqlSqlBaseWalker.java:688)
| at org.hibernate.hql.antlr.HqlSqlBaseWalker.query(HqlSqlBaseWalker.java:544)
| at org.hibernate.hql.antlr.HqlSqlBaseWalker.selectStatement(HqlSqlBaseWalker.java:281)
| at org.hibernate.hql.antlr.HqlSqlBaseWalker.statement(HqlSqlBaseWalker.java:229)
| at org.hibernate.hql.ast.QueryTranslatorImpl.analyze(QueryTranslatorImpl.java:228)
| at org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:160)
| at org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:111)
| at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:77)
| at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:56)
| at org.hibernate.engine.query.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:72)
| at org.hibernate.impl.AbstractSessionImpl.getHQLQueryPlan(AbstractSessionImpl.java:133)
| at org.hibernate.impl.AbstractSessionImpl.createQuery(AbstractSessionImpl.java:112)
| at org.hibernate.impl.SessionImpl.createQuery(SessionImpl.java:1623)
| at org.hibernate.console.HQLQueryPage.setSession(HQLQueryPage.java:106)
| at org.hibernate.console.ConsoleConfiguration$4.execute(ConsoleConfiguration.java:426)
| at org.hibernate.console.execution.DefaultExecutionContext.execute(DefaultExecutionContext.java:64)
| at org.hibernate.console.ConsoleConfiguration.executeHQLQuery(ConsoleConfiguration.java:421)
| at org.hibernate.eclipse.hqleditor.HQLEditor.executeQuery(HQLEditor.java:416)
| at org.hibernate.eclipse.console.actions.ExecuteQueryAction.execute(ExecuteQueryAction.java:73)
| at org.hibernate.eclipse.console.actions.ExecuteQueryAction.run(ExecuteQueryAction.java:53)
| at org.eclipse.jface.action.Action.runWithEvent(Action.java:498)
| at org.hibernate.eclipse.console.actions.ExecuteQueryAction.runWithEvent(ExecuteQueryAction.java:57)
| at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:583)
| at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:500)
| at org.eclipse.jface.action.ActionContributionItem$6.handleEvent(ActionContributionItem.java:452)
| at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
| at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)
| at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3823)
| at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3422)
| at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2384)
| at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2348)
| at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2200)
| at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:495)
| at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:288)
| at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:490)
| at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
| at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:113)
| at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:193)
| at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
| at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
| at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:386)
| at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
| 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.eclipse.equinox.launcher.Main.invokeFramework(Main.java:549)
| at org.eclipse.equinox.launcher.Main.basicRun(Main.java:504)
| at org.eclipse.equinox.launcher.Main.run(Main.java:1236)
|
|
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4246274#4246274
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4246274
16 years, 11 months
[JBoss Tools (users)] - Re: Cannot compute classpath in Hibernate console
by asookazian
So here is what my project directory structure looks like:
C:\java\projects\ERS\exploded-archives\com\cox\ers\session
C:\java\projects\ERS\exploded-archives\ERS.war
When I added ERS.war to the Hibernate Console's classpath, I get the "could not compute classpath" error again.
Error
| Mon Jul 27 11:19:33 PDT 2009
| org.hibernate.console.HibernateConsoleRuntimeException: Could not compute classpath
|
| org.hibernate.console.HibernateConsoleRuntimeException: Could not compute classpath
| at org.hibernate.eclipse.console.EclipseLaunchConsoleConfigurationPreferences.getCustomClassPathURLS(EclipseLaunchConsoleConfigurationPreferences.java:97)
| at org.hibernate.console.ConsoleConfiguration.buildWith(ConsoleConfiguration.java:177)
| at org.hibernate.console.ConsoleConfiguration.build(ConsoleConfiguration.java:111)
| at org.hibernate.eclipse.console.workbench.ConsoleConfigurationWorkbenchAdapter.getChildren(ConsoleConfigurationWorkbenchAdapter.java:40)
| at org.hibernate.eclipse.console.workbench.BasicWorkbenchAdapter.getChildren(BasicWorkbenchAdapter.java:99)
| at org.hibernate.eclipse.console.workbench.BasicWorkbenchAdapter.fetchDeferredChildren(BasicWorkbenchAdapter.java:105)
| at org.eclipse.ui.progress.DeferredTreeContentManager$1.run(DeferredTreeContentManager.java:234)
| at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
| Caused by: org.eclipse.core.runtime.CoreException: The archive: /ERS/exploded-archives/ERS.war which is referenced by the classpath, does not exist.
| at org.eclipse.jdt.launching.JavaRuntime.abort(JavaRuntime.java:1327)
| at org.eclipse.jdt.launching.JavaRuntime.abort(JavaRuntime.java:1313)
| at org.eclipse.jdt.launching.JavaRuntime.resolveRuntimeClasspathEntry(JavaRuntime.java:901)
| at org.eclipse.jdt.launching.StandardClasspathProvider.resolveClasspath(StandardClasspathProvider.java:75)
| at org.eclipse.jdt.launching.JavaRuntime.resolveRuntimeClasspath(JavaRuntime.java:1187)
| at org.hibernate.eclipse.console.utils.ClassLoaderHelper.getClasspath(ClassLoaderHelper.java:148)
| at org.hibernate.eclipse.console.EclipseLaunchConsoleConfigurationPreferences.getCustomClassPathURLS(EclipseLaunchConsoleConfigurationPreferences.java:88)
| ... 7 more
|
|
Must it be a packaged (not exploded) WAR?
Here is a screenshot of my edit config window (classpath tab):
http://i145.photobucket.com/albums/r234/rabiesjoy/java/Hibernateconsoleco...
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4246272#4246272
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4246272
16 years, 11 months
[JBoss Tools (users)] - Cannot compute classpath in Hibernate console
by asookazian
Error
| Mon Jul 27 11:06:09 PDT 2009
| org.eclipse.core.runtime.CoreException: The archive: /ERS/exploded-archives/ERS.jar which is referenced by the classpath, does not exist.
|
| org.eclipse.core.runtime.CoreException: The archive: /ERS/exploded-archives/ERS.jar which is referenced by the classpath, does not exist.
| at org.eclipse.jdt.launching.JavaRuntime.abort(JavaRuntime.java:1327)
| at org.eclipse.jdt.launching.JavaRuntime.abort(JavaRuntime.java:1313)
| at org.eclipse.jdt.launching.JavaRuntime.resolveRuntimeClasspathEntry(JavaRuntime.java:901)
| at org.eclipse.jdt.launching.StandardClasspathProvider.resolveClasspath(StandardClasspathProvider.java:75)
| at org.eclipse.jdt.launching.JavaRuntime.resolveRuntimeClasspath(JavaRuntime.java:1187)
| at org.hibernate.eclipse.console.utils.ClassLoaderHelper.getClasspath(ClassLoaderHelper.java:148)
| at org.hibernate.eclipse.console.EclipseLaunchConsoleConfigurationPreferences.getCustomClassPathURLS(EclipseLaunchConsoleConfigurationPreferences.java:88)
| at org.hibernate.console.ConsoleConfiguration.buildWith(ConsoleConfiguration.java:177)
| at org.hibernate.console.ConsoleConfiguration.build(ConsoleConfiguration.java:111)
| at org.hibernate.eclipse.console.workbench.ConsoleConfigurationWorkbenchAdapter.getChildren(ConsoleConfigurationWorkbenchAdapter.java:40)
| at org.hibernate.eclipse.console.workbench.BasicWorkbenchAdapter.getChildren(BasicWorkbenchAdapter.java:99)
| at org.hibernate.eclipse.console.workbench.BasicWorkbenchAdapter.fetchDeferredChildren(BasicWorkbenchAdapter.java:105)
| at org.eclipse.ui.progress.DeferredTreeContentManager$1.run(DeferredTreeContentManager.java:234)
| at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
|
|
org.hibernate.console.HibernateConsoleRuntimeException: Could not compute classpath
| at org.hibernate.eclipse.console.EclipseLaunchConsoleConfigurationPreferences.getCustomClassPathURLS(EclipseLaunchConsoleConfigurationPreferences.java:97)
| at org.hibernate.console.ConsoleConfiguration.buildWith(ConsoleConfiguration.java:177)
| at org.hibernate.console.ConsoleConfiguration.build(ConsoleConfiguration.java:111)
| at org.hibernate.eclipse.console.workbench.ConsoleConfigurationWorkbenchAdapter.getChildren(ConsoleConfigurationWorkbenchAdapter.java:40)
| at org.hibernate.eclipse.console.workbench.BasicWorkbenchAdapter.getChildren(BasicWorkbenchAdapter.java:99)
| at org.hibernate.eclipse.console.workbench.BasicWorkbenchAdapter.fetchDeferredChildren(BasicWorkbenchAdapter.java:105)
| at org.eclipse.ui.progress.DeferredTreeContentManager$1.run(DeferredTreeContentManager.java:234)
| at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
| Caused by: org.eclipse.core.runtime.CoreException: The archive: /ERS/exploded-archives/ERS.jar which is referenced by the classpath, does not exist.
| at org.eclipse.jdt.launching.JavaRuntime.abort(JavaRuntime.java:1327)
| at org.eclipse.jdt.launching.JavaRuntime.abort(JavaRuntime.java:1313)
| at org.eclipse.jdt.launching.JavaRuntime.resolveRuntimeClasspathEntry(JavaRuntime.java:901)
| at org.eclipse.jdt.launching.StandardClasspathProvider.resolveClasspath(StandardClasspathProvider.java:75)
| at org.eclipse.jdt.launching.JavaRuntime.resolveRuntimeClasspath(JavaRuntime.java:1187)
| at org.hibernate.eclipse.console.utils.ClassLoaderHelper.getClasspath(ClassLoaderHelper.java:148)
| at org.hibernate.eclipse.console.EclipseLaunchConsoleConfigurationPreferences.getCustomClassPathURLS(EclipseLaunchConsoleConfigurationPreferences.java:88)
| ... 7 more
I have run 'ant clean unexplode explode' and searched for 'ers.jar' and the only reference is commented in application.xml (which apparently is not even part of the exploded WAR).
My project is packaged as a WAR so I can use hot incremental deployment with POJOs in my Seam app.
hibernate-console.properties:
| #File used by hibernate tools to override <datasource> and other container specific settings in persistence.xml
| hibernate.connection.password=JavaTestAcct
| hibernate.connection.username=_AppUser_JavaTestAcct
| hibernate.connection.driver_class=com.microsoft.sqlserver.jdbc.SQLServerDriver
| hibernate.dialect=org.hibernate.dialect.SQLServerDialect
| hibernate.connection.url=jdbc:sqlserver://CORG0DB901:1433;databaseName=EquipmentRecovery
|
| hibernate.connection.provider_class=org.hibernate.connection.DriverManagerConnectionProvider
| hibernate.datasource=
| hibernate.transaction.manager_lookup_class=
"org.eclipse.core.runtime.CoreException: The archive: /ERS/exploded-archives/ERS.jar which is referenced by the classpath, does not exist."
I'm trying to understand how/where it's referenced... ??? I looked in the Eclipse Java build path and can't see it.
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4246269#4246269
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4246269
16 years, 11 months