You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomee.apache.org by Jonathan Gallimore <jo...@gmail.com> on 2009/08/05 00:07:42 UTC

Re: .DS_Store annoyance on the Mac

I've had a look at this, and it looks like we look at all the files in the
webapps folder when running in Tomcat. I've made this really simple patch
which will ignore any files starting with a dot:

Can I just check I haven't missed an obvious setting before I commit this?

Cheers

Jon

jgallimore@desktop:~/Sync/OpenEJB/src/openejb3$ svn diff
Index:
assembly/openejb-tomcat/openejb-tomcat-catalina/src/main/java/org/apache/openejb/tomcat/catalina/TomcatWebAppBuilder.java
===================================================================
---
assembly/openejb-tomcat/openejb-tomcat-catalina/src/main/java/org/apache/openejb/tomcat/catalina/TomcatWebAppBuilder.java
(revision 800924)
+++
assembly/openejb-tomcat/openejb-tomcat-catalina/src/main/java/org/apache/openejb/tomcat/catalina/TomcatWebAppBuilder.java
(working copy)
@@ -449,6 +449,11 @@
                 String name = file.getName();
                 // ignore war files
                 if (name.toLowerCase().endsWith(".war") ||
name.equals("ROOT") || name.equalsIgnoreCase("META-INF") ||
name.equalsIgnoreCase("WEB-INF")) continue;
+                // ignore files beginning with a .
+                if (name.startsWith(".")) {
+                    logger.info("Ignoring file: " + name);
+                    continue;
+                }
                 // ignore unpacked web apps
                 if (file.isDirectory() && new File(file,
"WEB-INF").exists()) continue;
                 // ignore unpacked apps where packed version is present
(packed version is owner)


On Tue, Aug 4, 2009 at 2:10 PM, Jonathan Gallimore <
jonathan.gallimore@gmail.com> wrote:

> Hi Riaz,
>
> Off the top of my head, I'm not aware of a setting that would do this when
> running in Tomcat mode - we do have a openejb.deployments.classpath.exclude
> property when running OpenEJB in an embedded manner. I'll have a go and see
> if there is some setting that will do this in Tomcat. If there isn't, I'm
> sure we can add something (I think ignoring anything that starts with a .
> would be a good idea).
>
> Jon
>
>
> On Sun, Aug 2, 2009 at 9:17 PM, riazb <ma...@riazb.com> wrote:
>
>>
>> Hello,
>> Is there a way to make OpenEJB3 not constantly try to initialize .DS_Store
>> within webapps (or wherever) and throwing a repeated error which is making
>> my Eclipse console eternally long with pointless errors.
>> The error is:
>>
>> Error deploying application /Developer/Tomcat/webapps/.DS_Store
>> org.apache.openejb.config.UnknownModuleTypeException: Unable to determine
>> module type for jar: file:/Developer/Tomcat/webapps/.DS_Store: Unknown
>> module type: url=file:/Developer/Tomcat/webapps/.DS_Store
>>        at
>> org.apache.openejb.config.DeploymentLoader.load(DeploymentLoader.java:122)
>>        at
>>
>> org.apache.openejb.tomcat.catalina.TomcatWebAppBuilder.checkHost(TomcatWebAppBuilder.java:467)
>>        at
>>
>> org.apache.openejb.tomcat.catalina.GlobalListenerSupport.lifecycleEvent(GlobalListenerSupport.java:74)
>>        at
>>
>> org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
>>        at
>>
>> org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1337)
>>        at
>>
>> org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1601)
>>        at
>>
>> org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1610)
>>        at
>>
>> org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1590)
>>        at java.lang.Thread.run(Thread.java:637)
>> Caused by: org.apache.openejb.config.UnknownModuleTypeException: Unknown
>> module type: url=file:/Developer/Tomcat/webapps/.DS_Store
>>        at
>>
>> org.apache.openejb.config.DeploymentLoader.discoverModuleType(DeploymentLoader.java:1176)
>>        at
>> org.apache.openejb.config.DeploymentLoader.load(DeploymentLoader.java:120)
>>
>> According to Mac forums, .DS_Store cannot be disable on a local drive.
>> I googled around and found out that on the Geronimo task list, there was
>> mention of 'Ignore .DS_Store when scanning'.
>>
>> Anything similar in OpenEJB? thanks
>>
>> Riaz
>> --
>> View this message in context:
>> http://www.nabble.com/.DS_Store-annoyance-on-the-Mac-tp24781677p24781677.html
>> Sent from the OpenEJB User mailing list archive at Nabble.com.
>>
>>
>

