Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NPE in picture preview #6

Closed
McAviti opened this issue May 6, 2012 · 10 comments
Closed

NPE in picture preview #6

McAviti opened this issue May 6, 2012 · 10 comments

Comments

@McAviti
Copy link
Contributor

McAviti commented May 6, 2012

Sorry for raising an issue, but there is no forum here, and I do not know how to ask otherwise.

I have the latest source and deployed it to the local tomcat. But when opening a media gallery I see the following errors (one for each graphics file) in the log:

03:04:33,251 INFO [PortalImpl:4873] Current URL /documents/26389/26390/g3.jpg?version=1.0&t=1160233067000&imageThumbnail=1 generates exception: null

Unfortunaetly I have not stack trace in the log.

Do you use Eclipse for the Hook development? Can you possibly direct me to a site where it is described how to create a Eclipse project for a hook for an existing project? The Liferay Eclipse plug-in refuses to create a new project from my local git repo, saying that the directory is "wrong". If I can get that to work it would be nice to remote debug the tomcat process, maybe.

Sorry for the beginners questions, I am not yet familiar with Liferay, git and Maven... :)

~klemens

@topolik
Copy link
Owner

topolik commented May 6, 2012

Hi Klemens,

in Eclipse open it as a maven project.

Btw. very similar error I've fixed in 5e5cb5a#diff-1 Are you sure you have the latest sources deployed?

Thanks

-- tom

@McAviti
Copy link
Contributor Author

McAviti commented May 6, 2012

No, I am not sure. :)

