0

I want to have two web applications that use Hibernate, Spring, and JSF 2.0. One would be the website which is available to the public and the other a content management system available on the company intranet. I don't want to have duplicate code that accesses the database. I want to create a JAR file that contains all the database manipulation using hibernate. I can't find any examples on the we of how this is done. Does anyone have any helpful tips? I've managed to create the hibernate JAR file and put a test main in it and that can retrieve the data from the database. I think my main problem is how do I go about configuring all this in the web application? thanks


After playing around with things a bit. I'm almost there I'm getting this error when deploying to glassfish now Error occurred during deployment: Exception while loading the app : java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'BrandService' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Cannot resolve reference to bean 'BrandDao' while setting bean property 'brandDao'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'BrandDao' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Cannot resolve reference to bean 'SessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'SessionFactory' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Cannot resolve reference to bean 'DataSource' while setting bean property 'dataSource'; nested .... msg.seeServerLog

4

1 回答 1

0

我认为 Java 控制台应用程序(您的测试主程序)使用 JAR 和 Java Web 应用程序使用 JAR 之间没有区别。

于 2013-05-03T09:37:02.530 回答