Foren

Messageboards nullpointerexception

Sebastian Wikholm, geändert vor 12 Jahren.

Messageboards nullpointerexception

Regular Member Beiträge: 104 Beitrittsdatum: 10.03.11 Neueste Beiträge
I have liferay 6.1 GA1 installed on a Windows Server 2008 R2 (64-bit) with jdk 1.6.0 20 64-bit(tested with 1.6.0 30 also) with mysql 5.5.20.

The server is running on a virtual server on a hp blade running vmware server.

Whenever I try to to add a thread on the Messageboards I get the message: Message Boards is temporarily unavailable.

The logs say:


08:23:28,904 ERROR [render_portlet_jsp:154] java.lang.NullPointerException
	at com.liferay.portlet.asset.util.BaseAssetEntryValidator.validate(BaseAssetEntryValidator.java:105)
	at com.liferay.portlet.asset.util.BaseAssetEntryValidator.validate(BaseAssetEntryValidator.java:74)
	at com.liferay.portlet.asset.service.impl.AssetEntryLocalServiceImpl.validate(AssetEntryLocalServiceImpl.java:815)
	at com.liferay.portlet.asset.service.impl.AssetEntryLocalServiceImpl.updateEntry(AssetEntryLocalServiceImpl.java:572)
	at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:112)
	at com.liferay.portal.spring.transaction.TransactionInterceptor.invoke(TransactionInterceptor.java:71)
	at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:108)
	at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:59)
	at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:108)
	at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:59)
	at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:108)
	at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:59)
	at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:108)
	at com.liferay.portal.spring.aop.ServiceBeanAopProxy.invoke(ServiceBeanAopProxy.java:211)
	at com.liferay.portlet.messageboards.service.impl.MBThreadLocalServiceImpl.addThread(MBThreadLocalServiceImpl.java:102)
	at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:112)
	at com.liferay.portal.spring.transaction.TransactionInterceptor.invoke(TransactionInterceptor.java:71)
	at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:108)
	at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:59)
	at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:108)


Tried to find what would cause this and there were discussion that said that it might have to do with the virtual host settings and ip/domains allowed in ext-properties

I have put this in ext-properties:

redirect.url.domains.allowed=
redirect.url.ips.allowed=
redirect.url.security.mode=ip


But it doesn´t help...

When you click "My posts" the threads I have tried to create do exist, but the the thread name has a id number instead of a text

Any help at all would be greatly appreciated
thumbnail
jelmer kuperus, geändert vor 12 Jahren.

RE: Messageboards nullpointerexception

Liferay Legend Beiträge: 1191 Beitrittsdatum: 10.03.10 Neueste Beiträge
Hey Axxell, like i told you on irc, this issue is : http://issues.liferay.com/browse/LPS-24772

This is the change that was made for this ticket : https://github.com/liferay/liferay-portal/commit/9873689e0efad27ea09c311bc4bbd3b178ae5d81#portal-impl/src/com/liferay/portlet/asset/util/BaseAssetEntryValidator.java
Sebastian Wikholm, geändert vor 12 Jahren.

RE: Messageboards nullpointerexception

Regular Member Beiträge: 104 Beitrittsdatum: 10.03.11 Neueste Beiträge
Thanks a lot, got the messageboards working by putting that null check in BaseAssetEntryValidator.java and building fram ga1 source..
Niko H, geändert vor 12 Jahren.

RE: Messageboards nullpointerexception

New Member Beiträge: 16 Beitrittsdatum: 21.02.12 Neueste Beiträge
jelmer kuperus:
Hey Axxell, like i told you on irc, this issue is : http://issues.liferay.com/browse/LPS-24772

This is the change that was made for this ticket : https://github.com/liferay/liferay-portal/commit/9873689e0efad27ea09c311bc4bbd3b178ae5d81#portal-impl/src/com/liferay/portlet/asset/util/BaseAssetEntryValidator.java



Hi, I have a stupid question, which would speed up my learning process, if someone can provide me with an ansver.