Re: .DS_Store annoyance on the Mac

Posted by Jonathan Gallimore <jo...@gmail.com>.
Hi Jean-Louis,

It is ignored at the moment, however I added some code to process
<Deployments> in openejb.xml as part of this work so that we could figure
out what to ignore.

It seems the the ability to control what is ignored is desirable and
Openejb.xml seemed like a good place to specify it. I'm open to configuring
this setting in another way.

Currently I'm leaning towards just ignoring a <Deployments dir="webapps/"/>
tag in DeploymentsResolver when we're running in Tomcat to solve the
problem, but I'm interested in any ideas anyone has.

Jon

On Mon, Sep 7, 2009 at 8:46 PM, Jean-Louis MONTEIRO <
jean-louis.monteiro@atosorigin.com> wrote:

>
> Hi Jon,
>
> Cool to share with you again.
> When running in Tomcat, i initially thought <Deployment .. /> was ignored.
>
>
> Jonathan Gallimore-2 wrote:
> >
> > We could ignore <Deployments> for the webapps folder in
> > DeploymentsResolver
> > if we're running in Tomcat - or perhaps there's a better way?
> >
>
> I guess it does not make sense to deal with.
>
> Jean-Louis
>
> --
> View this message in context:
> http://www.nabble.com/Re%3A-.DS_Store-annoyance-on-the-Mac-tp24817183p25335405.html
> Sent from the OpenEJB Dev mailing list archive at Nabble.com.
>
>

Re: .DS_Store annoyance on the Mac

Posted by Jean-Louis MONTEIRO <je...@atosorigin.com>.
Hi Jon,

Cool to share with you again.
When running in Tomcat, i initially thought <Deployment .. /> was ignored.


Jonathan Gallimore-2 wrote:
> 
> We could ignore <Deployments> for the webapps folder in
> DeploymentsResolver
> if we're running in Tomcat - or perhaps there's a better way?
> 

I guess it does not make sense to deal with.

Jean-Louis

-- 
View this message in context: http://www.nabble.com/Re%3A-.DS_Store-annoyance-on-the-Mac-tp24817183p25335405.html
Sent from the OpenEJB Dev mailing list archive at Nabble.com.


Re: .DS_Store annoyance on the Mac

Posted by riazb <ma...@riazb.com>.
I second that.

Having an xml file (maybe use a new <exclude> element within openejb.xml)
where we could type in an exclude list (.war, .DS_Store, etc) would also
clean up the source from all the 'if's and hard-coded exclusions.


Jacek Laskowski wrote:
> 
> On Wed, Aug 5, 2009 at 12:07 AM, Jonathan
> Gallimore<jo...@gmail.com> wrote:
>> I've had a look at this, and it looks like we look at all the files in
>> the
>> webapps folder when running in Tomcat. I've made this really simple patch
>> which will ignore any files starting with a dot:
> 
> Looks fine, but having an option to configure what to skip from
> processing would be even better :)
> 
> Jacek
> 
> -- 
> Jacek Laskowski
> Notatnik Projektanta Java EE - http://www.JacekLaskowski.pl
> 
> 

-- 
View this message in context: http://www.nabble.com/.DS_Store-annoyance-on-the-Mac-tp24781677p24828812.html
Sent from the OpenEJB User mailing list archive at Nabble.com.


Re: .DS_Store annoyance on the Mac

Posted by Jonathan Gallimore <jo...@gmail.com>.
That's right - with the patch in its current form, just adding:

<Deployments dir="apps/" excludes="Thumbs\.db"/>

to openejb.xml would do what you want.

Jon

On Mon, Sep 7, 2009 at 8:09 PM, Daniel S. Haischt <
daniel.haischt@googlemail.com> wrote:

