代码之家  ›  专栏  ›  技术社区  ›  Hank Jesus M C

带有嵌入式glassfish的junit失败-应该嵌入jms资源适配器

  •  1
  • Hank Jesus M C  · 技术社区  · 15 年前

    我正在尝试测试会话bean(netbeans 6.8,glassfish v3)。不幸的是,嵌入式glassfish无法正常启动,因为它试图连接到远程jms提供程序(在localhost:7676):

    $ ant test
    ...
    [junit] Mar 23, 2010 12:13:51 PM com.sun.messaging.jms.ra.ResourceAdapter start
    [junit] INFO: MQJMSRA_RA1101: SJSMQ JMS Resource Adapter starting: REMOTE
    [junit] Mar 23, 2010 12:13:51 PM com.sun.messaging.jmq.jmsclient.ExceptionHandler throwConnectionException
    [junit] WARNING: [C4003]: Error occurred on connection creation [localhost:7676]. - cause: java.net.ConnectException: Connection refused
    

    错误本身是正确的,因为没有(其他)jms提供程序正在运行。我希望嵌入式glassfish以嵌入式模式启动jms提供程序。

    我的测试使用javax.ejb.embeddable.ejbContainer:

    @BeforeClass
    public static void initContainer() throws Exception {
        ec = EJBContainer.createEJBContainer();
        ctx = ec.getContext();
    }
    

    当我正常启动Glassfish时,没关系:

    $ bin/asadmin get server.jms-service.type
    server.jms-service.type=EMBEDDED
    

    如何让我的junit测试使用带有嵌入式jms提供程序的嵌入式glassfish?

    1 回复  |  直到 15 年前
        1
  •  0
  •   Hank Jesus M C    15 年前

    好的,我从 here ,现在它正在按预期启动嵌入的jms提供程序。