What I did:
.) cloned the github repo (doing it from scratch today again)
.) edited the pom.xml, set correct <liferay.auto.deploy.dir>
.) command line: "mvn clean package liferay:deploy" produced a "BUILD SUCCESSFUL"
.) started up tomcat with debug settings
.) connected Eclipse with remote debug setting
.) set a breakpoint at the class mentioned before in the catalina.out (PortalImpl.java of the Liferay sources, line 4873, method sendError)
.) In the stack I see no trace of the hook plug-in (I think that would start with cz. ... )
Daemon Thread [http-bio-8080-exec-1](Suspended %28breakpoint at line 4873 in com.liferay.portal.util.PortalImpl%29)
com.liferay.portal.util.PortalImpl.sendError(int, java.lang.Exception, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) line: 4873
com.liferay.portal.util.PortalUtil.sendError(int, java.lang.Exception, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) line: 1511
com.liferay.portal.servlet.FriendlyURLServlet.service(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) line: 109
com.liferay.portal.servlet.FriendlyURLServlet(javax.servlet.http.HttpServlet).service(javax.servlet.ServletRequest, javax.servlet.ServletResponse) line: 722
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(javax.servlet.ServletRequest, javax.servlet.ServletResponse) line: 305
org.apache.catalina.core.ApplicationFilterChain.doFilter(javax.servlet.ServletRequest, javax.servlet.ServletResponse) line: 210
com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(javax.servlet.ServletRequest, javax.servlet.ServletResponse) line: 72
com.liferay.portal.servlet.filters.strip.StripFilter(com.liferay.portal.kernel.servlet.BaseFilter).processFilter(java.lang.Class, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, javax.servlet.FilterChain) line: 121 com.liferay.portal.servlet.filters.strip.StripFilter.processFilter(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, javax.servlet.FilterChain) line: 304 com.liferay.portal.servlet.filters.strip.StripFilter(com.liferay.portal.kernel.servlet.BaseFilter).doFilter(javax.servlet.ServletRequest, javax.servlet.ServletResponse, javax.servlet.FilterChain) line: 48 com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(javax.servlet.Filter, javax.servlet.ServletRequest, javax.servlet.ServletResponse) line: 203 com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(javax.servlet.ServletRequest, javax.servlet.ServletResponse) line: 105 com.liferay.portal.servlet.filters.gzip.GZipFilter(com.liferay.portal.kernel.servlet.BaseFilter).processFilter(java.lang.Class, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, javax.servlet.FilterChain) line: 121
com.liferay.portal.servlet.filters.gzip.GZipFilter.processFilter(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, javax.servlet.FilterChain) line: 123
com.liferay.portal.servlet.filters.gzip.GZipFilter(com.liferay.portal.kernel.servlet.BaseFilter).doFilter(javax.servlet.ServletRequest, javax.servlet.ServletResponse, javax.servlet.FilterChain) line: 48
com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(javax.servlet.Filter, javax.servlet.ServletRequest, javax.servlet.ServletResponse) line: 203
com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(javax.servlet.ServletRequest, javax.servlet.ServletResponse) line: 105
com.liferay.portal.servlet.filters.secure.SecureFilter(com.liferay.portal.kernel.servlet.BaseFilter).processFilter(java.lang.Class, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, javax.servlet.FilterChain) line: 121 com.liferay.portal.servlet.filters.secure.SecureFilter.processFilter(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, javax.servlet.FilterChain) line: 201 com.liferay.portal.servlet.filters.secure.SecureFilter(com.liferay.portal.kernel.servlet.BaseFilter).doFilter(javax.servlet.ServletRequest, javax.servlet.ServletResponse, javax.servlet.FilterChain) line: 48 com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(javax.servlet.Filter, javax.servlet.ServletRequest, javax.servlet.ServletResponse) line: 203 com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(javax.servlet.ServletRequest, javax.servlet.ServletResponse) line: 105 com.liferay.portal.servlet.filters.i18n.I18nFilter(com.liferay.portal.kernel.servlet.BaseFilter).processFilter(java.lang.Class, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, javax.servlet.FilterChain) line: 121
com.liferay.portal.servlet.filters.i18n.I18nFilter.processFilter(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, javax.servlet.FilterChain) line: 241
com.liferay.portal.servlet.filters.i18n.I18nFilter(com.liferay.portal.kernel.servlet.BaseFilter).doFilter(javax.servlet.ServletRequest, javax.servlet.ServletResponse, javax.servlet.FilterChain) line: 48
com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(javax.servlet.Filter, javax.servlet.ServletRequest, javax.servlet.ServletResponse) line: 203
com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(javax.servlet.ServletRequest, javax.servlet.ServletResponse) line: 105
com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(javax.servlet.ServletRequest, javax.servlet.ServletResponse) line: 113
com.liferay.portal.servlet.filters.etag.ETagFilter(com.liferay.portal.kernel.servlet.BaseFilter).processFilter(java.lang.Class, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, javax.servlet.FilterChain) line: 121 com.liferay.portal.servlet.filters.etag.ETagFilter.processFilter(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, javax.servlet.FilterChain) line: 55 com.liferay.portal.servlet.filters.etag.ETagFilter(com.liferay.portal.kernel.servlet.BaseFilter).doFilter(javax.servlet.ServletRequest, javax.servlet.ServletResponse, javax.servlet.FilterChain) line: 48 com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(javax.servlet.Filter, javax.servlet.ServletRequest, javax.servlet.ServletResponse) line: 203 com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(javax.servlet.ServletRequest, javax.servlet.ServletResponse) line: 105 com.liferay.portal.servlet.filters.autologin.AutoLoginFilter(com.liferay.portal.kernel.servlet.BaseFilter).processFilter(java.lang.Class, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, javax.servlet.FilterChain) line: 121
com.liferay.portal.servlet.filters.autologin.AutoLoginFilter.processFilter(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, javax.servlet.FilterChain) line: 240
com.liferay.portal.servlet.filters.autologin.AutoLoginFilter(com.liferay.portal.kernel.servlet.BaseFilter).doFilter(javax.servlet.ServletRequest, javax.servlet.ServletResponse, javax.servlet.FilterChain) line: 48
com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(javax.servlet.Filter, javax.servlet.ServletRequest, javax.servlet.ServletResponse) line: 203
com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(javax.servlet.ServletRequest, javax.servlet.ServletResponse) line: 105
com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilter.doFilter(javax.servlet.ServletRequest, javax.servlet.ServletResponse, javax.servlet.FilterChain) line: 70
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(javax.servlet.ServletRequest, javax.servlet.ServletResponse) line: 243
org.apache.catalina.core.ApplicationFilterChain.doFilter(javax.servlet.ServletRequest, javax.servlet.ServletResponse) line: 210
org.apache.catalina.core.ApplicationDispatcher.invoke(javax.servlet.ServletRequest, javax.servlet.ServletResponse, org.apache.catalina.core.ApplicationDispatcher$State) line: 684
org.apache.catalina.core.ApplicationDispatcher.processRequest(javax.servlet.ServletRequest, javax.servlet.ServletResponse, org.apache.catalina.core.ApplicationDispatcher$State) line: 471
org.apache.catalina.core.ApplicationDispatcher.doForward(javax.servlet.ServletRequest, javax.servlet.ServletResponse) line: 402
org.apache.catalina.core.ApplicationDispatcher.forward(javax.servlet.ServletRequest, javax.servlet.ServletResponse) line: 329
com.liferay.portal.servlet.filters.virtualhost.VirtualHostFilter.processFilter(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, javax.servlet.FilterChain) line: 298
com.liferay.portal.servlet.filters.virtualhost.VirtualHostFilter(com.liferay.portal.kernel.servlet.BaseFilter).doFilter(javax.servlet.ServletRequest, javax.servlet.ServletResponse, javax.servlet.FilterChain) line: 48
com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(javax.servlet.Filter, javax.servlet.ServletRequest, javax.servlet.ServletResponse) line: 203
com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(javax.servlet.ServletRequest, javax.servlet.ServletResponse) line: 105
com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDirectCallFilter(javax.servlet.Filter, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) line: 184
com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(javax.servlet.ServletRequest, javax.servlet.ServletResponse) line: 92
org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(javax.servlet.ServletRequest, javax.servlet.ServletResponse, javax.servlet.FilterChain) line: 738
com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(javax.servlet.Filter, javax.servlet.ServletRequest, javax.servlet.ServletResponse) line: 203
com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(javax.servlet.ServletRequest, javax.servlet.ServletResponse) line: 105
com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDirectCallFilter(javax.servlet.Filter, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) line: 164
com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(javax.servlet.ServletRequest, javax.servlet.ServletResponse) line: 92
com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDirectCallFilter(javax.servlet.Filter, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) line: 164
com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(javax.servlet.ServletRequest, javax.servlet.ServletResponse) line: 92
com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDirectCallFilter(javax.servlet.Filter, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) line: 184
com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(javax.servlet.ServletRequest, javax.servlet.ServletResponse) line: 92
com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilter.doFilter(javax.servlet.ServletRequest, javax.servlet.ServletResponse, javax.servlet.FilterChain) line: 70
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(javax.servlet.ServletRequest, javax.servlet.ServletResponse) line: 243
org.apache.catalina.core.ApplicationFilterChain.doFilter(javax.servlet.ServletRequest, javax.servlet.ServletResponse) line: 210
org.apache.catalina.core.StandardWrapperValve.invoke(org.apache.catalina.connector.Request, org.apache.catalina.connector.Response) line: 224
org.apache.catalina.core.StandardContextValve.invoke(org.apache.catalina.connector.Request, org.apache.catalina.connector.Response) line: 169
org.apache.catalina.authenticator.FormAuthenticator(org.apache.catalina.authenticator.AuthenticatorBase).invoke(org.apache.catalina.connector.Request, org.apache.catalina.connector.Response) line: 472
org.apache.catalina.core.StandardHostValve.invoke(org.apache.catalina.connector.Request, org.apache.catalina.connector.Response) line: 168
org.apache.catalina.valves.ErrorReportValve.invoke(org.apache.catalina.connector.Request, org.apache.catalina.connector.Response) line: 98
org.apache.catalina.valves.AccessLogValve.invoke(org.apache.catalina.connector.Request, org.apache.catalina.connector.Response) line: 928
org.apache.catalina.core.StandardEngineValve.invoke(org.apache.catalina.connector.Request, org.apache.catalina.connector.Response) line: 118
org.apache.catalina.connector.CoyoteAdapter.service(org.apache.coyote.Request, org.apache.coyote.Response) line: 407
org.apache.coyote.http11.Http11Processor(org.apache.coyote.http11.AbstractHttp11Processor).process(org.apache.tomcat.util.net.SocketWrapper) line: 987
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler(org.apache.coyote.AbstractProtocol$AbstractConnectionHandler<S,P>).process(org.apache.tomcat.util.net.SocketWrapper, org.apache.tomcat.util.net.SocketStatus) line: 539
org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run() line: 300
org.apache.tomcat.util.threads.ThreadPoolExecutor(java.util.concurrent.ThreadPoolExecutor).runWorker(java.util.concurrent.ThreadPoolExecutor$Worker) line: 1110
java.util.concurrent.ThreadPoolExecutor$Worker.run() line: 603
org.apache.tomcat.util.threads.TaskThread(java.lang.Thread).run() line: 679

