行家+碼頭+春季兩個問題3.2有當我開始碼頭
我的碼頭信息來源:
2013-03-08 20:16:23.541:INFO:oejs.Server:main: jetty-9.0.0.RC2
2013-03-08 20:16:26.590:INFO:oejpw.PlusConfiguration:main: No Transaction manager found - if your webapp requires one, please configure one.
[DEBUG][2013-03-08 20:16:35,801]->org.eclipse.jetty.util.log [Logging to org.slf4j.impl.Log4jLoggerAdapter(org.eclipse.jetty.util.log) via org.eclipse.jetty.util.log.Slf4jLog]
2013-03-08 20:16:35.848:INFO:/:main: No Spring WebApplicationInitializer types detected on classpath
2013-03-08 20:16:36.743:INFO:/:main: Initializing Spring FrameworkServlet 'app-servlet'
碼頭找不到事務管理器,但我在Spring應用程序已經配置它-context(APP-servlet.xml中):
<!-- 使用註解方式管理事務 -->
<tx:annotation-driven transaction-manager="transactionManager" proxy-target-class="true"/>
<!-- 配置事務管理 -->
<bean id="transactionManager"
class="org.springframework.orm.hibernate4.HibernateTransactionManager">
<property name="sessionFactory" ref="sessionFactory"></property>
</bean>
它說在web.xml 「關於classpath中沒有檢測到春天WebApplicationInitializer類型」,我也配置 「應用-servlet.xml中」:
<!-- spring mvc的dispatcherServlet負責轉發請求 -->
<servlet>
<servlet-name>app-servlet</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<!-- spring context文件 -->
<param-name>contextConfigLocation</param-name>
<param-value>
classpath*:/spring/**/app-*.xml
</param-value>
</init-param>
<!-- 服務啓動的時候第一個將此servlet初始化加載,非零的時候,數字越小,優先級越高 -->
<load-on-startup>1</load-on-startup>
</servlet>
我的pom.xml:
<!-- jetty -->
<plugin>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>9.0.0.RC2</version>
</plugin>
爲什麼碼頭提醒我?我如何消除這些異常信息? 感謝您回答這兩個問題。
有了這個「無事務管理器」的信息,我發現Spring的事務不受碼頭。正如你所說的那樣,我嘗試在「/WEB-INF/jetty-env.xml」中配置「tx」 - 「org.eclipse.jetty.plus.jndi.Transaction」(當然,我仍然有「com .atomikos transactions-jta「在我的pom.xml中),那麼這個」No Transaction ..「信息就消失了。非常感謝您的回答。 – Hoting 2013-03-09 12:08:12