You are viewing a plain text version of this content. The canonical link for it is here.
Posted to slide-user@jakarta.apache.org by Alexander Demidovich <al...@softhome.net> on 2001/06/17 18:36:46 UTC

JDBC issue?

I've installed Slide with Mysql (3.22) as Descriptor and Content Store.

Addind to ACL works file but not deleting entries from the one.
When I'm deleting some ACL entry it goes out and WEBDAV servlet doesn't
show it - no problem. But after I restart Tomcat this deleted entry is
restored!

I've investigated the code a little bit.
Here is sql query:
"delete from permissions where object= ? and revisionnumber = ? and subject
= ? and action = ?"

I'm not sure, but may be, if the revisionnumber is NULL this SQL must
contain something like this:

	... and revisionnumber is NULL and ....



Re: JDBC issue?

Posted by Remy Maucherat <re...@apache.org>.
> Guys,
>
> I think it the problem of Windows reaction on "/"(s) in directory path for
> the temp file.
>
> I temporary fixed it inside of StoreContent(...) as:
>
> String tempFileName1 = revisionUri + "-" + revisionNumber;
> String tempFileName = null;
> tempFileName = tempFileName1.replace('/', '.');

Thanks for the tip. I'll apply the patch. Let me know if it helps ...

Remy


RE: JDBC issue?

Posted by Valeriy Podkolzin <vp...@atg.com>.
Guys,

I think it the problem of Windows reaction on "/"(s) in directory path for
the temp file.

I temporary fixed it inside of StoreContent(...) as:

String tempFileName1 = revisionUri + "-" + revisionNumber;
String tempFileName = null;
tempFileName = tempFileName1.replace('/', '.');

Valeriy Podkolzin


-----Original Message-----
From: Remy Maucherat [mailto:remm@apache.org]
Sent: Tuesday, June 26, 2001 6:12 PM
To: slide-user@jakarta.apache.org
Subject: Re: JDBC issue?


> hi,
>   I am running the WebdavServlet in the catalina server and i am using the
> java client Slide to connect to the server and execute the webdav methods
> like proppatch,propget and put.
> When i give  a command like
>         [LOCALHOST] /slide/files/ $  put run.bat sample.txt
> I get an internal server error on the client side and the following stack
> trace on the server side.The object /files/sample.txt does not initially
> exist in the store.
>
> the temp file name is : /files/sample.txt-1.0
> java.io.IOException: The system cannot find the path specified
>         at java.io.Win32FileSystem.createFileExclusively(Native Method)
>         at java.io.File.checkAndCreate(File.java:1159)
>         at java.io.File.createTempFile(File.java:1244)
>         at java.io.File.createTempFile(File.java:1281)
>         at
> slidestore.reference.JDBCContentStore.storeContent(JDBCContentStore.
> ava:587)

> I see the node /files/sample.txt being created in the store even though i
> get the exception.
> Is there something wrong with what i am doing or is this bug?

That problem was reported before, but unfortunately I couldn't reproduce it.

Any help solving it, or any additional info on the problem would be much
appreciated.

Remy


Re: JDBC issue?

Posted by Remy Maucherat <re...@apache.org>.
> hi,
>   I am running the WebdavServlet in the catalina server and i am using the
> java client Slide to connect to the server and execute the webdav methods
> like proppatch,propget and put.
> When i give  a command like
>         [LOCALHOST] /slide/files/ $  put run.bat sample.txt
> I get an internal server error on the client side and the following stack
> trace on the server side.The object /files/sample.txt does not initially
> exist in the store.
>
> the temp file name is : /files/sample.txt-1.0
> java.io.IOException: The system cannot find the path specified
>         at java.io.Win32FileSystem.createFileExclusively(Native Method)
>         at java.io.File.checkAndCreate(File.java:1159)
>         at java.io.File.createTempFile(File.java:1244)
>         at java.io.File.createTempFile(File.java:1281)
>         at
> slidestore.reference.JDBCContentStore.storeContent(JDBCContentStore.
> ava:587)

> I see the node /files/sample.txt being created in the store even though i
> get the exception.
> Is there something wrong with what i am doing or is this bug?

That problem was reported before, but unfortunately I couldn't reproduce it.

Any help solving it, or any additional info on the problem would be much
appreciated.

Remy


RE: JDBC issue?