So, I am not sure if the plug-in is really up-to-date in the tomcat installation. Have you an idea how I can check this?

thanks and bye,
~klemens

Another little detail: I had to install the maven extension "JRebel m2eclipse integration" that is used by fsrepo - maybe would be nice to mention this in the readme

@topolik
Copy link
Owner

topolik commented May 6, 2012

Yeah, the jRebel - I use it for debugging :) I'm surprised that you have to install the plugin into Eclipse to make it work.

To be 100% sure:
1, start Liferay
2, delete repository from your Liferay instance
3, delete folder(s) tomcat/webapps/fsrepo-hook*
4, shutdown tomcat
5, start Liferay
6, install fsrepo-hook (mvn clean package liferay:deploy)
7, see the logs that it was installed
8, create again repository

Then try to see if the error is still there & debug it in this case.

From the stacktrace I presume that it tries to load file from the WebServlet in the VirtualHostFilter, which ends with NPE.

Can you try it and get back to me with the result?

Thank you!!!!

-- tom

@McAviti
Copy link
Contributor Author

McAviti commented May 7, 2012

Ahoj Tom

.) I followed your procedure and think I found out something:

First, the first access to a folder creates a listing of "neutral"
place-holder thumbnails, the second then produces the real output.
Could it be that there is some lazy initialization that produces a
default pic at the first access?