> Hi,
>
> I understand once you have this implemented accordingly one would as
> well be able to exclude the infamous Thumbs.db on windoze, right ?
>
> Cheers
> Daniel
>
> On Sun, Sep 6, 2009 at 11:48 PM, Jonathan
> Gallimore<jo...@gmail.com> wrote:
> > I've been playing around with this today, and I've created a patch which
> > I've attached to OPENEJB-1057.
> >
> > What I'm doing is looking at the deployments section of openejb.xml (I've
> > added an extra attribute called excludes to Deployments), and ignoring
> files
> > which match the pattern specified.
> >
> > The problem I've run into is that in order to exclude files in the
> webapps
> > directory when running in Tomcat, you need to add a <Deployments
> > dir="webapps/" /> which causes everything in the webapps folder to be
> > deployed from DeploymentsResolver instead of TomcatWebAppBuilder, and
> that
> > give exceptions about looking for tag libraries.
> >
> > We could ignore <Deployments> for the webapps folder in
> DeploymentsResolver
> > if we're running in Tomcat - or perhaps there's a better way?
> >
> > Anyone have any thoughts?
> >
> > Cheers
> >
> > Jon
> >
> > On Wed, Aug 5, 2009 at 4:43 PM, Karan Malhi <ka...@gmail.com>
> wrote:
> >
> >> I agree that something configurable would be better.
> >>
> >> On Wed, Aug 5, 2009 at 7:41 AM, Jacek Laskowski <jacek@laskowski.net.pl
> >> >wrote:
> >>
> >> > On Wed, Aug 5, 2009 at 12:07 AM, Jonathan
> >> > Gallimore<jo...@gmail.com> wrote:
> >> > > I've had a look at this, and it looks like we look at all the files
> in
> >> > the
> >> > > webapps folder when running in Tomcat. I've made this really simple
> >> patch
> >> > > which will ignore any files starting with a dot:
> >> >
> >> > Looks fine, but having an option to configure what to skip from
> >> > processing would be even better :)
> >> >
> >> > Jacek
> >> >
> >> > --
> >> > Jacek Laskowski
> >> > Notatnik Projektanta Java EE - http://www.JacekLaskowski.pl
> >> >
> >>
> >>
> >>
> >> --
> >> Karan Singh Malhi
> >>
> >
>

Re: .DS_Store annoyance on the Mac

Posted by "Daniel S. Haischt" <da...@googlemail.com>.
Hi,

I understand once you have this implemented accordingly one would as
well be able to exclude the infamous Thumbs.db on windoze, right ?

Cheers
Daniel

On Sun, Sep 6, 2009 at 11:48 PM, Jonathan
Gallimore<jo...@gmail.com> wrote:
> I've been playing around with this today, and I've created a patch which
> I've attached to OPENEJB-1057.
>
> What I'm doing is looking at the deployments section of openejb.xml (I've
> added an extra attribute called excludes to Deployments), and ignoring files
> which match the pattern specified.
>
> The problem I've run into is that in order to exclude files in the webapps
> directory when running in Tomcat, you need to add a <Deployments
> dir="webapps/" /> which causes everything in the webapps folder to be
> deployed from DeploymentsResolver instead of TomcatWebAppBuilder, and that
> give exceptions about looking for tag libraries.
>
> We could ignore <Deployments> for the webapps folder in DeploymentsResolver
> if we're running in Tomcat - or perhaps there's a better way?
>
> Anyone have any thoughts?
>
> Cheers
>
> Jon
>
> On Wed, Aug 5, 2009 at 4:43 PM, Karan Malhi <ka...@gmail.com> wrote:
>
>> I agree that something configurable would be better.
>>
>> On Wed, Aug 5, 2009 at 7:41 AM, Jacek Laskowski <jacek@laskowski.net.pl
>> >wrote:
>>
>> > On Wed, Aug 5, 2009 at 12:07 AM, Jonathan
>> > Gallimore<jo...@gmail.com> wrote:
>> > > I've had a look at this, and it looks like we look at all the files in
>> > the
>> > > webapps folder when running in Tomcat. I've made this really simple
>> patch
>> > > which will ignore any files starting with a dot:
>> >
>> > Looks fine, but having an option to configure what to skip from
>> > processing would be even better :)
>> >
>> > Jacek
>> >
>> > --
>> > Jacek Laskowski
>> > Notatnik Projektanta Java EE - http://www.JacekLaskowski.pl
>> >
>>
>>
>>
>> --
>> Karan Singh Malhi
>>
>

Re: .DS_Store annoyance on the Mac

Posted by Jonathan Gallimore <jo...@gmail.com>.
I've been playing around with this today, and I've created a patch which
I've attached to OPENEJB-1057.

What I'm doing is looking at the deployments section of openejb.xml (I've
added an extra attribute called excludes to Deployments), and ignoring files
which match the pattern specified.

