-
1. Re: virtual directories in Jboss 5
peterj Dec 27, 2008 5:40 PM (in response to david.bennett)Please post the changes you made to server.xml. Also, please indicate where you made those changes (including some of the tags before before and after your changes should be sufficient).
I am pretty certain this was working in CR2, at least I think that is the last time I tried it. I haven't tried GA yet. -
2. Re: virtual directories in Jboss 5
iksrazal Jan 7, 2009 11:56 AM (in response to david.bennett)Anyone have a fix for this? I have the same problem. Here's my server.xml config:
<Host name="localhost"> <Valve className="org.jboss.web.tomcat.service.jca.CachedConnectionValve" cachedConnectionManagerObjectName="jboss.jca:service=CachedConnectionManager" transactionManagerObjectName="jboss:service=TransactionManager" /> <Context path="/dev" docBase="/programs/myDev" reloadable="true"/> </Host>
This config worked on at least 4.0.5 and 4.2.2 . I searched the release notes and the jboss 5 docs and I see nothing about this change. Please help. -
3. Re: virtual directories in Jboss 5
peterj Jan 7, 2009 3:12 PM (in response to david.bennett)I went back and tried this on various releases. The results:
4.2.3: works
5.0.0.Beta4: works
5.0.0.CR1 & CR2: does not work
5.0.0.GA: generates this error:11:48:18,994 ERROR [AbstractKernelController] Error installing to Start: name=WebServer state=Create org.jboss.xb.binding.JBossXBException: Failed to parse source: Context not found as a child of Host at org.jboss.xb.binding.parser.sax.SaxJBossXBParser.parse(SaxJBossXBParser.java:203) at org.jboss.xb.binding.parser.sax.SaxJBossXBParser.parse(SaxJBossXBParser.java:183) at org.jboss.xb.binding.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:133) at org.jboss.web.tomcat.service.deployers.TomcatService.startService(TomcatService.java:171) at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:376) ...
I would open a JIRA issue, but for some reason I do not have update access to JIRA... -
4. Re: virtual directories in Jboss 5
iksrazal Jan 7, 2009 7:09 PM (in response to david.bennett)Thanks for the reply. I created this jira:
https://jira.jboss.org/jira/browse/JBAS-6368 -
5. Re: virtual directories in Jboss 5
iksrazal Jan 7, 2009 7:17 PM (in response to david.bennett)BTW, as a workaround I looked at the context.xml file, as that seems to now be the preferred way to add a Context in tomcat. However, the jbossweb.sar/context.xml is seeming global, and only allows one Context defined. I need to add four contexts. Anyone know how to do userland context.xml files in jboss 5? I looked in the jboss docs and I couldn't find the equivalent as explained in the tomcat docs.
-
6. Re: virtual directories in Jboss 5
janv Jan 15, 2009 2:32 AM (in response to david.bennett)I'm using JBoss 5.0.0.GA with JDK 6.
I expand the war file in the deploy directory. I then create a symbolic link in the expanded directory. It looks like JBoss does not follow the symbolic link and there is not "Context path" like in JBoss 4 where "allowLinking=true" could be set.
Any ideas? -
7. Re: virtual directories in Jboss 5
formica Jan 26, 2009 10:21 AM (in response to david.bennett)Did you manage to get JBoss 5 web server to access static content in the file system ?
I have exactly the same problem that you are mentioning in this topics and
I did not found any solution for the moment.
Thanks in advance
Andrea -
8. Re: virtual directories in Jboss 5
peterj Jan 26, 2009 11:01 AM (in response to david.bennett)According to the JIRA, this feature has been dropped (the JIRA was rejected). The only option you have is to add a new deploy directory in profile-service.xml. Of course, doing so means that you will have to rename the directory that contains the static content to xxx.war.
-
9. Re: virtual directories in Jboss 5
huntp Jun 29, 2009 4:06 AM (in response to david.bennett)Was there ever a solution posted for this? I am also having the problem - "Context not found as a child of Host".
-
10. Re: virtual directories in Jboss 5
chernandeznet Aug 17, 2009 7:33 PM (in response to david.bennett)here's a solution for adding virtual directory:
http://www.coderanch.com/t/436452/JBoss/JBoss-virtual-directory-jboss -
11. Re: virtual directories in Jboss 5
ryanhos Jan 7, 2010 3:13 PM (in response to chernandeznet)If you are running Windows, and have little control over where your content lives, a symlink can ease your pain.
Static content is placed here, and here only by a third-party application with no configuration options:
%CONTENT_HOME% = d:\inflexible-corp\inflexible-app\output\images
create a dummy WEB-INF directory with a web.xml
<web-app></web-app>
and a jboss-web.xml, and copy it to %CONTENT_HOME%
<jboss-web> <context-root>/staticimages</context-root> </jboss-web>
in a command prompt:
d: cd %JBOSS_HOME%\server\all\deploy mklink /D staticimages.war %CONTENT_HOME%
Boot JBoss. Your fake war will deploy nicely.
WARNING
Note that most programs are not aware of symlinks and will delete the contents of %CONTENT_HOME% if turned loose on the symlink. For example, deleting %JBOSS_HOME% on a development box with Ant's <delete> task will clean out %CONTENT_HOME%, which I expect is NOT what you desire. As an aside, I tried this prior to actually symlinking to the directory with the valuable content, so I got off easy.
Bonus
This works with UNC paths also.
mklink /D staticimages.war \\networkserver\dir1\images
Rant
Why on earth would a product manager consider it reasonable to remove a long-standing and well-used feature from a product? As the primary JBoss integrator on my DoD project, I feel like I'm beginning to spend more time working against JBoss and JBossESB than I am working with it.
Message was edited by: Ryan Hochstetler. Changed slashes to backslashes. I use a Mac at home, Cygwin at work, and am in the habit of using unix-style directory separators.