Foren

Liferay service builder on WebLogic

Smilelws2010 lwz, geändert vor 11 Jahren.

Liferay service builder on WebLogic

Regular Member Beiträge: 160 Beitrittsdatum: 16.12.10 Neueste Beiträge
HI

I am working with Liferay service builder for the first time and have created a POC sevice builder and deployed on local tomcat. we can remotely access the services defined in my entityServiceImpl.

But when I deployed the same portlet to a WebLogic environment, even the portlet itself got deployed and can execute the methods (add, delete etc) form within the portlet, I am not able to make call to those methods remotely using URL.

Please can anyone help? Does any one have come across the issue before or have some ideas.


Thank
Smile
thumbnail
David H Nebinger, geändert vor 11 Jahren.

RE: Liferay service builder on WebLogic

Liferay Legend Beiträge: 14916 Beitrittsdatum: 02.09.06 Neueste Beiträge
The SB entity has two attributes, local-service and remote-service. For remote services to work, you must set remote-service to true and re-run service builder.

Local service methods defined in XxxLocalServiceImpl are not normally exported by default. You need to add methods to the XxxServiceImpl class and re-run service builder for these methods to be visible for remote users.

Service builder will create a service jar that you can use within Liferay to access the services remotely, but in the end there's also a WSDL available so you can access the service via a regular SOAP-based client.

There should be plenty of doco to help identify your URL for accessing the WSDL and then invoking the methods.

Unfortunately I can't offer much more due to lack of detail in your post...
Smilelws2010 lwz, geändert vor 11 Jahren.

RE: Liferay service builder on WebLogic

Regular Member Beiträge: 160 Beitrittsdatum: 16.12.10 Neueste Beiträge
HI David,

Thanks you for the quick reply.

service.xml already had remote-esrvice set to true. And I have the methods in my xxxServiceImpl class. When the portlet was on tomcat server everything was working perfect but not on weblogic server.

I have the service jar. Do you you suggest to put the jar file on somewhere in WebLogic.

Let me know if more details needed

Thanks
thumbnail
David H Nebinger, geändert vor 11 Jahren.

RE: Liferay service builder on WebLogic

Liferay Legend Beiträge: 14916 Beitrittsdatum: 02.09.06 Neueste Beiträge
So how were you accessing the web service when in Tomcat? Are you using the service jar there, or SOAP web service calls directly?

When you say you can't do it in WL, what do you mean? Exception is thrown? Error in logs? No response from web service?

Is there anything in the WL system logs that might indicate some sort of issue?

Etc...
Smilelws2010 lwz, geändert vor 11 Jahren.

RE: Liferay service builder on WebLogic

Regular Member Beiträge: 160 Beitrittsdatum: 16.12.10 Neueste Beiträge
Say I have a service findemail on my xxxServiceImpl and I have remote-service= true in my service.xml. In tomcat mycustomservice.jar is formed when you generate or build service. It is in my my portlet lib folder.

I can access my methods using the below on tomcat
http://localhost:8080/sample-portlet/api/jsonws/?serviceClassName=com.sample.service.SampleServiceUtil&serviceMethodName=findemail&serviceParameters=&email=abc@abc.com


But, the same url on weblogic does not work.

http://xyx.net/sample-portlet/api/jsonws/?serviceClassName=com.sample.service.SampleServiceUtil&serviceMethodName=findemail&serviceParameters=&email=abc@abc.com



Do you think any patches or maybe some jars are required for the portlet to work in WebLogic?
thumbnail
David H Nebinger, geändert vor 11 Jahren.

RE: Liferay service builder on WebLogic

Liferay Legend Beiträge: 14916 Beitrittsdatum: 02.09.06 Neueste Beiträge
What do you mean "does not work"?

I mean, that's the crux of your whole question... Server returns some sort of error code, i.e. a 500? Some stack trace appears either in the page or in the logs? You get information back but it's erroneous?

Personally I'd be worried about the @ sign in the url - I believe those are typically encoded as %40 and not allowed directly inline...
Smilelws2010 lwz, geändert vor 11 Jahren.

RE: Liferay service builder on WebLogic

Regular Member Beiträge: 160 Beitrittsdatum: 16.12.10 Neueste Beiträge
If I hit my remote service on locla bundle, I get something like
[{"companyId":1,"createDate":1359746119150,"groupId":19,"modifiedDate":1359746119150,"subscribe_To_type":"News","subscriptionId":15401,"userId":0,"userName":"","user_email":"smiley@xyz.com"}]

But on weblogic after deployment I wont get any repsonse back and not only that it is not throwing any errors back

I received two errors while deploying the porltet
<[ServletContext@16300699[app:Subscription-portlet module:Subscription-portlet.war path:/Subscription-portlet spec-version:2.5]] Could not deserialize the context attribute.
java.io.NotSerializableException: org.apache.axis.configuration.FileProvider
But I believe changing version on web.xml fixed that.

Another error received was,
java.io.NotSerializableException: org.apache.commons.lang.time.FastDateFormat$PaddedNumberField
at java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1346)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1154)
at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1518)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1483)
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1400)

But the two errors are not hindering me to add the portlet to a page in liferay on WEblogic. And I can subscribe, unsubscribe through the portlet, but not through service.


Thanks
Smile
Smilelws2010 lwz, geändert vor 11 Jahren.

RE: Liferay service builder on WebLogic

Regular Member Beiträge: 160 Beitrittsdatum: 16.12.10 Neueste Beiträge
Also another behavioral difference between tomcat and weblogic with the deployed portlet is that, on tomcat it asks authentication while accessing the service only for "portal realm".
But on weblogic, it will ask for "portal realm" and after that another prompt for WebLogic server.
The user name or password you entered for this area on pp-dev.umassconnect.net:80 was incorrect. Make sure you’re entering them correctly, and then try again.


WE have different account for liferay portlal and weblogic admin acess. WIll that be an issue?
thumbnail
Mathew Anderson, geändert vor 10 Jahren.

RE: Liferay service builder on WebLogic

Junior Member Beiträge: 29 Beitrittsdatum: 22.04.13 Neueste Beiträge
Did you happen find an fix for this?

It appears I may have the same thing.

Weblogic 12c with Liferay 6.1 CE

When I access https://server/api/jsonws I am able to see the JSONWS API page.
When I access https://server/portlet/aps/jsonws I get a 404. with no errors in the weblogic logs.

the custom portlets are deployed as war files (not exploded) on the weblogic server.

The same portlet in tomcat displays the API page without issue.