Vista combinada Visión Plana Vista de árbol
Discusiones [ Anterior | Siguiente ]
toggle
Sebastian Wikholm
Messageboards nullpointerexception
22 de febrero de 2012 22:56
Respuesta

Sebastian Wikholm

Ranking: Junior Member

Mensajes: 76

Fecha de incorporación: 10 de marzo de 2011

Mensajes recientes

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
23 de febrero de 2012 5:40
Respuesta

Jelmer Kuperus

Ranking: Liferay Legend

Mensajes: 1192

Fecha de incorporación: 10 de marzo de 2010

Mensajes recientes

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
23 de febrero de 2012 5:41
Respuesta

David H Nebinger

Community Moderator

Ranking: Liferay Legend

Mensajes: 11471

Fecha de incorporación: 1 de septiembre de 2006

Mensajes recientes

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
23 de febrero de 2012 5:42
Respuesta

David H Nebinger

Community Moderator

Ranking: Liferay Legend

Mensajes: 11471

Fecha de incorporación: 1 de septiembre de 2006

Mensajes recientes

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
29 de febrero de 2012 1:15
Respuesta

Sebastian Wikholm

Ranking: Junior Member

Mensajes: 76

Fecha de incorporación: 10 de marzo de 2011

Mensajes recientes

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
29 de febrero de 2012 2:31
Respuesta

Sebastian Wikholm

Ranking: Junior Member

Mensajes: 76

Fecha de incorporación: 10 de marzo de 2011

Mensajes recientes

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
16 de marzo de 2012 3:57
Respuesta

Niko Humalamäki

Ranking: New Member

Mensajes: 16

Fecha de incorporación: 21 de febrero de 2012

Mensajes recientes

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
19 de marzo de 2012 16:53
Respuesta

David H Nebinger

Community Moderator

Ranking: Liferay Legend

Mensajes: 11471

Fecha de incorporación: 1 de septiembre de 2006

Mensajes recientes

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
22 de marzo de 2012 14:27
Respuesta

Niko Humalamäki

Ranking: New Member

Mensajes: 16

Fecha de incorporación: 21 de febrero de 2012

Mensajes recientes

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