Second, I still have the NPE but I can now see under what circumstances:
The repo was created with no defaul access (false, false in the
dialogue), so the files should not be public accessible when not
declared otherwise. In that case I again get the error message
23:43:39,864 INFO [PortalImpl:4873] Current URL
/documents/38503/38752/014.JPG?version=1.0&t=947263062000&imageThumbnail=1
generates exception: null

But when I grant view rights for "Guest" and "Site Member" (to both
file and containing folder) I can see the thumbnail in the "Documents
and Media" view of the control panel.

.) I also found the reason of my faulty tomcat deploy routine - silly
me (will write an answer to the other issue)

.) May I ask you one other question: I'd like to have a finde-grained
accessability rights system in the gallery. Do have an idea how to set
rights on many files or the content of a folder? There seems to be no
such mechanism in Liferay to select multiple files in a repo and set
permissions to all. Is this feasible directly in the database or maybe
to error-prone and complicated (due to expando?)

I'll call it a day now, but can do some debugging tomorrow. :)

thanks for the support,
~klemens

On Sun, May 6, 2012 at 3:51 PM, Tomáš Polešovský
reply@reply.github.com
wrote:

Yeah, the jRebel - I use it for debugging :) I'm surprised that you have to install the plugin into Eclipse to make it work.

To be 100% sure:
1, start Liferay
2, delete repository from your Liferay instance
3, delete folder(s) tomcat/webapps/fsrepo-hook*
4, shutdown tomcat
5, start Liferay
6, install fsrepo-hook (mvn clean package liferay:deploy)
7, see the logs that it was installed
8, create again repository

Then try to see if the error is still there & debug it in this case.