The problem I've run into is that in order to exclude files in the webapps
directory when running in Tomcat, you need to add a <Deployments
dir="webapps/" /> which causes everything in the webapps folder to be
deployed from DeploymentsResolver instead of TomcatWebAppBuilder, and that
give exceptions about looking for tag libraries.

We could ignore <Deployments> for the webapps folder in DeploymentsResolver
if we're running in Tomcat - or perhaps there's a better way?

Anyone have any thoughts?

Cheers

Jon

On Wed, Aug 5, 2009 at 4:43 PM, Karan Malhi <ka...@gmail.com> wrote:

> I agree that something configurable would be better.
>
> On Wed, Aug 5, 2009 at 7:41 AM, Jacek Laskowski <jacek@laskowski.net.pl
> >wrote:
>
> > On Wed, Aug 5, 2009 at 12:07 AM, Jonathan
> > Gallimore<jo...@gmail.com> wrote:
> > > I've had a look at this, and it looks like we look at all the files in
> > the
> > > webapps folder when running in Tomcat. I've made this really simple
> patch
> > > which will ignore any files starting with a dot:
> >
> > Looks fine, but having an option to configure what to skip from
> > processing would be even better :)
> >
> > Jacek
> >
> > --
> > Jacek Laskowski
> > Notatnik Projektanta Java EE - http://www.JacekLaskowski.pl
> >
>
>
>
> --
> Karan Singh Malhi
>

Re: .DS_Store annoyance on the Mac

Posted by Karan Malhi <ka...@gmail.com>.
I agree that something configurable would be better.

On Wed, Aug 5, 2009 at 7:41 AM, Jacek Laskowski <ja...@laskowski.net.pl>wrote:

> On Wed, Aug 5, 2009 at 12:07 AM, Jonathan
> Gallimore<jo...@gmail.com> wrote:
> > I've had a look at this, and it looks like we look at all the files in
> the
> > webapps folder when running in Tomcat. I've made this really simple patch
> > which will ignore any files starting with a dot:
>
> Looks fine, but having an option to configure what to skip from
> processing would be even better :)
>
> Jacek
>
> --
> Jacek Laskowski
> Notatnik Projektanta Java EE - http://www.JacekLaskowski.pl
>



-- 
Karan Singh Malhi

Re: .DS_Store annoyance on the Mac

Posted by Jacek Laskowski <ja...@laskowski.net.pl>.
On Wed, Aug 5, 2009 at 12:07 AM, Jonathan
Gallimore<jo...@gmail.com> wrote:
> I've had a look at this, and it looks like we look at all the files in the
> webapps folder when running in Tomcat. I've made this really simple patch
> which will ignore any files starting with a dot:

Looks fine, but having an option to configure what to skip from
processing would be even better :)

Jacek

-- 
Jacek Laskowski
Notatnik Projektanta Java EE - http://www.JacekLaskowski.pl

Re: .DS_Store annoyance on the Mac

Posted by David Blevins <da...@visi.com>.
Looks good to me.

-David

On Aug 4, 2009, at 3:07 PM, Jonathan Gallimore wrote:

> I've had a look at this, and it looks like we look at all the files  
> in the
> webapps folder when running in Tomcat. I've made this really simple  
> patch
> which will ignore any files starting with a dot:
>
> Can I just check I haven't missed an obvious setting before I commit  
> this?
>
> Cheers
>
> Jon
>
> jgallimore@desktop:~/Sync/OpenEJB/src/openejb3$ svn diff
> Index:
> assembly/openejb-tomcat/openejb-tomcat-catalina/src/main/java/org/ 
> apache/openejb/tomcat/catalina/TomcatWebAppBuilder.java
> ===================================================================
> ---
> assembly/openejb-tomcat/openejb-tomcat-catalina/src/main/java/org/ 
> apache/openejb/tomcat/catalina/TomcatWebAppBuilder.java
> (revision 800924)
> +++
> assembly/openejb-tomcat/openejb-tomcat-catalina/src/main/java/org/ 
> apache/openejb/tomcat/catalina/TomcatWebAppBuilder.java
> (working copy)
> @@ -449,6 +449,11 @@
>                 String name = file.getName();
>                 // ignore war files
>                 if (name.toLowerCase().endsWith(".war") ||
> name.equals("ROOT") || name.equalsIgnoreCase("META-INF") ||
> name.equalsIgnoreCase("WEB-INF")) continue;
> +                // ignore files beginning with a .
> +                if (name.startsWith(".")) {
> +                    logger.info("Ignoring file: " + name);
> +                    continue;
> +                }
>                 // ignore unpacked web apps
>                 if (file.isDirectory() && new File(file,
> "WEB-INF").exists()) continue;
>                 // ignore unpacked apps where packed version is  
> present
> (packed version is owner)
>
>
> On Tue, Aug 4, 2009 at 2:10 PM, Jonathan Gallimore <
> jonathan.gallimore@gmail.com> wrote:
>
>> Hi Riaz,
>>
>> Off the top of my head, I'm not aware of a setting that would do  
>> this when
>> running in Tomcat mode - we do have a  
>> openejb.deployments.classpath.exclude
>> property when running OpenEJB in an embedded manner. I'll have a go  
>> and see
>> if there is some setting that will do this in Tomcat. If there  
>> isn't, I'm
>> sure we can add something (I think ignoring anything that starts  
>> with a .
>> would be a good idea).
>>
>> Jon
>>
>>
>> On Sun, Aug 2, 2009 at 9:17 PM, riazb <ma...@riazb.com> wrote:
>>
>>>
>>> Hello,
>>> Is there a way to make OpenEJB3 not constantly try to  
>>> initialize .DS_Store
>>> within webapps (or wherever) and throwing a repeated error which  
>>> is making
>>> my Eclipse console eternally long with pointless errors.
>>> The error is:
>>>
>>> Error deploying application /Developer/Tomcat/webapps/.DS_Store
>>> org.apache.openejb.config.UnknownModuleTypeException: Unable to  
>>> determine
>>> module type for jar: file:/Developer/Tomcat/webapps/.DS_Store:  
>>> Unknown
>>> module type: url=file:/Developer/Tomcat/webapps/.DS_Store
>>>       at
>>> org 
>>> .apache.openejb.config.DeploymentLoader.load(DeploymentLoader.java: 
>>> 122)
>>>       at
>>>
>>> org 
>>> .apache 
>>> .openejb 
>>> .tomcat 
>>> .catalina.TomcatWebAppBuilder.checkHost(TomcatWebAppBuilder.java: 
>>> 467)
>>>       at
>>>
>>> org 
>>> .apache 
>>> .openejb 
>>> .tomcat 
>>> .catalina 
>>> .GlobalListenerSupport.lifecycleEvent(GlobalListenerSupport.java:74)
>>>       at
>>>
>>> org 
>>> .apache 
>>> .catalina 
>>> .util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
>>>       at
>>>
>>> org 
>>> .apache 
>>> .catalina.core.ContainerBase.backgroundProcess(ContainerBase.java: 
>>> 1337)
>>>       at
>>>
>>> org.apache.catalina.core.ContainerBase 
>>> $ContainerBackgroundProcessor.processChildren(ContainerBase.java: 
>>> 1601)
>>>       at
>>>
>>> org.apache.catalina.core.ContainerBase 
>>> $ContainerBackgroundProcessor.processChildren(ContainerBase.java: 
>>> 1610)
>>>       at
>>>
>>> org.apache.catalina.core.ContainerBase 
>>> $ContainerBackgroundProcessor.run(ContainerBase.java:1590)
>>>       at java.lang.Thread.run(Thread.java:637)
>>> Caused by: org.apache.openejb.config.UnknownModuleTypeException:  
>>> Unknown
>>> module type: url=file:/Developer/Tomcat/webapps/.DS_Store
>>>       at
>>>
>>> org 
>>> .apache 
>>> .openejb 
>>> .config.DeploymentLoader.discoverModuleType(DeploymentLoader.java: 
>>> 1176)
>>>       at
>>> org 
>>> .apache.openejb.config.DeploymentLoader.load(DeploymentLoader.java: 
>>> 120)
>>>
>>> According to Mac forums, .DS_Store cannot be disable on a local  
>>> drive.
>>> I googled around and found out that on the Geronimo task list,  
>>> there was
>>> mention of 'Ignore .DS_Store when scanning'.
>>>
>>> Anything similar in OpenEJB? thanks
>>>
>>> Riaz
>>> --
>>> View this message in context:
>>> http://www.nabble.com/.DS_Store-annoyance-on-the-Mac-tp24781677p24781677.html
>>> Sent from the OpenEJB User mailing list archive at Nabble.com.
>>>
>>>
>>