Author: jason.greene(a)jboss.com
Date: 2006-11-17 11:50:33 -0500 (Fri, 17 Nov 2006)
New Revision: 1460
Added:
trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1357/
trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1357/JBWS1357.java
trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1357/JBWS1357Impl.java
trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1357/JBWS1357TestCase.java
trunk/src/test/resources/jaxws/jbws1357/
trunk/src/test/resources/jaxws/jbws1357/WEB-INF/
trunk/src/test/resources/jaxws/jbws1357/WEB-INF/web.xml
trunk/src/test/resources/jaxws/jbws1357/hello.jsp
Modified:
trunk/src/main/java/org/jboss/ws/deployment/AbstractServiceEndpointPublisher.java
trunk/src/main/java/org/jboss/ws/integration/jboss50/AbstractJSEDeployer.java
trunk/src/main/java/org/jboss/ws/integration/jboss50/JAXWSDeployerJSE.java
trunk/src/main/java/org/jboss/ws/integration/jboss50/WebMetaDataAdaptor.java
trunk/src/test/ant/build-jars-jaxws.xml
Log:
Fix JBWS-1347
Modified:
trunk/src/main/java/org/jboss/ws/deployment/AbstractServiceEndpointPublisher.java
===================================================================
---
trunk/src/main/java/org/jboss/ws/deployment/AbstractServiceEndpointPublisher.java 2006-11-17
14:39:40 UTC (rev 1459)
+++
trunk/src/main/java/org/jboss/ws/deployment/AbstractServiceEndpointPublisher.java 2006-11-17
16:50:33 UTC (rev 1460)
@@ -141,8 +141,10 @@
// find the servlet-class
Element classElement = DOMUtils.getFirstChildElement(servletElement,
"servlet-class");
+
+ // JSP
if (classElement == null)
- throw new WSException("Cannot find <servlet-class> for
servlet-name: " + linkName);
+ continue;
// Get the servlet class
String servletClassName = DOMUtils.getTextContent(classElement);
Modified: trunk/src/main/java/org/jboss/ws/integration/jboss50/AbstractJSEDeployer.java
===================================================================
---
trunk/src/main/java/org/jboss/ws/integration/jboss50/AbstractJSEDeployer.java 2006-11-17
14:39:40 UTC (rev 1459)
+++
trunk/src/main/java/org/jboss/ws/integration/jboss50/AbstractJSEDeployer.java 2006-11-17
16:50:33 UTC (rev 1460)
@@ -120,6 +120,11 @@
{
Servlet servlet = (Servlet)it.next();
String className = servlet.getServletClass();
+
+ // JSP
+ if (className == null || className.length() == 0)
+ continue;
+
Class<?> servletClass = anLoader.loadClass(className);
if (servletClass.isAnnotationPresent(WebService.class))
{
Modified: trunk/src/main/java/org/jboss/ws/integration/jboss50/JAXWSDeployerJSE.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/integration/jboss50/JAXWSDeployerJSE.java 2006-11-17
14:39:40 UTC (rev 1459)
+++ trunk/src/main/java/org/jboss/ws/integration/jboss50/JAXWSDeployerJSE.java 2006-11-17
16:50:33 UTC (rev 1460)
@@ -70,7 +70,7 @@
{
Servlet servlet = (Servlet)it.next();
// Skip JSPs
- if (servlet.getJspFile() != null && servlet.getJspFile().length()
> 0)
+ if (servlet.getServletClass() == null ||
servlet.getServletClass().length() == 0)
continue;
String beanName = servlet.getServletClass();
Modified: trunk/src/main/java/org/jboss/ws/integration/jboss50/WebMetaDataAdaptor.java
===================================================================
---
trunk/src/main/java/org/jboss/ws/integration/jboss50/WebMetaDataAdaptor.java 2006-11-17
14:39:40 UTC (rev 1459)
+++
trunk/src/main/java/org/jboss/ws/integration/jboss50/WebMetaDataAdaptor.java 2006-11-17
16:50:33 UTC (rev 1460)
@@ -39,7 +39,7 @@
import
org.jboss.ws.metadata.j2ee.UnifiedWebSecurityMetaData.UnifiedWebResourceCollection;
/**
- * Build container independent web meta data
+ * Build container independent web meta data
*
* @author Thomas.Diesler(a)jboss.org
* @since 05-May-2006
@@ -98,7 +98,7 @@
}
return mappings;
}
-
+
private static Map<String, String> getServletClassMap(WebMetaData wmd)
{
Map<String, String> mappings = new HashMap<String, String>();
@@ -106,6 +106,10 @@
while(it.hasNext())
{
Servlet servlet = (Servlet)it.next();
+ // Skip JSPs
+ if (servlet.getServletClass() == null || servlet.getServletClass().length() ==
0)
+ continue;
+
mappings.put(servlet.getName(), servlet.getServletClass());
}
return mappings;
Modified: trunk/src/test/ant/build-jars-jaxws.xml
===================================================================
--- trunk/src/test/ant/build-jars-jaxws.xml 2006-11-17 14:39:40 UTC (rev 1459)
+++ trunk/src/test/ant/build-jars-jaxws.xml 2006-11-17 16:50:33 UTC (rev 1460)
@@ -576,7 +576,17 @@
<include
name="org/jboss/test/ws/jaxws/wsaddressing/replyto/FaultToEndpoint.class"/>
</classes>
</war>
-
+
+ <!-- jaxws-jbws1357 -->
+ <war warfile="${build.test.dir}/libs/jaxws-jbws1357.war"
webxml="${build.test.dir}/resources/jaxws/jbws1357/WEB-INF/web.xml">
+ <classes dir="${build.test.dir}/classes">
+ <include
name="org/jboss/test/ws/jaxws/jbws1357/JBWS1357.class"/>
+ <include
name="org/jboss/test/ws/jaxws/jbws1357/JBWS1357Impl.class"/>
+ </classes>
+ <fileset dir="${build.test.dir}/resources/jaxws/jbws1357">
+ <include name="hello.jsp"/>
+ </fileset>
+ </war>
</target>
</project>
Added: trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1357/JBWS1357.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1357/JBWS1357.java 2006-11-17 14:39:40
UTC (rev 1459)
+++ trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1357/JBWS1357.java 2006-11-17 16:50:33
UTC (rev 1460)
@@ -0,0 +1,29 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.test.ws.jaxws.jbws1357;
+import javax.jws.WebService;
+
+@WebService
+public interface JBWS1357
+{
+ public String echo(String message);
+}
\ No newline at end of file
Property changes on: trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1357/JBWS1357.java
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1357/JBWS1357Impl.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1357/JBWS1357Impl.java 2006-11-17
14:39:40 UTC (rev 1459)
+++ trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1357/JBWS1357Impl.java 2006-11-17
16:50:33 UTC (rev 1460)
@@ -0,0 +1,33 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.test.ws.jaxws.jbws1357;
+
+import javax.jws.WebService;
+
+(a)WebService(endpointInterface="org.jboss.test.ws.jaxws.jbws1357.JBWS1357")
+public class JBWS1357Impl implements JBWS1357
+{
+ public String echo(String message)
+ {
+ return message;
+ }
+}
Property changes on:
trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1357/JBWS1357Impl.java
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1357/JBWS1357TestCase.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1357/JBWS1357TestCase.java 2006-11-17
14:39:40 UTC (rev 1459)
+++ trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1357/JBWS1357TestCase.java 2006-11-17
16:50:33 UTC (rev 1460)
@@ -0,0 +1,74 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.test.ws.jaxws.jbws1357;
+
+import java.net.HttpURLConnection;
+import java.net.URL;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.Service;
+
+import junit.framework.Test;
+
+import org.jboss.test.ws.JBossWSTest;
+import org.jboss.test.ws.JBossWSTestSetup;
+
+/**
+ * Test JBWS-1357 (jsps in deployment)
+ *
+ * @author <a href="jason.greene(a)jboss.com">Jason T. Greene</a>
+ * @version $Revision:1370 $
+ */
+public class JBWS1357TestCase extends JBossWSTest
+{
+ private String targetNS = "http://jbws1357.jaxws.ws.test.jboss.org/";
+ private JBWS1357 proxy;
+
+ public static Test suite()
+ {
+ return JBossWSTestSetup.newTestSetup(JBWS1357TestCase.class,
"jaxws-jbws1357.war");
+ }
+
+ @Override
+ protected void setUp() throws Exception
+ {
+ super.setUp();
+
+ QName serviceName = new QName(targetNS, "JBWS1357Service");
+ URL wsdlURL = new URL("http://" + getServerHost() +
":8080/jaxws-jbws1357/JBWS1357Service?wsdl");
+
+ Service service = Service.create(wsdlURL, serviceName);
+ proxy = (JBWS1357)service.getPort(JBWS1357.class);
+ }
+
+ public void testEcho() throws Exception
+ {
+ assertEquals("hi there", proxy.echo("hi there"));
+ }
+
+ public void testJSP() throws Exception
+ {
+ URL jsp = new URL("http://" + getServerHost() +
":8080/jaxws-jbws1357/hello.jsp");
+ HttpURLConnection conn = (HttpURLConnection) jsp.openConnection();
+ assertEquals(conn.getResponseCode(), 200);
+ }
+}
\ No newline at end of file
Property changes on:
trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1357/JBWS1357TestCase.java
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: trunk/src/test/resources/jaxws/jbws1357/WEB-INF/web.xml
===================================================================
--- trunk/src/test/resources/jaxws/jbws1357/WEB-INF/web.xml 2006-11-17 14:39:40 UTC (rev
1459)
+++ trunk/src/test/resources/jaxws/jbws1357/WEB-INF/web.xml 2006-11-17 16:50:33 UTC (rev
1460)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<web-app
xmlns="http://java.sun.com/xml/ns/j2ee"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
+ version="2.4">
+
+ <servlet>
+ <servlet-name>JBWS1357Service</servlet-name>
+
<servlet-class>org.jboss.test.ws.jaxws.jbws1357.JBWS1357Impl</servlet-class>
+ </servlet>
+
+ <servlet>
+ <servlet-name>hello_jsp</servlet-name>
+ <jsp-file>/hello.jsp</jsp-file>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>JBWS1357Service</servlet-name>
+ <url-pattern>/JBWS1357Service</url-pattern>
+ </servlet-mapping>
+
+ <servlet-mapping>
+ <servlet-name>hello_jsp</servlet-name>
+ <url-pattern>/hello.jsp</url-pattern>
+ </servlet-mapping>
+
+</web-app>
Property changes on: trunk/src/test/resources/jaxws/jbws1357/WEB-INF/web.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: trunk/src/test/resources/jaxws/jbws1357/hello.jsp
===================================================================
--- trunk/src/test/resources/jaxws/jbws1357/hello.jsp 2006-11-17 14:39:40 UTC (rev 1459)
+++ trunk/src/test/resources/jaxws/jbws1357/hello.jsp 2006-11-17 16:50:33 UTC (rev 1460)
@@ -0,0 +1,5 @@
+<html>
+<body>
+<% System.out.println("Hello"); %>
+</body>
+</html>