留言板

Need help - getting error calling service from liferay ide (remote)

Khalid Mufti,修改在10 年前。

Need help - getting error calling service from liferay ide (remote)

New Member 帖子: 5 加入日期: 13-4-14 最近的帖子
Hi everyone -

I've searched this forum and the wiki but have not found an answer and really need help.

I am using Liferay IDE 1.4 with the Remote IDE Connector 1.0.1 installed. I am using the Liferay 6.1.1 Tomcat bundle provided by Bitnami (running SQLServer). This BitNami instance is also running locahost.

I built a custom portlet (extends MVC) and that is fine. I defined a service.xml file with fields and the associated definition is created in the mysql instance above on publish. I am also able to access the site above and I see my custom portlet.

Now the issue happens. When I add the code to simply return the number of rows in the table (default provided by running servicebuilder via util class), I get the following error in the console:

17:16:46,633 ERROR [http-apr-8080-exec-14][render_portlet_jsp:154] com.liferay.portal.kernel.bean.BeanLocatorException: BeanLocator has not been set for servlet context TrainingCenter-portlet
	at com.liferay.portal.kernel.bean.PortletBeanLocatorUtil.locate(PortletBeanLocatorUtil.java:42)
	at com.jhr.aboriginal.service.CourseTakenLocalServiceUtil.getService(CourseTakenLocalServiceUtil.java:282)
	at com.jhr.aboriginal.service.CourseTakenLocalServiceUtil.getCourseTakensCount(CourseTakenLocalServiceUtil.java:222)
	at com.jhr.aboriginal.TrainingCenterSummaryPortlet.doView(TrainingCenterSummaryPortlet.java:26)
	at com.liferay.portal.kernel.portlet.LiferayPortlet.doDispatch(LiferayPortlet.java:218)
	at com.liferay.util.bridges.mvc.MVCPortlet.doDispatch(MVCPortlet.java:319)
	at javax.portlet.GenericPortlet.render(GenericPortlet.java:233)
	at com.liferay.portlet.FilterChainImpl.doFilter(FilterChainImpl.java:100)
	at com.liferay.portal.kernel.portlet.PortletFilterUtil.doFilter(PortletFilterUtil.java:64)
	at com.liferay.portal.kernel.servlet.PortletServlet.service(PortletServlet.java:111)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:72)
	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilter.doFilter(InvokerFilter.java:73)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
	at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:749)
	at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:605)
	at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:544)


I have no idea why this error is happening. Can anyone help?

Here are the steps I have done:

- Created custom portlet and deployed "remotely" to my bitnami image running on localhost
- I see the portlet appear and can add to the portal. Initially this portlet displays my Hello World text.
- I create service.xml and run service builder
- On publish verify that table is created in MQSQL server
- Update portlet to use the XXXLocalServiceUtil to output number of rows in DB (int)
- Republish and when try to run get the error above

Any ideas?
thumbnail
Gregory Amerson,修改在10 年前。

RE: Need help - getting error calling service from liferay ide (remote)

Liferay Legend 帖子: 1123 加入日期: 10-2-16 最近的帖子
Hello Khalid,

Can you first update the latest version of Liferay IDE, to version 1.6.2. Then can you try to redeploy your application? Or simply update your web.xml? That way the remote Tomcat should redeploy your portlet application.
Khalid Mufti,修改在10 年前。

RE: Need help - getting error calling service from liferay ide (remote)

New Member 帖子: 5 加入日期: 13-4-14 最近的帖子
Hi Gregory thanks for reaching out.

Sorry I typed 1.4 by mistake, I am actually using Liferay IDE 1.6.1.v201211020947.

Issue is still occuring. I'm going to try to shutoff the Bitnami Tomcat instance and run a local Liferay/Tomcat server through eclipse pointing to the same mysql instance. Curious if the same issue will come up.
Khalid Mufti,修改在10 年前。

RE: Need help - getting error calling service from liferay ide (remote)

New Member 帖子: 5 加入日期: 13-4-14 最近的帖子
I noticed that Bitnami bundle of Liferay runs using JRE7.

Will this be an issue? I believe the liferay/tomcat bundle runs using JRE6.

Please advise.
Khalid Mufti,修改在10 年前。

RE: Need help - getting error calling service from liferay ide (remote)

New Member 帖子: 5 加入日期: 13-4-14 最近的帖子
OK here are my findings:

(1) Using Liferay IDE with local instance of Tomcat (using JRE6) everything works as accepted and no BeanLocator error.
(2) Using Liferay IDE (with Remote Server Adapter) deploying to my Bitnami Liferay bundle running locally results in BeanLocator error above.

Interestingly, if I take the deployed portlet folder within webapps in Liferay app folder within Tomcat from (1) and copy to webapps in Tomcat in Bitnami instance in (2), things work! So I'm guessing the JRE is not the issue.

It appears there is a bug if using Remote Server Adapter to deploy to a server.
thumbnail
Gregory Amerson,修改在10 年前。

RE: Need help - getting error calling service from liferay ide (remote)

Liferay Legend 帖子: 1123 加入日期: 10-2-16 最近的帖子
Khalid Mufti:
OK here are my findings:

(1) Using Liferay IDE with local instance of Tomcat (using JRE6) everything works as accepted and no BeanLocator error.
(2) Using Liferay IDE (with Remote Server Adapter) deploying to my Bitnami Liferay bundle running locally results in BeanLocator error above.

Interestingly, if I take the deployed portlet folder within webapps in Liferay app folder within Tomcat from (1) and copy to webapps in Tomcat in Bitnami instance in (2), things work! So I'm guessing the JRE is not the issue.

It appears there is a bug if using Remote Server Adapter to deploy to a server.



Hey Khalid,

Thanks for posting your findings. Can you confirm that the local runtime stub that you pointed your local project to (set as the server runtime) is exactly the same version as the remote Liferay instance?

Are you able to deploy a portlet to the remote portal server without using IDE? Like maybe with the plugin installer? Or run 'ant war' and then ftp the war up to the auto-deploy directory on the remote instance?