topolik / FSRepo

Documents & Media repository for accessing local file system
13 stars 13 forks source link

Folder/Subfolder creation throws exception #10

Closed claidlaw closed 11 years ago

claidlaw commented 11 years ago

Hi, first thank you for putting out a much needed feature for Liferay.

I am hitting an issue when attempting to add nested subfolders under a FSRepo area.

From within the FSRepo object I can Add a new subfolder just fine.

Navigating into that new subfolder I am presented with the option to Add a Folder instead of adding another Subfolder. When I click to add the folder I receive the dump shown below. I'm not a LR expert but I'm guessing you can only Add new subfolders under a subfolder. Folders are only available at the top level of an object.

Hopefully this is a fix that can make it in to 1.3.

Thank you again for your work on this product. If you need more information please contact me at craig.laidlaw@dominos.com

Craig

15:45:15,133 ERROR [http-bio-8080-exec-142][render_portlet_jsp:154] com.liferay.portal.kernel.repository.RepositoryException: No Repository exists with the primary key 0 at com.liferay.portal.service.impl.RepositoryServiceImpl.checkRepository(RepositoryServiceImpl.java:73) at com.liferay.portal.service.impl.RepositoryServiceImpl.getRepositoryImpl(RepositoryServiceImpl.java:121) at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:122) at com.liferay.portal.spring.transaction.TransactionInterceptor.invoke(TransactionInterceptor.java:71) at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:118) at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:57) at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:118) at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:57) at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:118) at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:57) at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:118) at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:57) at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:118) at com.liferay.portal.spring.aop.ServiceBeanAopProxy.invoke(ServiceBeanAopProxy.java:211) at com.liferay.portlet.documentlibrary.service.impl.DLAppServiceImpl.getRepository(DLAppServiceImpl.java:2689) at com.liferay.portlet.documentlibrary.service.impl.DLAppServiceImpl.addFolder(DLAppServiceImpl.java:310) at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:122) at com.liferay.portal.spring.transaction.TransactionInterceptor.invoke(TransactionInterceptor.java:71) at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:118) at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:57)

topolik commented 11 years ago

Hi Craig

Thank you, I try to reproduce it. Is it possible for you to post the full stacktrace?

claidlaw commented 11 years ago

Hi Tomas,

To be fair I went to reproduce the issue on a clean 6.1eeGA2 bundle and I’m now getting different results. I can’t see the Add subfolder option under a previously created subfolder.

On the clean bundle with FERepo 1.2 I added a new FSRepo (named test fsrepo).

Next I add a subfolder to the repository and then click into that new subfolder (named latest subfolder).

In “latest subfolder” there is no option to add another subfolder (see screen shots).

I am logged into the clean bundle with the test@liferay.commailto:test@liferay.com admin account so it shouldn’t be a permission issue.

I created the repository and the test subfolder with guest view permission and site level Add Subfolder.

I’ll get you more info Monday on my full system and the original problem I reported. Figured you want to see this first.

Thank you, Craig

[cid:image005.jpg@01CE4D9E.7B1C0B10]

[cid:image006.jpg@01CE4D9E.7B1C0B10]

From: Tomáš Polešovský [mailto:notifications@github.com] Sent: Friday, May 10, 2013 12:33 PM To: topolik/FSRepo Cc: Craig Laidlaw (IS - Pulse Dev) Subject: Re: [FSRepo] Folder/Subfolder creation throws exception (#10)

Hi Craig

Thank you, I try to reproduce it. Is it possible for you to post the full stacktrace?

— Reply to this email directly or view it on GitHubhttps://github.com/topolik/FSRepo/issues/10#issuecomment-17730485.

topolik commented 11 years ago

Hi Craig, thanks for the report on the 2nd issue - "no subfolder button".

Github cannot handle images in emails :( Anyway, I fixed that. It seems that portal is checking a wrong permission when displaying that button (ADD_FOLDER instead of ADD_SUBFOLDER). Tell me if you can't build the project yourself, I send you compiled binary.

I can't help you with the "No Repository exists with the primary key 0" issue until you send me the full stacktrace. As now it seems there is some problem I'm not able to solve - portal is providing repositoryId=0 when calling DLAppServiceImpl.addFolder(). I believe there should be some earlier problem that is forcing portal to send 0, instead of correct repositoryId. It would help me if you look into logs for some previous exceptions as well.

Thank you!

claidlaw commented 11 years ago

Hello Tomas,

If you wouldn’t mind zipping up the .war and sending it to me that would be terrific. I haven’t downloaded/built from Github before.

What I’d like to do is try your patched version on my development environment that was throwing the bizarre repositoryId=0 error and see if that changes behavior.

I’ll definitely let you know what I find.

Thank you. Craig

From: Tomáš Polešovský [mailto:notifications@github.com] Sent: Monday, May 13, 2013 8:40 AM To: topolik/FSRepo Cc: Craig Laidlaw (IS - Pulse Dev) Subject: Re: [FSRepo] Folder/Subfolder creation throws exception (#10)

Hi Craig, thanks for the report on the 2nd issue - "no subfolder button".

Github cannot handle images in emails :( Anyway, I fixed that. It seems that portal is checking a wrong permission when displaying that button (ADD_FOLDER instead of ADD_SUBFOLDER). Tell me if you can't build the project yourself, I send you compiled binary.

I can't help you with the "No Repository exists with the primary key 0" issue until you send me the full stacktrace. As now it seems there is some problem I'm not able to solve - portal is providing repositoryId=0 when calling DLAppServiceImpl.addFolder(). I believe there should be some earlier problem that is forcing portal to send 0, instead of correct repositoryId. It would help me if you look into logs for some previous exceptions as well.

Thank you!

— Reply to this email directly or view it on GitHubhttps://github.com/topolik/FSRepo/issues/10#issuecomment-17808912.

topolik commented 11 years ago

Hi Craig, here it is: http://db.tt/3zkzW1kH

Thank you for testing this!

Best, -- tom +

claidlaw commented 11 years ago

Hello Tom,

Great news, after a little cleaning up (clearing out temp and work) the new .war works great in both the clean bundle and the development area where I originally had issues.

I have attached a rather long word document with stack dumps and screen shots but the gist of the message is that after I deployed the new hook and went into Docs and Media I received a stack dump and the Docs and Media screen was corrupt. I shutdown tomcat, cleaned out temp and work, restarted tomcat, and the FSREPO worked great. I was able to add subfolders throughout the repository. I received this same behavior on both of my environments.

Later today I will deploy this out to our staging area and take a look there. I will let you know if I hit any other issues.

Thank you so much for being so responsive to my issue.

Craig

From: Tomáš Polešovský [mailto:notifications@github.com] Sent: Monday, May 13, 2013 3:37 PM To: topolik/FSRepo Cc: Craig Laidlaw (IS - Pulse Dev) Subject: Re: [FSRepo] Folder/Subfolder creation throws exception (#10)

Hi Craig, here it is: http://db.tt/3zkzW1kH

Thank you for testing this!

Best, -- tom +

— Reply to this email directly or view it on GitHubhttps://github.com/topolik/FSRepo/issues/10#issuecomment-17835230.

topolik commented 11 years ago

Hi Craig,

good to hear.

Yes, after deploy you need to restart Tomcat. It's a bug in Liferay, it still keeps an instance of the old hook and only restart helps. Liferay then initialize the repository with the new version of the plugin.

I close the issue as it seems to be solved.

Thank you!

-- tom +