Posted by rajkumar <ko...@intalio.com>.
hi,
  I am running the WebdavServlet in the catalina server and i am using the
java client Slide to connect to the server and execute the webdav methods
like proppatch,propget and put.
When i give  a command like
        [LOCALHOST] /slide/files/ $  put run.bat sample.txt
I get an internal server error on the client side and the following stack
trace on the server side.The object /files/sample.txt does not initially
exist in the store.

the temp file name is : /files/sample.txt-1.0
java.io.IOException: The system cannot find the path specified
        at java.io.Win32FileSystem.createFileExclusively(Native Method)
        at java.io.File.checkAndCreate(File.java:1159)
        at java.io.File.createTempFile(File.java:1244)
        at java.io.File.createTempFile(File.java:1281)
        at
slidestore.reference.JDBCContentStore.storeContent(JDBCContentStore.
ava:587)
        at
slidestore.reference.JDBCContentStore.createRevisionContent(JDBCCont
ntStore.java:445)
        at
org.apache.slide.store.AbstractStore.createRevisionContent(AbstractS
ore.java:955)
        at
org.apache.slide.store.StandardStore.createRevisionContent(StandardS
ore.java:644)
        at org.apache.slide.content.ContentImpl.create(ContentImpl.java:507)
        at
org.apache.slide.webdav.method.PutMethod.executeRequest(PutMethod.ja
a:362)
        at
org.apache.slide.webdav.method.WebdavMethod.run(WebdavMethod.java:34
)
        at
org.apache.slide.webdav.WebdavServlet.service(WebdavServlet.java:211

        at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
        at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(App
icationFilterChain.java:254)
        at
org.apache.catalina.core.ApplicationFilterChain.doFilter(Application
ilterChain.java:194)
        at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapper
alve.java:255)
        at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipelin
.java:566)
        at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.ja
a:472)
        at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943

        at
org.apache.catalina.core.StandardContextValve.invoke(StandardContext
alve.java:225)
        at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipelin
.java:566)
        at
org.apache.catalina.authenticator.AuthenticatorBase.invoke(Authentic
torBase.java:518)
        at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipelin
.java:564)
        at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.ja
a:472)
        at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943

        at
org.apache.catalina.core.StandardContext.invoke(StandardContext.java
2252)
        at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.
ava:164)
        at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipelin
.java:566)
        at
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java
446)
        at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipelin
.java:564)
        at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.ja
a:472)
        at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943

        at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVa
ve.java:163)
        at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipelin
.java:566)
        at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.ja
a:472)
        at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943

        at
org.apache.catalina.connector.http.HttpProcessor.process(HttpProcess
r.java:875)
        at
org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.j
va:952)
        at java.lang.Thread.run(Thread.java:484)

I see the node /files/sample.txt being created in the store even though i
get the exception.
Is there something wrong with what i am doing or is this bug?
   rajkumar

-----Original Message-----
From: Remy Maucherat [mailto:remm@apache.org]
Sent: Saturday, June 23, 2001 5:44 PM
To: slide-user@jakarta.apache.org
Subject: Re: JDBC issue?


> hi,
>    When a domain.xml file is read by the application and the namespace is
> initilaized is all the node information from the <data> element taken and
> inserted into the appropriate store.For example if the domain.xml file has
> entries as follows
>
>  <data>
>
>       <objectnode classname="org.apache.slide.structure.SubjectNode"
> uri="/">
>
>         <permission action="/actions" subject="/users/root"/>
>
>         <!-- /users represents the unauthenticated user -->
>
>         <objectnode classname="org.apache.slide.structure.SubjectNode"
>          uri="/users">
>
>           <!-- /users/root represents the administrator -->
>
>           <objectnode classname="org.apache.slide.structure.SubjectNode"
>            uri="/users/root">
>           </objectnode>
>
>           <!-- /users/guest represents an authenticated guest user -->
>
>           <objectnode classname="org.apache.slide.structure.SubjectNode"
>            uri="/users/guest">
>           </objectnode>
>
>         </objectnode>
>
>         <objectnode classname="org.apache.slide.structure.ActionNode"
>          uri="/actions">
>         </objectnode>
>
>       </objectnode>
>
>     </data>
>
> are all the object nodes like "/" , "/actions"  ,"/users" and their
> properties,permissions etc automatically inserted into the appropriate
store
> or should an application have to call structure.create() methods to
> explicitly make entries for them in the store

