[英]How to run existing apache tomcat instance from eclipse (runtime environment configuration)?
I have a general question which challenges my understanding of web applications as I only recently began to work with web apps. 我有一个普遍的问题,因为我直到最近才开始使用Web应用程序,这对我对Web应用程序的理解提出了挑战。
To simplify - I have a maven project which can be successfully installed using mvn clean install
and then it can be started executing catalina start
from the 'apache-tomcat/bin' folder using command line. 为了简化-我有一个Maven项目,可以使用
mvn clean install
成功安装它,然后可以使用命令行从'apache-tomcat / bin'文件夹开始执行catalina start
。 At this point I will also add that localhost is accessible and working nicely. 在这一点上,我还将添加localhost是可访问的并且运行良好。
The goal is to do the same using eclipse. 目标是使用Eclipse进行相同的操作。 I can successfully install maven project from eclipse but I cannot start the server - or rather - I can start the server but it's not working properly.
我可以从eclipse成功安装maven项目,但是我无法启动服务器-或更确切地说-我可以启动服务器,但无法正常工作。
The way I try to start server from eclipse is I add a runtime environment (Windows->Preferences->Runtime Environmentss: tomcat 7), which points to the tomcat root folder /target/apache-tomcat
(please note 'target' folder was created as result of installing/building maven project). 我尝试从Eclipse启动服务器的方式是添加一个运行时环境(Windows-> Preferences-> Runtime Environments:tomcat 7),该环境指向tomcat根文件夹
/target/apache-tomcat
(请注意,“ target”文件夹是由于安装/构建Maven项目而创建的)。 At the end I change configuration path (set to apache-tomcat/conf
) in 'Overview' tab in eclipse as well as I tick 'use custom location' radio button, pointing to 'apache-tomcat' folder. 最后,我在Eclipse的“概述”选项卡中更改了配置路径(设置为
apache-tomcat/conf
),并勾选了“使用自定义位置”单选按钮,指向“ apache-tomcat”文件夹。
As the result server started but when trying to access localhost, instead of 'home-page' there is exception thrown: 结果服务器启动后,当尝试访问localhost而不是“主页”时,将引发异常:
java.lang.RuntimeException: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target org.jasig.cas.client.util.CommonUtils.getResponseFromServer(CommonUtils.java:295) org.jasig.cas.client.validation.AbstractCasProtocolUrlBasedTicketValidator.retrieveResponseFromServer(AbstractCasProtocolUrlBasedTicketValidator.java:33) org.jasig.cas.client.validation.AbstractUrlBasedTicketValidator.validate(AbstractUrlBasedTicketValidator.java:178) org.springframework.security.cas.authentication.CasAuthenticationProvider.authenticateNow(CasAuthenticationProvider.java:131) org.springframework.security.cas.authentication.CasAuthenticationProvider.authenticate(CasAuthenticationProvider.java:117) org.springframework.security.authentication.ProviderManager.doAuthentication(ProviderManager.java:130) org.springframework.security.authenticatio
java.lang.RuntimeException:javax.net.ssl.SSLHandshakeException:sun.security.validator.ValidatorException:PKIX路径构建失败:sun.security.provider.certpath.SunCertPathBuilderException:无法找到请求的目标org.jasig的有效证书路径。 cas.client.util.CommonUtils.getResponseFromServer(CommonUtils.java:295)org.jasig.cas.client.validation.AbstractCasProtocolUrlBasedTicketValidator.retrieveResponseFromServer(AbstractCasProtocolUrlBasedTicketValidator.Java:33.org.jasig.Base.valid。 AbstractUrlBasedTicketValidator.java:178)org.springframework.security.cas.authentication.CasAuthenticationProvider.authenticateNow(CasAuthenticationProvider.java:131)org.springframework.security.cas.authentication.CasAuthenticationProvider.authenticate(CasAuthenticationProvider.java:117)org.springframework。 security.authentication.ProviderManager.doAuthentication(ProviderManager.java:130)org.springframework.security.authenticatio n.AbstractAuthenticationManager.authenticate(AbstractAuthenticationManager.java:48) org.springframework.security.cas.web.CasAuthenticationFilter.attemptAuthentication(CasAuthenticationFilter.java:111) org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:199) org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:381) org.jasig.cas.client.session.SingleSignOutFilter.doFilter(SingleSignOutFilter.java:110) org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:381) org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:105) org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:381) org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:105) org.springframework.security.web.FilterChainProxy$V
n.AbstractAuthenticationManager.authenticate(AbstractAuthenticationManager.java:48)org.springframework.security.cas.web.CasAuthenticationFilter.attemptAuthentication(CasAuthenticationFilter.java:111)org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java: 199)org.springframework.security.web.FilterChainProxy $ VirtualFilterChain.doFilter(FilterChainProxy.java:381)org.jasig.cas.client.session.SingleSignOutFilter.doFilter(SingleSignOutFilter.java:110)org.springframework.security.web。 FilterChainProxy $ VirtualFilterChain.doFilter(FilterChainProxy.java:381)org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:105)org.springframework.security.web.FilterChainProxy $ VirtualFilterChain.doFilter(FilterChainProxy。 java:381)org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:105)org.springframework.security.web.FilterChainProxy $ V irtualFilterChain.doFilter(FilterChainProxy.java:381) org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:79) org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:381) org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:168) org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:237) org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)
irtualFilterChain.doFilter(FilterChainProxy.java:381)org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:79)org.springframework.security.web.FilterChainProxy $ VirtualFilterChain.doFilter(FilterChainProxy.java:381) org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:168)org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:237)org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy。 Java:167)
Obviously eclipse overridden somehow tomcat launch configuration but I don't know why. 显然,Eclipse覆盖了tomcat启动配置,但是我不知道为什么。 I'd appreciate any input!
我将不胜感激!
@update : Although I tried everything @skomisa suggested so far, it doesn't seem to work. @update :尽管到目前为止我尝试了所有@skomisa建议的操作,但它似乎没有用。 Interesting enough, that I can run the server via command prompt (eg 'catalina run' from tomcat bin directory, once it's built), but I cannot run it inside eclipse as following exception is thrown.
足够有趣的是,我可以通过命令提示符运行服务器(例如,一旦建立,便从tomcat bin目录中的“ catalina run”),但是由于出现以下异常,因此我无法在eclipse中运行它。 I do not access local host via HTTPS, but HTTP.
我不是通过HTTPS访问本地主机,而是通过HTTP访问。 Is that because in 'Add and Remove' window there are no web applications to deploy?
那是因为在“添加和删除”窗口中没有要部署的Web应用程序吗? At this point I will add, that my eclipse project is simply of Maven nature (it's not converted to dynamic web project, and I'm not sure if it has to be in order to successfully run tomcat).
在这一点上,我要补充一点,我的Eclipse项目只是Maven性质的(它不会转换为动态Web项目,并且我不确定是否必须成功运行tomcat)。
Add your Tomcat server to Eclipse as follows: 如下所示将您的Tomcat服务器添加到Eclipse:
This tutorial may also be helpful: https://crunchify.com/how-to-create-dynamic-web-project-using-maven-in-eclipse/ 本教程也可能会有所帮助: https : //crunchify.com/how-to-create-dynamic-web-project-using-maven-in-eclipse/
As an unrelated issue, the stack trace you posted suggests that you are entered an https URL when you should have entered an http URL. 作为一个不相关的问题,您发布的堆栈跟踪建议您在应该输入http URL的情况下输入https URL。 Is that the case?
是这样吗
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.