Combination View Flat View Tree View
Threads [ Previous | Next ]
Sebastian Wikholm
Messageboards nullpointerexception
February 22, 2012 10:56 PM
Answer

Sebastian Wikholm

Rank: Junior Member

Posts: 63

Join Date: March 10, 2011

Recent Posts

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:

 1
 208:23:28,904 ERROR [render_portlet_jsp:154] java.lang.NullPointerException
 3    at com.liferay.portlet.asset.util.BaseAssetEntryValidator.validate(BaseAssetEntryValidator.java:105)
 4    at com.liferay.portlet.asset.util.BaseAssetEntryValidator.validate(BaseAssetEntryValidator.java:74)
 5    at com.liferay.portlet.asset.service.impl.AssetEntryLocalServiceImpl.validate(AssetEntryLocalServiceImpl.java:815)
 6    at com.liferay.portlet.asset.service.impl.AssetEntryLocalServiceImpl.updateEntry(AssetEntryLocalServiceImpl.java:572)
 7    at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:112)
 8    at com.liferay.portal.spring.transaction.TransactionInterceptor.invoke(TransactionInterceptor.java:71)
 9    at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:108)
10    at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:59)
11    at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:108)
12    at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:59)
13    at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:108)
14    at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:59)
15    at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:108)
16    at com.liferay.portal.spring.aop.ServiceBeanAopProxy.invoke(ServiceBeanAopProxy.java:211)
17    at com.liferay.portlet.messageboards.service.impl.MBThreadLocalServiceImpl.addThread(MBThreadLocalServiceImpl.java:102)
18    at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:112)
19    at com.liferay.portal.spring.transaction.TransactionInterceptor.invoke(TransactionInterceptor.java:71)
20    at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:108)
21    at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:59)
22    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:

1redirect.url.domains.allowed=
2redirect.url.ips.allowed=
3redirect.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
Jelmer Kuperus
RE: Messageboards nullpointerexception
February 23, 2012 5:40 AM
Answer

Jelmer Kuperus

Rank: Liferay Legend

Posts: 1192

Join Date: March 10, 2010

Recent Posts

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
David H Nebinger
RE: Messageboards nullpointerexception
February 23, 2012 5:41 AM
Answer

David H Nebinger

Rank: Liferay Legend

Posts: 7466

Join Date: September 1, 2006

Recent Posts

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?
David H Nebinger
RE: Messageboards nullpointerexception
February 23, 2012 5:42 AM
Answer

David H Nebinger

Rank: Liferay Legend

Posts: 7466

Join Date: September 1, 2006

Recent Posts

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
RE: Messageboards nullpointerexception
February 29, 2012 1:15 AM
Answer

Sebastian Wikholm

Rank: Junior Member

Posts: 63

Join Date: March 10, 2011

Recent Posts

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?
Sebastian Wikholm
RE: Messageboards nullpointerexception
February 29, 2012 2:31 AM
Answer

Sebastian Wikholm

Rank: Junior Member

Posts: 63

Join Date: March 10, 2011

Recent Posts

Thanks a lot, got the messageboards working by putting that null check in BaseAssetEntryValidator.java and building fram ga1 source..
Niko Humalamäki
RE: Messageboards nullpointerexception
March 16, 2012 3:57 AM
Answer

Niko Humalamäki

Rank: New Member

Posts: 16

Join Date: February 21, 2012

Recent Posts

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?
David H Nebinger
RE: Messageboards nullpointerexception
March 19, 2012 4:53 PM
Answer

David H Nebinger

Rank: Liferay Legend

Posts: 7466

Join Date: September 1, 2006

Recent Posts

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 Humalamäki
RE: Messageboards nullpointerexception
March 22, 2012 2:27 PM
Answer

Niko Humalamäki

Rank: New Member

Posts: 16

Join Date: February 21, 2012

Recent Posts

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