Skip to main content

developerWorks >  Open Source  >  Forums  >  IBM WebSphere Application Server Community Edition and Apache Geronimo  >  developerWorks

What is proper deployment plan when xmlns:webusing <web:host>?    Point your RSS reader here for a feed of the latest messages in this thread


     

 
 

My developerWorks
 Welcome, Guest
Sign in or register
This question is not answered.

Permlink Replies: 7 - Pages: 1 - Last Post: Nov 13, 2009 7:48 AM Last Post By: David_Frahm
David_Frahm

Posts: 32
Registered: Sep 28, 2005 01:48:37 PM
What is proper deployment plan when xmlns:webusing <web:host>?
Posted: Nov 04, 2009 01:11:15 PM
 
Click to report abuse...   Click to reply to this thread Reply
When I use proper WASCE v2.1 namespace in my geronimo-web.xml, like this:

{code}
David_Frahm

Posts: 32
Registered: Sep 28, 2005 01:48:37 PM
Re: What is proper deployment plan when xmlns:webusing <web:host>?
Posted: Nov 04, 2009 01:26:50 PM   in response to: David_Frahm in response to: David_Frahm's post
 
Click to report abuse...   Click to reply to this thread Reply
Here's what my original thread post should have been... Not sure what happened there...

When I use proper WASCE v2.1 namespace in my geronimo-web.xml, and add the <web:host> for a virtual host, Eclipse tells me that its invalid. It deploys fine, so I guess its correct?

Here's the Eclipse error:

cvc-complex-type.2.4.a: Invalid content was found starting with element 'web:host'. One of '{"http://geronimo.apache.org/xml/ns/j2ee/web-2.0.1":work-dir, "http://
geronimo.apache.org/xml/ns/naming-1.2":web-container, "http://geronimo.apache.org/xml/ns/j2ee/web-2.0.1":container-config, "http://geronimo.apache.org/xml/ns/
naming-1.2":abstract-naming-entry, "http://geronimo.apache.org/xml/ns/naming-1.2":ejb-ref, "http://geronimo.apache.org/xml/ns/naming-1.2":ejb-local-ref, "http://
geronimo.apache.org/xml/ns/naming-1.2":service-ref, "http://geronimo.apache.org/xml/ns/naming-1.2":resource-ref, "http://geronimo.apache.org/xml/ns/naming-1.2":resource-
env-ref, "http://geronimo.apache.org/xml/ns/naming-1.2":message-destination, "http://geronimo.apache.org/xml/ns/j2ee/web-2.0.1":security-realm-name, "http://
geronimo.apache.org/xml/ns/deployment-1.2":service, "http://java.sun.com/xml/ns/persistence":persistence}' is expected.

Here's the relevant sections of geronimo-web.xml:

<web:web-app
xmlns:web="http://geronimo.apache.org/xml/ns/j2ee/web-2.0.1"
xmlns:app="http://geronimo.apache.org/xml/ns/j2ee/application-2.0"
xmlns:client="http://geronimo.apache.org/xml/ns/j2ee/application-client-2.0"
xmlns:conn="http://geronimo.apache.org/xml/ns/j2ee/connector-1.2"
xmlns:dep="http://geronimo.apache.org/xml/ns/deployment-1.2"
xmlns:ejb="http://openejb.apache.org/xml/ns/openejb-jar-2.2"
xmlns:name="http://geronimo.apache.org/xml/ns/naming-1.2"
xmlns:pers="http://java.sun.com/xml/ns/persistence"
xmlns:pkgen="http://openejb.apache.org/xml/ns/pkgen-2.1"
xmlns:sec="http://geronimo.apache.org/xml/ns/security-2.0"
xmlns:tomcat="http://geronimo.apache.org/xml/ns/j2ee/web/tomcat-2.0.1"
>
 
<web:context-root>/</web:context-root>
<web:host>www.myvirtualhost.com</web:host>


Is the XSD in the GEP incorrect? I don't see anything for 'host' in the schema doc either (http://geronimo.apache.org/schemas-2.1/docs/geronimo-web-2.0.1.xsd.html).

If this is any kind of bug I'll submit it to JIRA but thought I'd check here first.
Jeff_chi

Posts: 38
Registered: Oct 30, 2008 01:14:20 AM
Re: What is proper deployment plan when xmlns:webusing <web:host>?
Posted: Nov 10, 2009 08:45:54 AM   in response to: David_Frahm in response to: David_Frahm's post
 
Click to report abuse...   Click to reply to this thread Reply
Hi David,

It's correct. the host element is from container-configType, which is a complexType and for a web application needs to take container specific settings. Because WAS CE uses Tomcat as its embedded web container.

And in Tomcat, the Host element represents a virtual host, which is an association of a network name for a server (such as "www.mycompany.com" with the particular server on which Catalina is running.)

You may refer to:

http://tomcat.apache.org/tomcat-6.0-doc/config/host.html

Jeff C

David_Frahm

Posts: 32
Registered: Sep 28, 2005 01:48:37 PM
Re: What is proper deployment plan when xmlns:webusing <web:host>?
Posted: Nov 10, 2009 10:26:55 AM   in response to: Jeff_chi in response to: Jeff_chi's post
 
Click to report abuse...   Click to reply to this thread Reply
I had found that tomcat doc and tried that, but it appeared to not work. However, I just tried again and this time realized what I'd missed before.

My index.jsp does work, but the redirect to my JSF page fails. The browser displays HTTP 400 Bad Request.

The server.log has zero output for this failed request.

I am using JSF 1.2 with Facelets 1.1.14. My JSF RI is whatever v1.2.x MyFaces that comes with WASCE v2.1.1.3, and I've only added Tomahawk 1.1.9 so nothing too crazy there.

Here's my /var/config/config.xml snippet:

<gbean gbeanInfo="org.apache.geronimo.tomcat.HostGBean"
	name="org.apache.geronimo.configs/tomcat6/2.1.1/car?ServiceModule=org.apache.geronimo.configs/tomcat6/2.1.1/car,j2eeType=Host,name=TestWebApp">
	<attribute name="className">org.apache.catalina.core.StandardHost</attribute>
	<attribute name="initParams">name=test.teamhuber.com
		appBase=
		workDir=work</attribute>
</gbean>


And here's my valid geronimo-web.xml snippet:
<web:container-config>
	<tomcat:web-app>
		<tomcat:context-root>/</tomcat:context-root>
		<tomcat:host>TestWebApp</tomcat:host>
	</tomcat:web-app>
</web:container-config>


When I use the following in my geronimo-web.xml, everything (JSP and JSF) works (just my XML is invalid):

<web:context-root>/</web:context-root>
<web:host>test.teamhuber.com</web:host>
David_Frahm

Posts: 32
Registered: Sep 28, 2005 01:48:37 PM
Re: What is proper deployment plan when xmlns:webusing <web:host>?
Posted: Nov 10, 2009 11:44:55 AM   in response to: David_Frahm in response to: David_Frahm's post
 
Click to report abuse...   Click to reply to this thread Reply
More information...

I just noticed that when I deploy my web app with the 'valid' <web:container-config> (see snippet in previous reply) it shows up in Admin Console as URL '/WebApp_ID'.

Maybe that is a clue?
Jeff_chi

Posts: 38
Registered: Oct 30, 2008 01:14:20 AM
Re: What is proper deployment plan when xmlns:webusing <web:host>?
Posted: Nov 11, 2009 05:33:57 AM   in response to: David_Frahm in response to: David_Frahm's post
 
Click to report abuse...   Click to reply to this thread Reply
David, you might need to define <context-root/> with a specific value instead of using <context-root>/</context-root>.

<context-root>/</context-root> was already used by an embedded plug-in called org.apache.geronimo.configs/welcome-tomcat/2.1.4/car , I think it's also the reason you noticed '/WebApp_ID' as application URL in Admin Console.

If there is more problems, you can attach your project zip here for further investigation.

Jeff C
NiteshSinha

Posts: 4
Registered: Aug 01, 2009 04:15:32 AM
Re: What is proper deployment plan when xmlns:webusing <web:host>?
Posted: Nov 12, 2009 01:36:56 PM   in response to: David_Frahm in response to: David_Frahm's post
 
Click to report abuse...   Click to reply to this thread Reply
if you are using Eclipse 3.* then you might download some Jboss plugins to ease the development...

you can get it from here ..

http://labs.jboss.com/tools/download

the JSF plugin and the XULrunner plugin may come handy at time of deploying plans .. they have editors there which generate the deployment descriptors in the standard prescribed format.

HTH
David_Frahm

Posts: 32
Registered: Sep 28, 2005 01:48:37 PM
Re: What is proper deployment plan when xmlns:webusing <web:host>?
Posted: Nov 13, 2009 07:48:03 AM   in response to: Jeff_chi in response to: Jeff_chi's post
 
Click to report abuse...   Click to reply to this thread Reply
It deployed as /WebApp_ID when I left out the <context-root> in my plan.

Using a <context-root>/</context-root> I get a deployment error that its not unique. Eventually, I want multiple virtual hosts at the root, so I was leaving the welcome-tomcat installed and running.

Like I said, that all works fine until I try to use proper XML (or at least what I think is proper XML, posted above).

I can't post my project as-is, but will create a test sample and post that soon.
 Tags
Help

Use the search field to find all types of content in My developerWorks with that tag.

Use the slider bar to see more or fewer tags.

Popular tags shows the top tags for this particular type of content or application that you're viewing.

My tags shows your tags for this particular type of content or application that you're viewing.

 

MoreLess 


Point your RSS reader here for a feed of the latest messages in all forums