Yes, the data is entered into the store(s), but it will stop as soon as it
finds a node which exists.

I don't like it very much that way, and I plan to change it to : make sure
the namespace has these nodes (with the specified properties). I think it
would be a more useful and predictable mechanism.

Remy


Re: JDBC issue?

Posted by Remy Maucherat <re...@apache.org>.
> hi,
>    When a domain.xml file is read by the application and the namespace is
> initilaized is all the node information from the <data> element taken and
> inserted into the appropriate store.For example if the domain.xml file has
> entries as follows
>
>  <data>
>
>       <objectnode classname="org.apache.slide.structure.SubjectNode"
> uri="/">
>
>         <permission action="/actions" subject="/users/root"/>
>
>         <!-- /users represents the unauthenticated user -->
>
>         <objectnode classname="org.apache.slide.structure.SubjectNode"
>          uri="/users">
>
>           <!-- /users/root represents the administrator -->
>
>           <objectnode classname="org.apache.slide.structure.SubjectNode"
>            uri="/users/root">
>           </objectnode>
>
>           <!-- /users/guest represents an authenticated guest user -->
>
>           <objectnode classname="org.apache.slide.structure.SubjectNode"
>            uri="/users/guest">
>           </objectnode>
>
>         </objectnode>
>
>         <objectnode classname="org.apache.slide.structure.ActionNode"
>          uri="/actions">
>         </objectnode>
>
>       </objectnode>
>
>     </data>
>
> are all the object nodes like "/" , "/actions"  ,"/users" and their
> properties,permissions etc automatically inserted into the appropriate
store
> or should an application have to call structure.create() methods to
> explicitly make entries for them in the store

Yes, the data is entered into the store(s), but it will stop as soon as it
finds a node which exists.

I don't like it very much that way, and I plan to change it to : make sure
the namespace has these nodes (with the specified properties). I think it
would be a more useful and predictable mechanism.

Remy


RE: JDBC issue?

Posted by rajkumar <ko...@intalio.com>.
hi,
   When a domain.xml file is read by the application and the namespace is
initilaized is all the node information from the <data> element taken and
inserted into the appropriate store.For example if the domain.xml file has
entries as follows

 <data>

      <objectnode classname="org.apache.slide.structure.SubjectNode"
uri="/">

        <permission action="/actions" subject="/users/root"/>

        <!-- /users represents the unauthenticated user -->

        <objectnode classname="org.apache.slide.structure.SubjectNode"
         uri="/users">

          <!-- /users/root represents the administrator -->

          <objectnode classname="org.apache.slide.structure.SubjectNode"
           uri="/users/root">
          </objectnode>

          <!-- /users/guest represents an authenticated guest user -->

          <objectnode classname="org.apache.slide.structure.SubjectNode"
           uri="/users/guest">
          </objectnode>

        </objectnode>

        <objectnode classname="org.apache.slide.structure.ActionNode"
         uri="/actions">
        </objectnode>

      </objectnode>

    </data>

are all the object nodes like "/" , "/actions"  ,"/users" and their
properties,permissions etc automatically inserted into the appropriate store
or should an application have to call structure.create() methods to
explicitly make entries for them in the store

    rajkumar

-----Original Message-----
From: Remy Maucherat [mailto:remm@apache.org]
Sent: Friday, June 22, 2001 11:03 AM
To: slide-user@jakarta.apache.org
Subject: Re: JDBC issue?


> hi,
> Where can i find the source file for WebdavClient class .I am not able to
> locate it in the repository.

I've renamed it HttpClient and moved it to the jakarta-commons project. I
hope it didn't cause too much trouble ...

Remy


Re: JDBC issue?

Posted by Remy Maucherat <re...@apache.org>.
> hi,
> Where can i find the source file for WebdavClient class .I am not able to
> locate it in the repository.

I've renamed it HttpClient and moved it to the jakarta-commons project. I
hope it didn't cause too much trouble ...

Remy


RE: JDBC issue?

Posted by rajkumar <ko...@intalio.com>.
hi,
Where can i find the source file for WebdavClient class .I am not able to
locate it in the repository.
  rajkumar

-----Original Message-----
From: Remy Maucherat [mailto:remm@apache.org]
Sent: Tuesday, June 19, 2001 11:43 PM
To: slide-user@jakarta.apache.org
Subject: Re: JDBC issue?


