掲示板
Liferay Spring Object Initialization NPE
7年前 に Sourabh Lonikar によって更新されました。
Liferay Spring Object Initialization NPE
Junior Member 投稿: 42 参加年月日: 16/11/14 最新の投稿
Hi all,
I am getting below NPE @ this code location.
It seems class variable dlFileVersionPersistence is null. Can someone point out how to find out if it has been properly initialized through spring.xml ?
** Liferay Code **
Method Paramters:
fileEntryId : 21403
excludeWorkingCopy : true
public DLFileVersion getLatestFileVersion(long fileEntryId, boolean excludeWorkingCopy) throws PortalException, SystemException {
List<DLFileVersion> dlFileVersions = dlFileVersionPersistence.findByFileEntryId(fileEntryId);
if (dlFileVersions.isEmpty()) {
throw new NoSuchFileVersionException(
"No file versions found for fileEntryId " + fileEntryId);
}
...
...
}
** Liferay Error **
11:09:21,554 INFO [Tagger:151] addName | DLFileVersionLocalServiceImpl : getMethod :: FileEntryId : 21403
11:09:21,555 INFO [Tagger:154] addName | DLFileVersionLocalServiceImpl : invoke
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
...
Caused by: java.lang.NullPointerException
at com.liferay.portlet.documentlibrary.service.impl.DLFileVersionLocalServiceImpl.getLatestFileVersion(DLFileVersionLocalServiceImpl.java:99)
... 200 more
Regards,
Sourabh
I am getting below NPE @ this code location.
It seems class variable dlFileVersionPersistence is null. Can someone point out how to find out if it has been properly initialized through spring.xml ?
** Liferay Code **
Method Paramters:
fileEntryId : 21403
excludeWorkingCopy : true
public DLFileVersion getLatestFileVersion(long fileEntryId, boolean excludeWorkingCopy) throws PortalException, SystemException {
List<DLFileVersion> dlFileVersions = dlFileVersionPersistence.findByFileEntryId(fileEntryId);
if (dlFileVersions.isEmpty()) {
throw new NoSuchFileVersionException(
"No file versions found for fileEntryId " + fileEntryId);
}
...
...
}
** Liferay Error **
11:09:21,554 INFO [Tagger:151] addName | DLFileVersionLocalServiceImpl : getMethod :: FileEntryId : 21403
11:09:21,555 INFO [Tagger:154] addName | DLFileVersionLocalServiceImpl : invoke
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
...
Caused by: java.lang.NullPointerException
at com.liferay.portlet.documentlibrary.service.impl.DLFileVersionLocalServiceImpl.getLatestFileVersion(DLFileVersionLocalServiceImpl.java:99)
... 200 more
Regards,
Sourabh
7年前 に Jorge Díaz によって更新されました。
RE: Liferay Spring Object Initialization NPE
Liferay Master 投稿: 753 参加年月日: 14/01/09 最新の投稿
Which Liferay version are you using?
The error is produced in getLatestFileVersion. Are you calling it from a custom code written by you or error is produced in Liferay without any customization?
You can also try using last GA version available.
The error is produced in getLatestFileVersion. Are you calling it from a custom code written by you or error is produced in Liferay without any customization?
You can also try using last GA version available.
7年前 に Sourabh Lonikar によって更新されました。
RE: Liferay Spring Object Initialization NPE
Junior Member 投稿: 42 参加年月日: 16/11/14 最新の投稿
Hi Jorge,
Sorry for delay in my response.
I am using Liferay Portal 6.2 EE SP15 with Tomcat 7.0.62. This error is thrown when my Custom portlet calls DLFileVersionLocalServiceImpl.getLatestFileVersion() function. The error stack track shows NPE occuring within Liferay code with method parameters not being null.
Regards,
Sourabh
Sorry for delay in my response.
I am using Liferay Portal 6.2 EE SP15 with Tomcat 7.0.62. This error is thrown when my Custom portlet calls DLFileVersionLocalServiceImpl.getLatestFileVersion() function. The error stack track shows NPE occuring within Liferay code with method parameters not being null.
Regards,
Sourabh