From the stacktrace I presume that it tries to load file from the WebServlet in the VirtualHostFilter, which ends with NPE.

Can you try it and get back to me with the result?

Thank you!!!!

-- tom


Reply to this email directly or view it on GitHub:
#6 (comment)

@topolik
Copy link
Owner

topolik commented May 7, 2012

Ahoj :)

Thank you for the investigation. I've found the bug with thumbnails - it's calling default LocalRepository implementation and I don't care about local calls. Now it should be fixed - 1fe0c47

The other question - bulk permissions settings - there is currently no UI for this in the portal. But. You could use ACCESS permission in the Document Library & permissions.view.dynamic.inheritance in portal.properties ( https://github.com/liferay/liferay-portal/blob/6.1.0-ga1/portal-impl/src/portal.properties#L3536). The sad think here is that I haven't implemented it yet. So you can't use it right now. But using this you can then easily set at least VIEW permission hierarchically - in a tree.

@topolik topolik closed this as completed May 7, 2012
@ghost
Copy link

ghost commented May 16, 2012

When I apply your fix for the issue I have report (Fixing NPE when PermissionChecker is not initialized) image thumbnail and preview work good but now after apply the fix about this issue, some thumbnails and preview stop working, and I receive error of this kind:

13:13:39,685 INFO [PortalImpl:4873] Current URL /documents/127897/127924/GECAD1280x1024.bmp?version=1.0&t=1146137985519&imageThumbnail=1 generates exception: null

The images in repository main folder work, but if they are in a sub-folder don´t work.

EDIT: I replaced LocalFileSystemPermissionsUtil.java with the old code and now is working, something you have change broke this.

And about a thing McAviti have said:

"First, the first access to a folder creates a listing of "neutral"
place-holder thumbnails, the second then produces the real output.
Could it be that there is some lazy initialization that produces a
default pic at the first access?"

I like that too, because is annoying do constantly refresh to load all images thumbnails.

@McAviti
Copy link
Contributor Author

McAviti commented May 17, 2012

Ahoj

I debugged a little into the thing and found the following:
There are two Exceptions happening, the first - original one - in the
ExpandoService (seems to be injected by Spring or some other injection
mechanism). The line calling Expando is ExpandoValueServiceUtil.java

in a getData(..) method, line 75:

    return getService()
               .getData(companyId, className, tableName, columnName, classPK);

In the Expando Proxy class the following Exception is being thrown:

com.liferay.portal.security.auth.PrincipalException: PermissionChecker

not initialized

The stack trace there is:

Daemon Thread http-bio-8080-exec-7
com.liferay.portlet.expando.model.impl.ExpandoBridgeImpl.getAttribute(java.lang.String,
boolean) line: 178
com.liferay.portlet.expando.model.impl.ExpandoBridgeImpl.getAttribute(java.lang.String)
line: 159
cz.topolik.fsrepo.LocalFileSystemRepository.getFileFromExpando(com.liferay.portal.model.RepositoryEntry)
line: 914
cz.topolik.fsrepo.LocalFileSystemRepository.getFileFromRepositoryEntry(com.liferay.portal.model.RepositoryEntry)
line: 901
cz.topolik.fsrepo.LocalFileSystemRepository.folderIdToFile(long) line: 875
cz.topolik.fsrepo.LocalFileSystemRepository.getFileEntry(long,
java.lang.String) line: 405
cz.topolik.fsrepo.LocalFileSystemLocalRepository.getFileEntry(long,
java.lang.String) line: 73
sun.reflect.GeneratedMethodAccessor691.invoke(java.lang.Object,
java.lang.Object[]) line: not available
sun.reflect.DelegatingMethodAccessorImpl.invoke(java.lang.Object,
java.lang.Object[]) line: 25
java.lang.reflect.Method.invoke(java.lang.Object,
java.lang.Object...) line: 597
com.liferay.portal.kernel.bean.ClassLoaderBeanHandler.invoke(java.lang.Object,
java.lang.reflect.Method, java.lang.Object[]) line: 54
$Proxy524.getFileEntry(long, java.lang.String) line: not available
com.liferay.portal.repository.proxy.LocalRepositoryProxyBean.getFileEntry(long,
java.lang.String) line: 140
com.liferay.portlet.documentlibrary.service.impl.DLAppLocalServiceImpl.getFileEntry(long,
long, java.lang.String) line: 620
sun.reflect.GeneratedMethodAccessor688.invoke(java.lang.Object,
java.lang.Object[]) line: not available
sun.reflect.DelegatingMethodAccessorImpl.invoke(java.lang.Object,
java.lang.Object[]) line: 25
java.lang.reflect.Method.invoke(java.lang.Object,
java.lang.Object...) line: 597
com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed() line: 112
com.liferay.portal.spring.transaction.TransactionInterceptor.invoke(org.aopalliance.intercept.MethodInvocation)
line: 71
com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed() line: 108
com.liferay.portal.cache.ThreadLocalCacheAdvice(com.liferay.portal.spring.aop.ChainableMethodAdvice).invoke(org.aopalliance.intercept.MethodInvocation)
line: 59
com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed() line: 108
com.liferay.portal.messaging.async.AsyncAdvice(com.liferay.portal.spring.aop.ChainableMethodAdvice).invoke(org.aopalliance.intercept.MethodInvocation)
line: 59
com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed() line: 108
com.liferay.portal.spring.aop.ServiceBeanAopProxy.invoke(java.lang.Object,
java.lang.reflect.Method, java.lang.Object[]) line: 211
$Proxy179.getFileEntry(long, long, java.lang.String) line: not available
com.liferay.portlet.documentlibrary.service.DLAppLocalServiceUtil.getFileEntry(long,
long, java.lang.String) line: 556
com.liferay.portal.webserver.WebServerServlet._checkFileEntry(java.lang.String[])
line: 1084
com.liferay.portal.webserver.WebServerServlet.hasFiles(javax.servlet.http.HttpServletRequest)
line: 139
com.liferay.portal.servlet.filters.virtualhost.VirtualHostFilter.processFilter(javax.servlet.http.HttpServletRequest,
javax.servlet.http.HttpServletResponse, javax.servlet.FilterChain)
line: 214
com.liferay.portal.servlet.filters.virtualhost.VirtualHostFilter(com.liferay.portal.kernel.servlet.BaseFilter).doFilter(javax.servlet.ServletRequest,
javax.servlet.ServletResponse, javax.servlet.FilterChain) line: 48
com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(javax.servlet.Filter,
javax.servlet.ServletRequest, javax.servlet.ServletResponse) line: 203
com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(javax.servlet.ServletRequest,
javax.servlet.ServletResponse) line: 105
com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDirectCallFilter(javax.servlet.Filter,
javax.servlet.http.HttpServletRequest,
javax.servlet.http.HttpServletResponse) line: 184
com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(javax.servlet.ServletRequest,
javax.servlet.ServletResponse) line: 92
org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(javax.servlet.ServletRequest,
javax.servlet.ServletResponse, javax.servlet.FilterChain) line: 738
com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(javax.servlet.Filter,
javax.servlet.ServletRequest, javax.servlet.ServletResponse) line: 203
com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(javax.servlet.ServletRequest,
javax.servlet.ServletResponse) line: 105
com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDirectCallFilter(javax.servlet.Filter,
javax.servlet.http.HttpServletRequest,
javax.servlet.http.HttpServletResponse) line: 164
com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(javax.servlet.ServletRequest,
javax.servlet.ServletResponse) line: 92
com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDirectCallFilter(javax.servlet.Filter,
javax.servlet.http.HttpServletRequest,
javax.servlet.http.HttpServletResponse) line: 164
com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(javax.servlet.ServletRequest,
javax.servlet.ServletResponse) line: 92
com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDirectCallFilter(javax.servlet.Filter,
javax.servlet.http.HttpServletRequest,
javax.servlet.http.HttpServletResponse) line: 184
com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(javax.servlet.ServletRequest,
javax.servlet.ServletResponse) line: 92
com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilter.doFilter(javax.servlet.ServletRequest,
javax.servlet.ServletResponse, javax.servlet.FilterChain) line: 70
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(javax.servlet.ServletRequest,
javax.servlet.ServletResponse) line: 243
org.apache.catalina.core.ApplicationFilterChain.doFilter(javax.servlet.ServletRequest,
javax.servlet.ServletResponse) line: 210
org.apache.catalina.core.StandardWrapperValve.invoke(org.apache.catalina.connector.Request,
org.apache.catalina.connector.Response) line: 224
org.apache.catalina.core.StandardContextValve.invoke(org.apache.catalina.connector.Request,
org.apache.catalina.connector.Response) line: 169
org.apache.catalina.authenticator.FormAuthenticator(org.apache.catalina.authenticator.AuthenticatorBase).invoke(org.apache.catalina.connector.Request,
org.apache.catalina.connector.Response) line: 472
org.apache.catalina.core.StandardHostValve.invoke(org.apache.catalina.connector.Request,
org.apache.catalina.connector.Response) line: 168
org.apache.catalina.valves.ErrorReportValve.invoke(org.apache.catalina.connector.Request,
org.apache.catalina.connector.Response) line: 98
org.apache.catalina.valves.AccessLogValve.invoke(org.apache.catalina.connector.Request,
org.apache.catalina.connector.Response) line: 928
org.apache.catalina.core.StandardEngineValve.invoke(org.apache.catalina.connector.Request,
org.apache.catalina.connector.Response) line: 118
org.apache.catalina.connector.CoyoteAdapter.service(org.apache.coyote.Request,
org.apache.coyote.Response) line: 407
org.apache.coyote.http11.Http11Processor(org.apache.coyote.http11.AbstractHttp11Processor).process(org.apache.tomcat.util.net.SocketWrapper)
line: 987
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler(org.apache.coyote.AbstractProtocol$AbstractConnectionHandler<S,P>).process(org.apache.tomcat.util.net.SocketWrapper,
org.apache.tomcat.util.net.SocketStatus) line: 539
org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run() line: 300
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(java.lang.Runnable)
line: 886
java.util.concurrent.ThreadPoolExecutor$Worker.run() line: 908

org.apache.tomcat.util.threads.TaskThread(java.lang.Thread).run() line: 662

Then in this class (ExpandoBridgeImpl, line 177) the Exception is
cought, logged but not handled any further. We teach our developers
that this is bad style in most cases... ;)

