Forums

Home » Liferay Portal » English » 2. Using Liferay » General

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Brant Levinson
JSON servlet not being creating when using service builder
April 26, 2009 10:38 PM
Answer

Brant Levinson

Rank: Junior Member

Posts: 48

Join Date: July 12, 2008

Recent Posts

I have been trying to use service builder to build an application. The SOAP servlet gets created by not the JSON one.

I have remote-service='true' and have implemented the method as advised here: http://www.liferay.com/web/guest/community/forums/-/message_boards/message/1191680.

public class CustomerDtlsServiceImpl extends CustomerDtlsServiceBaseImpl {
public CustomerDtls getCustomerDtls(long id)
throws PortalException, SystemException {
return customerDtlsPersistence.findByPrimaryKey(id);
}
}

Although when I run ant build-service or just ant to build the war, it doesn't create the CustomerDtlsServiceJSON.java file. Am I doing this right? How to I get JSON services to run with a new portlet? Am I missing something?

Regards,
Brant
Tony Lim
RE: JSON servlet not being creating when using service builder
May 26, 2009 12:27 PM
Answer

Tony Lim

Rank: Junior Member

Posts: 90

Join Date: April 14, 2009

Recent Posts

I'm getting the same problem. How come the JSON files don't get greated?

thanks

Brant Levinson:
I have been trying to use service builder to build an application. The SOAP servlet gets created by not the JSON one.

I have remote-service='true' and have implemented the method as advised here: http://www.liferay.com/web/guest/community/forums/-/message_boards/message/1191680.

public class CustomerDtlsServiceImpl extends CustomerDtlsServiceBaseImpl {
public CustomerDtls getCustomerDtls(long id)
throws PortalException, SystemException {
return customerDtlsPersistence.findByPrimaryKey(id);
}
}

Although when I run ant build-service or just ant to build the war, it doesn't create the CustomerDtlsServiceJSON.java file. Am I doing this right? How to I get JSON services to run with a new portlet? Am I missing something?

Regards,
Brant
Dave Morris
RE: JSON servlet not being creating when using service builder
June 5, 2009 8:24 AM
Answer

Dave Morris

Rank: Junior Member

Posts: 27

Join Date: May 7, 2009

Recent Posts

I just upgraded to 5.2.3, and when I run ant build-service in the ext, my JSON classes are no longer being created either. Is this a change in 5.2.3?

In 5.2.2, the ext build-service command did create the JSON classes, but in the plugins SDK, it never did. Are you guys developing in plugins or ext?

Dave
Tony Lim
RE: JSON servlet not being creating when using service builder
June 5, 2009 10:23 AM
Answer

Tony Lim

Rank: Junior Member

Posts: 90

Join Date: April 14, 2009

Recent Posts

Developing in Plugins SDK
Faisal K
RE: JSON servlet not being creating when using service builder
June 5, 2009 11:47 AM
Answer

Faisal K

Rank: Regular Member

Posts: 138

Join Date: January 9, 2008

Recent Posts

Hi,

By def'ault, Liferay have commented the json file creation in plugin-sdk refer the 'build-service' section of build-common-plugin.xml under plugin root directry. As per my knowledge Liferay json servlet is still not able to load the json servlet created using plugin, may be liferay team is working on that, why I am guessing this because is If we un comment the above service-json file system property in the above file, service builder will generate the json files properly.

Any body have better understanding please reply!
Wilson Man
RE: JSON servlet not being creating when using service builder
June 5, 2009 12:53 PM
Answer

Wilson Man

LIFERAY STAFF

Rank: Liferay Master

Posts: 577

Join Date: June 21, 2006

Recent Posts

i could be wrong (cuz i haven't had time to dig deep into this ...) but i think per jsr-286, all the AJAX requests should go through the serveResource() method in your portlet class ... check out Liferay's JSPPortlet class. We normally extend this class to implement the serveResource()
Medha Sutaria
RE: JSON servlet not being creating when using service builder
December 9, 2009 7:19 AM
Answer

Medha Sutaria

Rank: Junior Member

Posts: 31

Join Date: August 11, 2008

Recent Posts

We've been trying to expose the web services for the wol-portlet, especially for the wall. What I saw in the portlet is, no json and ServiceSoap files were present, so I uncommented the line having "-Dservice.json.file" in plugins SDK as said by Faisal here and created the files -
Faisal K:
By def'ault, Liferay have commented the json file creation in plugin-sdk refer the 'build-service' section of build-common-plugin.xml under plugin root directry. As per my knowledge Liferay json servlet is still not able to load the json servlet created using plugin, may be liferay team is working on that, why I am guessing this because is If we un comment the above service-json file system property in the above file, service builder will generate the json files properly.


Next step, I saw that the build-wsdd target was missing in plugins sdk, so I copied the target from ext's build.xml and made few changes in class path and ran the target. It created the wsdd for wol-portlet.

Next, I copied the descriptors in tunnel-web's server-config.wsdd. But now, when I try i open http://localhost:8080/tunnel-web/axis, it gives me an error -
 1Sorry, something seems to have gone wrong... here are the details:
 2
 3Fault - Could not find class for the service named: com.liferay.wol.service.http.WallEntryServiceSoap
 4Hint: you may need to copy your class files/tree into the right location (which depends on the servlet system you are using).; nested exception is:
 5    java.lang.ClassNotFoundException: com.liferay.wol.service.http.WallEntryServiceSoap
 6AxisFault
 7 faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.generalException
 8 faultSubcode:
 9 faultString: Could not find class for the service named: com.liferay.wol.service.http.WallEntryServiceSoap
10Hint: you may need to copy your class files/tree into the right location (which depends on the servlet system you are using).; nested exception is:
11    java.lang.ClassNotFoundException: com.liferay.wol.service.http.WallEntryServiceSoap
12 faultActor:
13 faultNode:
14 faultDetail:
15    {http://xml.apache.org/axis/}hostname:...


I understand that copying these missing class files from wol-portlet/web-inf/classes to tunnel-web/web-inf/classes will help. But this will be duplicating the code and I don't want to do that. For the classes required for web-services of ext-plugins, I think it takes from the root's lib itself since the AxisServlet is present in Root only.

So, my question is, how do we include the files in the classpath? Also, isn't there any built-in way of doing all this instead of the workarounds I've been trying to do? I hoped liferay would provide a direct way to expose it's plugins web-services built by plugins sdk.