Jetty.xml如何定义JNDI引用OpenMQ

时间:2013-05-30 13:34:50

标签: java jetty jndi maven-jetty-plugin

我在我的server.xml中为tomcat配置了以下JNDI ref到OpenMQ ......

<Resource ackTimeout="-t 30000" auth="Container" 
  description="OpenMQ Queue Connection Factory" 
  factory="com.sun.messaging.naming.QCFObjectFactory" 
  host="-s localhost" 
  name="jms/FACTORY" 
  parm="--" 
  securityPort="7676" 
  subnet="0" 
  type="com.sun.messaging.QueueConnectionFactory" version="1.1"/>

<Resource auth="Container" 
  description="OpenMQ Queue" 
  destName="ESI_AUDIT" 
  factory="com.sun.messaging.naming.QObjectFactory" 
  name="jms/ESI_AUDIT" 
  type="com.sun.messaging.Queue" version="1.1"/>           

我不知道如何在用于我的和谐测试的jetty.xml中定义这些。

有人可以帮帮我吗?

由于 杰夫波特

2 个答案:

答案 0 :(得分:1)

    <New id="FACTORYjndi" class="org.eclipse.jetty.plus.jndi.Resource">
            <Arg></Arg>
            <Arg>jms/FACTORY</Arg>
            <Arg>
                    <New class="com.sun.messaging.QueueConnectionFactory"></New>
            </Arg>
    </New>  



    <New id="ESI_AUDITjndi" class="org.eclipse.jetty.plus.jndi.Resource">
            <Arg></Arg>
            <Arg>jms/ESI_AUDIT</Arg>
            <Arg>
                    <New class="com.sun.messaging.Queue"></New>
            </Arg>
    </New>  

我还建议您设置&#34; useTestScope&#34;也是如此。

    <plugin>
        <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-failsafe-plugin</artifactId>
    <version>2.12.4</version>
    <configuration>
    <useTestScope>true</useTestScope>
    <includes>
            <include>**/*Fixture.java</include>
    </includes>
    <systemProperties>
    <property>
            <name>concordion.output.dir</name>
        <value>target/concordion</value>
    </property>
    </systemProperties>
    </configuration>
    <executions>
    <execution>
            <id>integration-test</id>
                <goals>
                    <goal>integration-test</goal>
            </goals>
    </execution>
    <execution>
            <id>verify</id>
        <goals>
                <goal>verify</goal>
        </goals>
    </execution>
    </executions>
    </plugin>

答案 1 :(得分:0)

以下是在jetty中配置数据源的一系列示例。

http://www.eclipse.org/jetty/documentation/current/jndi-datasource-examples.html