> Alexander Demidovich wrote:
> >
> > I've installed Slide with Mysql (3.22) as Descriptor and Content Store.
> >
> > Addind to ACL works file but not deleting entries from the one.
> > When I'm deleting some ACL entry it goes out and WEBDAV servlet doesn't
> > show it - no problem. But after I restart Tomcat this deleted entry is
> > restored!
> >
> > I've investigated the code a little bit.
> > Here is sql query:
> > "delete from permissions where object= ? and revisionnumber = ? and
subject
> > = ? and action = ?"
> >
> > I'm not sure, but may be, if the revisionnumber is NULL this SQL must
> > contain something like this:
> >
> >         ... and revisionnumber is NULL and ....
>
> Thanks a lot for this bug report - a completely different problem with
> the same
> cause bit me today, so it made it a lot easier to track down. I've
> committed the
> suggested fix, since Remy didn't. It works for me (this allows a new
> repository
> to be created successfully with the JDBCDescriptorStore without the
> global
> temporary permission remaining).

Thanks a lot, Michael.
I didn't commit the patch because I didn't have the opportunity to test it,
and Tomcat 4 had been keeping me very busy.

Remy


Re: JDBC issue?

Posted by Remy Maucherat <re...@apache.org>.
> Alexander Demidovich wrote:
> >
> > I've installed Slide with Mysql (3.22) as Descriptor and Content Store.
> >
> > Addind to ACL works file but not deleting entries from the one.
> > When I'm deleting some ACL entry it goes out and WEBDAV servlet doesn't
> > show it - no problem. But after I restart Tomcat this deleted entry is
> > restored!
> >
> > I've investigated the code a little bit.
> > Here is sql query:
> > "delete from permissions where object= ? and revisionnumber = ? and
subject
> > = ? and action = ?"
> >
> > I'm not sure, but may be, if the revisionnumber is NULL this SQL must
> > contain something like this:
> >
> >         ... and revisionnumber is NULL and ....
>
> Thanks a lot for this bug report - a completely different problem with
> the same
> cause bit me today, so it made it a lot easier to track down. I've
> committed the
> suggested fix, since Remy didn't. It works for me (this allows a new
> repository
> to be created successfully with the JDBCDescriptorStore without the
> global
> temporary permission remaining).

Thanks a lot, Michael.
I didn't commit the patch because I didn't have the opportunity to test it,
and Tomcat 4 had been keeping me very busy.

Remy


Re: JDBC issue?

Posted by Michael Smith <ms...@xn.com.au>.
Alexander Demidovich wrote:
> 
> I've installed Slide with Mysql (3.22) as Descriptor and Content Store.
> 
> Addind to ACL works file but not deleting entries from the one.
> When I'm deleting some ACL entry it goes out and WEBDAV servlet doesn't
> show it - no problem. But after I restart Tomcat this deleted entry is
> restored!
> 
> I've investigated the code a little bit.
> Here is sql query:
> "delete from permissions where object= ? and revisionnumber = ? and subject
> = ? and action = ?"
> 
> I'm not sure, but may be, if the revisionnumber is NULL this SQL must
> contain something like this:
> 
>         ... and revisionnumber is NULL and ....

Thanks a lot for this bug report - a completely different problem with
the same
cause bit me today, so it made it a lot easier to track down. I've
committed the
suggested fix, since Remy didn't. It works for me (this allows a new
repository
to be created successfully with the JDBCDescriptorStore without the
global 
temporary permission remaining).

Michael

Re: JDBC issue?

Posted by Remy Maucherat <re...@apache.org>.
> I've installed Slide with Mysql (3.22) as Descriptor and Content Store.
>
> Addind to ACL works file but not deleting entries from the one.
> When I'm deleting some ACL entry it goes out and WEBDAV servlet doesn't
> show it - no problem. But after I restart Tomcat this deleted entry is
> restored!
>
> I've investigated the code a little bit.
> Here is sql query:
> "delete from permissions where object= ? and revisionnumber = ? and
subject
> = ? and action = ?"
>
> I'm not sure, but may be, if the revisionnumber is NULL this SQL must
> contain something like this:
>
> ... and revisionnumber is NULL and ....

Yes, I'll apply the patch.

Thanks !

Remy