tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From avrono <av...@neuralm.com>
Subject Re: WARNING: WebAppInfo not found.
Date Fri, 04 Jan 2013 17:44:20 GMT
Interestingly I can run a Junit test as follows :

package com.prsx.test;
import org.junit.BeforeClass;
import org.junit.Test;

import javax.ejb.embeddable.EJBContainer;
import javax.xml.namespace.QName;
import javax.xml.ws.Service;
import java.net.URL;
import java.util.Properties;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;

public class CalculatorTest {

    @BeforeClass
    public static void setUp() throws Exception {
        Properties properties = new Properties();
        properties.setProperty("openejb.embedded.remotable", "true");
        //properties.setProperty("httpejbd.print", "true");
        //properties.setProperty("httpejbd.indent.xml", "true");
        EJBContainer.createEJBContainer(properties);
    }

    @Test
    public void test() throws Exception {
        Service calculatorService = Service.create(
                //new URL("http://127.0.0.1:4204/Calculator?wsdl"),
                new URL("http://localhost:8080/Calculator?wsdl"),
                new QName("http://superbiz.org/wsdl", "CalculatorService"));

        assertNotNull(calculatorService);

        CalculatorWs calculator =
calculatorService.getPort(CalculatorWs.class);
        assertEquals(10, calculator.sum(4, 6));
        assertEquals(12, calculator.multiply(3, 4));
    }
}



But I cannot do the following :

package com.prsx;



import java.net.MalformedURLException;
import java.net.URL;

import javax.xml.namespace.QName;
import javax.xml.ws.Service;
import javax.xml.ws.WebServiceRef;

import com.myfirst.wsClient.CalculatorService;
import com.myfirst.wsClient.CalculatorWs;

public class HelloPojo {



	public String from() {
		return "POJO";
	}
	
	 public int sum(int i, int j) throws MalformedURLException {
		 /*
	    	CalculatorWs port = service.getCalculatorPort();
	    	if(port !=null) {
	    		System.out.println("Port is not null");
	    	}
	    	else {
	    		System.out.println("Port is null");
	    	}
			int value = port.sum(i, j);
			*/
		 
		 Service calculatorService = Service.create(
	                //new URL("http://127.0.0.1:4204/Calculator?wsdl"),
	                new URL("http://localhost:8080/Calculator?wsdl"),
	                new QName("http://superbiz.org/wsdl",
"CalculatorService"));
		 CalculatorWs calculator = calculatorService.getPort(CalculatorWs.class);
		 int value = calculator.sum(i, j);
		return value;
	    }
}


Any ideas ?



--
View this message in context: http://openejb.979440.n4.nabble.com/WARNING-WebAppInfo-not-found-tp4660077p4660083.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Mime
View raw message