标签: jetty

JAVA中$ 1的含义是什么?

这是一个shell脚本:

echo Starting Jarvis Program D.
ALICE_HOME=.
SERVLET_LIB=lib/servlet.jar
ALICE_LIB=lib/aliceserver.jar
JS_LIB=lib/js.jar

# Set SQL_LIB to the location of your database driver.
SQL_LIB=lib/mysql_comp.jar

# These are for Jetty; you will want to change these if you are using a different http server.
 HTTP_SERVER_LIBS=lib/org.mortbay.jetty.jar

 PROGRAMD_CLASSPATH=$SERVLET_LIB:$ALICE_LIB:$JS_LIB:$SQL_LIB:$HTTP_SERVER_LIBS
 java -classpath $PROGRAMD_CLASSPATH -Xms64m -Xmx128m org.alicebot.server.net.AliceServer $1
Run Code Online (Sandbox Code Playgroud)

在最后一行:$ 1是什么意思?

java jetty

1
推荐指数
1
解决办法
2053
查看次数

使用Maven Jetty插件部署war时获取FileNotFoundException

我正在使用Maven 3.0.3和Jetty插件.我收到以下错误:

java.io.FileNotFoundException:无法打开ServletContext资源[/WEB-INF/applicationContext.xml

我不明白,因为文件存在于target/mywar/WEB-INF/applicationContext.xml.我把这个文件称为web.xml:

<web-app xmlns="http://java.sun.com/xml/ns/j2ee" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.4">
    <display-name>/jx-production-1.0-SNAPSHOT</display-name>
    <context-param>
        <param-name>contextConfigLocation</param-name>
        <param-value>/WEB-INF/applicationContext.xml</param-value>
    </context-param>Any ideas what I'm missing? Here is my Jetty plugin definition in my pom.xml …
    <profile>
        <id>jetty</id>
        <build>
            <plugins>
                <plugin>
                    <groupId>org.mortbay.jetty</groupId>
                    <artifactId>jetty-maven-plugin</artifactId>
                    <version>7.2.2.v20101205</version>
                    <configuration>
                        <webAppConfig>
                            <contextPath>/all-new-jx</contextPath>
                            <descriptor>target/jx-1.0-SNAPSHOT/WEB-INF/web.xml</descriptor>
                        </webAppConfig>
                        <jettyConfig>config/jetty7/jetty.xml</jettyConfig>
                        <scanIntervalSeconds>10</scanIntervalSeconds>
                        <contextHandlers>
                            <contextHandler implementation="org.eclipse.jetty.server.handler.ContextHandler">
                                <contextPath>/all-new-jx-web</contextPath>
                                <resourceBase>${project.basedir}/target/web</resourceBase>
                                <handler implementation="org.eclipse.jetty.server.handler.ResourceHandler" />
                            </contextHandler>
                        </contextHandlers>
                    </configuration>
                    <dependencies>
                        <dependency>
                            <groupId>org.eclipse.jetty</groupId>
                            <artifactId>jetty-rewrite</artifactId>
                            <version>7.2.2.v20101205</version>
                            <type>jar</type>
                            <scope>runtime</scope>
                        </dependency>
                    </dependencies>
                </plugin>
            </plugins>
        </build>
    </profile>
Run Code Online (Sandbox Code Playgroud)

这是我得到的漫长而令人讨厌的错误:

2011-08-04 14:08:56.677:WARN ::上下文启动失败omjpJettyWebAppContext {/ all-new-jx,file:/ Users/davea/Documents/workspace/NissanUSA2/Technology/nna/mycousa/jx/src/main/webapp /},file:/ …

maven-2 jetty embedded-jetty maven maven-jetty-plugin

1
推荐指数
1
解决办法
1万
查看次数

的NoSuchMethodError

我在网上发现了类似的问题,但没有一个发布的解决方案似乎有效.

我试图在jetty下运行我的Web应用程序而不是总是在tomcat中构建和运行来测试,因为我们的构建需要18分钟.:(

这是一个drools项目,我在Eclipse Indigo SR2下运行.我试图在Jetty 6.1.26和Spring Framework 2.5.6下运行.

我已经在https://community.jboss.org/wiki/RulesTomcat的vm args部分中使用以下系统parms创建了调试配置:

-Djava.naming.factory.initial = org.mortbay.naming.InitialContextFactory -Ddrools.compiler = JANINO

这是我得到的许多类似错误之一:

2012-06-15 09:19:16.579:WARN::Nested in org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'strategyFactory' defined in ServletContext resource [/WEB-INF/conf/spring/beans.xml]: Cannot resolve reference to bean 'court' while setting bean property 'court'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'court' defined in ServletContext resource [/WEB-INF/conf/spring/beans.xml]: Cannot resolve reference to bean 'instanceConfig' while setting bean property 'config'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name …
Run Code Online (Sandbox Code Playgroud)

java spring jetty drools janino

1
推荐指数
1
解决办法
7215
查看次数

如何重新启动grails Web应用程序

如何重新启动grails应用程序,而不是通过执行ctrl z并再次运行它来关闭它.

当我这样做时,它说

Error Server failed to start for port 8080: Address already in use
Run Code Online (Sandbox Code Playgroud)

grails groovy jetty

1
推荐指数
2
解决办法
2521
查看次数

Jetty servlet网址和端口

什么是方法调用来确定运行jetty servlet的url和端口是什么?这样我就可以在屏幕上打印它,并在客户端中使用它来连接:

url = new URL("trying to figure this out");
Run Code Online (Sandbox Code Playgroud)

我在本地运行客户端和服务器,在eclipse中,这是一个学校项目.

相关代码:

import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.servlet.DefaultServlet;
import org.eclipse.jetty.servlet.ServletContextHandler;
import org.eclipse.jetty.servlet.ServletHolder;

public class ServerMain {

    public static void main(String[] args){
        Server server = new Server();
        ServletContextHandler context = 
                new ServletContextHandler(ServletContextHandler.SESSIONS);
        context.setContextPath("Servlet");

        context.setResourceBase("etc/docroot");

        server.setHandler(context);
        context.addServlet(new ServletHolder(new MyServer()), "/game");
        DefaultServlet staticFileServlet = new DefaultServlet();
        context.addServlet(new ServletHolder(staticFileServlet), "/*");
        System.out.println("context: " +  context.getContextPath());
        //System.out.println("One valid Port = "
                  + context.getServer().getConnectors()[0].getPort());
        try {
            server.start();
            server.join();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
Run Code Online (Sandbox Code Playgroud)

java servlets jetty

1
推荐指数
1
解决办法
9553
查看次数

Apache Tomcat适用于MySQL或Jetty还是Glassfish?

我使用Java中的Restlet API为iPhone/iPad设备开发了WebService .

我们的服务器是Linux CentOS,2GB RAM,14GB磁盘空间.

我正在使用Apache Tomcat 6.0.35和MySQL 5.1数据库.

例如,这些用户可能有许多并发用户说100000.

所以我的问题是Apache Tomcat和MySQL是它的最佳组合,或者我应该更改像Jetty或Glassfish或任何其他Web服务器MySQL或其他数据库的组合

但我担心组合的表现.

所以请指导我.

提前致谢.

java webserver tomcat jetty glassfish

1
推荐指数
1
解决办法
732
查看次数

Jetty认证架构

Jetty身份验证体系结构使用以下4个接口:

org.eclipse.jetty.server.UserIdentity
org.eclipse.jetty.security.LoginService
org.eclipse.jetty.security.IdentityService
java.security.Principal
Run Code Online (Sandbox Code Playgroud)

有人可以解释这4个接口如何在认证流程中互相交互.

浏览代码似乎不是很有帮助,因为有很多极端情况.我对主要流程感兴趣.

java jetty

1
推荐指数
1
解决办法
1174
查看次数

1&& - 是什么意思?

我在/etc/init.d/jetty中有语法

#!/usr/bin/env bash

    ...

java -jar start.jar jetty.port=80 1<&- &
Run Code Online (Sandbox Code Playgroud)

你能解释一下命令末尾的重定向吗?

(顺便说一下,我的Jetty服务器在大约一天内停止响应URL请求.我可以看到它仍在执行WAR文件,因为它有一个每5分钟运行一次的作业,但是Web服务器没有响应URL请求到目前为止我可以告诉你使用Chrome开发者工具.所以我试图看看Jetty的日志)

unix bash jetty

1
推荐指数
1
解决办法
50
查看次数

使用Apache Camel处理JSON请求

我想处理一个第三方对我的系统执行的HTTPs请求。请求包含一个JSON对象

我尝试使用骆驼的码头组件,但是当第三方执行请求时,骆驼抛出以下异常:

org.apache.camel.RuntimeCamelException: Cannot read request parameters due Invalid parameter, expected to be a pair but was {"id":"321","rec":"533","status":"ok"}
Run Code Online (Sandbox Code Playgroud)

在蓝图中,Jetty端点定义为:

<camel:endpoint id="getRequestEndpoint" uri="jetty:{{webServiceProtocol}}://{{jettyIp}}:{{jettyPort}}/getRequest?sslContextParametersRef=sslContextParameters"/>
Run Code Online (Sandbox Code Playgroud)

我是否缺少某些东西或走在完全错误的道路上?

java json jetty apache-camel

1
推荐指数
1
解决办法
1512
查看次数

将码头servlet 9.2.2更新到9.3.8

在更新pom.xml文件后,我试图将Jetty服务器和Servlet从9.2.2版本更新到9.3.8版本,但遇到找不到ServletContextHandler和ServletHolder之类的错误!

这是我的pom.xml

<dependency>
            <groupId>org.eclipse.jetty</groupId>
            <artifactId>jetty-server</artifactId>
            <version>9.3.8.v20160314</version>
    </dependency>

    <dependency>
        <groupId>org.eclipse.jetty</groupId>
        <artifactId>jetty-servlets</artifactId>
        <version>9.3.8.v20160314</version>
    </dependency>
Run Code Online (Sandbox Code Playgroud)

这是我的JettyServer类

public static void start() throws Exception
{
    Server server = new Server(Configuration.getInstance().getPortServer());

    ServletContextHandler context = new ServletContextHandler(ServletContextHandler.SESSIONS);
    context.setContextPath("/");

    ServletHolder h = new ServletHolder(new HttpServletDispatcher());
    h.setInitParameter("javax.ws.rs.Application", "de.jettyserver.Services");
    context.addServlet(h, "/*");

    server.setHandler(context);

    server.start();
    server.join();

    LOGGER.debug("JettyServer started");
}
Run Code Online (Sandbox Code Playgroud)

和错误

[ERROR] /C:/..../jettyserver/JettyServer.java:[4,33] package org.eclipse.jetty.servlet does not exist

[ERROR]/C:/../jettyserver/JettyServer.java:[5,33] package org.eclipse.jetty.servlet does not exist
[ERROR] /C:/../jettyserver/JettyServer.java:[27,17] cannot find symbol symbol:   class ServletContextHandler location: class de.tuberlin.snet.sonic.jettyserver.JettyServer

    [ERROR] /C:/../jettyserver/JettyServer.java:[27,53] cannot find symbol symbol:   class ServletContextHandler …
Run Code Online (Sandbox Code Playgroud)

servlets jetty maven jetty-9

1
推荐指数
1
解决办法
1358
查看次数