Can I somehow override classes in the source under potal-impl/src? Or what are the limits of the hook, at least there is the xml tag to override services, so which things go under services? portlets? liferay coreportlets? things under portal-service, but not under portal-impl in src? If the last one, then what's the difference in the portal-impl and portal-service code? Are service classes portlet related java?

Oh, and I have the same problem as in the topic, which is why I'm looking at the hooks to solve this... so the main point was, which is the "right" way to mess with the stuff under portal-impl/src?
thumbnail
David H Nebinger, geändert vor 12 Jahren.

RE: Messageboards nullpointerexception

Liferay Legend Beiträge: 14916 Beitrittsdatum: 02.09.06 Neueste Beiträge
You can only override classes in portal-impl.jar by doing an EXT plugin, but this is not always the right way to do things.

You're better of encapsulating access to the Liferay APIs in your own service layer (leveraging Service Builder), then hook the Liferay JSPs (etc) to use your service layer rather than the Liferay services.

Tinkering with the Liferay services (either by overriding in EXT plugin or modifying the source directly) will make handling upgrades (even minor releases) prone to breakage.

Portal-service.jar has the interfaces and class loader proxies to access services provided by portal-impl.jar. Portal-impl.jar is the Liferay implementation jar and as a golden rule you don't want to mess around in there if you don't need to.

It's actually far easier and cleaner to build your own service layer as a proxy to the underlying Liferay services, and you will be able to handle Liferay updates easily.

Hooks are alternative ways to override/replace some of the Liferay services, but you must truly understand the scope of how the service is used throughout Liferay. Many of the Liferay services are used across multiple portlets and services, so it would be easy to introduce something which on the surface may seem straight forward but may actually break some portion of Liferay.
Niko H, geändert vor 12 Jahren.

RE: Messageboards nullpointerexception

New Member Beiträge: 16 Beitrittsdatum: 21.02.12 Neueste Beiträge
Thank you so much! Really appreciate taking your time to answer. So I'll start to look into the service builder... Now I need to focus on the layout for the portal, so I'll return to these things later this year probably with more questions emoticon
thumbnail
David H Nebinger, geändert vor 12 Jahren.

RE: Messageboards nullpointerexception

Liferay Legend Beiträge: 14916 Beitrittsdatum: 02.09.06 Neueste Beiträge
After looking at the code, I think your diagnosis is all wrong...

The NPE would be due to an invalid AssetRendererFactory (null) being returned by the AssetRendererFactoryRegistryUtil class when trying to find the appropriate AssetRendererFactory by the class name of the instance you're trying to register, in this case a MBThread instance.

Have you done any hacking around in the properties or in the code to muck w/ the asset stuff?
thumbnail
David H Nebinger, geändert vor 12 Jahren.

RE: Messageboards nullpointerexception

Liferay Legend Beiträge: 14916 Beitrittsdatum: 02.09.06 Neueste Beiträge
Sorry, Jelmer, I didn't know you were posting otherwise I would have left my analysis out...

Use Jelmer's info to resolve your problem...
Sebastian Wikholm, geändert vor 12 Jahren.

RE: Messageboards nullpointerexception

Regular Member Beiträge: 104 Beitrittsdatum: 10.03.11 Neueste Beiträge
David H Nebinger:
After looking at the code, I think your diagnosis is all wrong...

The NPE would be due to an invalid AssetRendererFactory (null) being returned by the AssetRendererFactoryRegistryUtil class when trying to find the appropriate AssetRendererFactory by the class name of the instance you're trying to register, in this case a MBThread instance.

Have you done any hacking around in the properties or in the code to muck w/ the asset stuff?



The only thing ive done is a hook on asset publisher and the code in it. Seems kinda strange if that would have anything to do with that..

I did test uninstalling the hook but the problem persisted. Anything else i can try to fix it?

I do load some articles in the theme also, as a header on the page, sort of.. that shouldnt matter should it?