Tag: tomcat

部署java web应用程序.war文件后未find404

我使用Spring框架在java中编写了一个Web应用程序。 测试并部署到远程Tomcat服务器。 部署后,我有消息OK – Started application at context path [/proxynator] 。 但是,如果我使用链接像http://109.206.178.66:8080/proxynator/和http://109.206.178.66:8080/proxynator/proxynator/test我有404 – Not Found和Description: The origin server did not find a current representation for the target resource or is not willing to disclose that one exists. 在应用程序中,我有起动器类 @SpringBootApplication public class Application { public static void main(String[] args) { SpringApplication.run(Application.class, args); } } 和控制器 @RestController […]

运行在Kotlin中编写的Apache Tomcat servlet时出错

当我单击工具栏上的运行绿色箭头按钮,或者从IntelliJ IDEA Ultimate的运行菜单中选择运行Tomcat 8.0.36命令,以启动我在Kotlin中编写的HTTP Servlet应用程序时,似乎服务器启动但无法加载我的应用程序。 我说因为当我点击http://localhost:8080或者我的一个servlet在http://localhost:8080/login ,我只看到一个空白页。 这里是IntelliJ的输出窗口的输出的相关摘录,当我点击运行按钮。 10-Sep-2016 15:34:05.807 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in 595 ms Connected to server [2016-09-10 03:34:06,384] Artifact Server:war exploded: Artifact is being deployed, please wait… 10-Sep-2016 15:34:09.256 SEVERE [RMI TCP Connection(3)-127.0.0.1] org.apache.catalina.core.ContainerBase.addChildInternal ContainerBase.addChild: start: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[]] at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:153) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:725) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:701) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:717) […]

使用maven在kotlin中编写JSP – 错误实例化Servlet类,ClassNotFoundException

所以我一直在尝试JSP一段时间,我想用它和kotlin和maven,我有一些问题, 它抛出ClassNotFoundException,这里是我的文件: web.xml中 Archetype Created Web Application Servlet com.erezbiox1.Servlet Servlet /test 的pom.xml 4.0.0 com.erezbiox1 KotlinJsp war 1.0 KotlinJsp http://maven.apache.org junit junit 3.8.1 test org.jetbrains.kotlin kotlin-stdlib 1.2.0 javax.servlet servlet-api 2.5 KotlinJsp org.jetbrains.kotlin kotlin-maven-plugin 1.2.0 compile compile compile Servlet.kt // Tried with, and without this: @file:JvmName(“Servlet”) package com.erezbiox1 import javax.servlet.http.HttpServlet import javax.servlet.http.HttpServletRequest import javax.servlet.http.HttpServletResponse class Servlet : […]

Apache Tomcat 8.0无法加载使用Eclipse for Java EE,Mars 2编写的Kotlin中的servlet类

我正在使用Eclipse for Java EE,Mars 2.我在这个IDE中首先使用Java 8和Apache Tomcat 8.0.x编写了一个servlet应用程序,运行得很好。 现在,我试图将代码移植到Kotlin。 但是,Apache Tomcat服务器,似乎从下面发布的信息,无法找到并加载我的类LoginServlet 。 我已经移植了helper类,并且只是一个名为LoginServlet servlet类。 我删除了这个问题中的所有代码,只是为了展示一个简单的骨骼框架。 这是我的设置: package bookyard.server; // import statements ommitted for brevity open class LoginServlet : HttpServlet() { override fun doGet(request : HttpServletRequest, response : HttpServletResponse) { val msg: String = "HTTP GET method not supported."; try { response.sendError(HttpServletResponse.SC_METHOD_NOT_ALLOWED, msg); } catch (e: […]

运行在Kotlin中编写的Apache Tomcat servlet时出错

当我单击工具栏上的运行绿色箭头按钮,或者从IntelliJ IDEA Ultimate的运行菜单中选择运行Tomcat 8.0.36命令,以启动我在Kotlin中编写的HTTP Servlet应用程序时,似乎服务器启动但无法加载我的应用程序。 我说因为当我点击http://localhost:8080或者我的一个servlet在http://localhost:8080/login ,我只看到一个空白页。 这里是IntelliJ的输出窗口的输出的相关摘录,当我点击运行按钮。 10-Sep-2016 15:34:05.807 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in 595 ms Connected to server [2016-09-10 03:34:06,384] Artifact Server:war exploded: Artifact is being deployed, please wait… 10-Sep-2016 15:34:09.256 SEVERE [RMI TCP Connection(3)-127.0.0.1] org.apache.catalina.core.ContainerBase.addChildInternal ContainerBase.addChild: start: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[]] at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:153) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:725) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:701) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:717) […]

Eclipse – 如何将Kotlin添加到Tomcat项目 – 编译Kotlin和Java文件

我需要帮助将Kotlin编译添加到现有的eclipse java tomcat项目中。 为了记录,我在Eclipse Oxygen 4.7上安装了Kotlin插件。 我已经成功地创建并运行了基于Gradle的Spring引导Kotlin rest api demo,并且可以编译和运行“Kotlin Only Projects”并使用我的其他java库 – 真棒。 但是现在我有了Kotlin,我想用它来工作我的其他“传统”Tomcat 8项目,它们是Java J2EE – 动态WTP …我想在Kotlin中编写的新servlet。 我希望能够在我之前的任何一个包中的java src文件夹中添加一个Kotlin类,所以当我构建一个战争的时候,所有的逻辑上都在一起。 IDE似乎没问题 – 我在一个包(在tomcat项目的Java src包文件夹中)创建了Kotlin类,它在解析,导入或依赖性方面没有问题。 我在想WOW !,现在好了重启WTP中的Tomcat服务器,我就可以执行我的Kotlin Servlet了。 没有 – 404 404 404。 我检查了WEB-INF / classes构建文件夹和所有的Java类文件…猜我看到了什么? 一个名为KotlinServlet.kt的文件(即我的测试servlet的名称,源版本不是编译类版本) 所以由于某些原因,build / package / deployment没有编译* .kt文件,只是复制它(也许这是默认的WTP部署)。 我不知道这是否可以通过“添加Kotlin自然”来解决,奇怪的是没有一个日食Kotlin菜单功能可供我使用。 如果我右键点击我的项目,我没有得到Kotlin菜单选项。 Eclipse声明插件已安装。 所以我的问题是: 鉴于现有的传统WTP Tomcat servlet项目,我们可以如何识别和编译* .kt文件? 如何以及为什么我没有Kotlin菜单功能? (我下载并测试了Oxygen Java和J2EE版本 […]