Then the variable "data" is return, but is obviously null.

And then it happens what has to happen:

cz.topolik.fsrepo.LocalFileSystemRepository.getFileFromExpando(com.liferay.portal.model.RepositoryEntry)

line: 915

In the line:

String file = value.substring(value.indexOf("-") + 1);

value is null and we get the NPE.

So - the originating PrincipalException is causing the problem, and
that one is unfortunately swalloed by the Liferay code - not very
friendly, it should be nested and rethrown, imho. Do you know what's
misconfigured so that this PermissionChecker is not initialized?

I hope my long story was not too confusing....
~klemens

@topolik
Copy link
Owner

topolik commented May 17, 2012

Hi guys, thank you for finding this. I'm going to reopen the issue.

Klemens, thank you - I now understand what's going on but currently don't know how to fix it. I will need to go deeper into the code.

Seems that I can't use ExpandoBridge in these system calls, because I need call to Expando_LocalService. I assume ExpandoBridgeImpl use Expando_Service.

@topolik topolik reopened this May 17, 2012
@topolik
Copy link
Owner

topolik commented Jun 3, 2012

Should be fixed by 10a807d. Thx!

@topolik topolik closed this as completed Jun 3, 2012
@McAviti
Copy link
Contributor Author

McAviti commented Jun 3, 2012

I can confirm this.

~k

On Sun, Jun 3, 2012 at 2:47 PM, Tomáš Polešovský
reply@reply.github.com
wrote:

Should be fixed by 10a807d. Thx!


Reply to this email directly or view it on GitHub:
#6 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants