Foren

Home » Liferay Portal » English » 3. Development

Kombinierte Ansicht Flache Ansicht Baumansicht
Threads [ Zurück | Nächste ]
toggle
Smilelws2010 lwz
Liferay service builder on WebLogic
5. Februar 2013 10:01
Antwort

Smilelws2010 lwz

Rang: Regular Member

Nachrichten: 160

Eintrittsdatum: 16. Dezember 2010

Neue 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
David H Nebinger
RE: Liferay service builder on WebLogic
5. Februar 2013 10:17
Antwort

David H Nebinger

Community Moderator

Rang: Liferay Legend

Nachrichten: 11115

Eintrittsdatum: 1. September 2006

Neue 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
RE: Liferay service builder on WebLogic
5. Februar 2013 11:16
Antwort

Smilelws2010 lwz

Rang: Regular Member

Nachrichten: 160

Eintrittsdatum: 16. Dezember 2010

Neue 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
David H Nebinger
RE: Liferay service builder on WebLogic
5. Februar 2013 11:20
Antwort

David H Nebinger

Community Moderator

Rang: Liferay Legend

Nachrichten: 11115

Eintrittsdatum: 1. September 2006

Neue 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
RE: Liferay service builder on WebLogic
5. Februar 2013 11:45
Antwort

Smilelws2010 lwz

Rang: Regular Member

Nachrichten: 160

Eintrittsdatum: 16. Dezember 2010

Neue 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?
David H Nebinger
RE: Liferay service builder on WebLogic
5. Februar 2013 12:23
Antwort

David H Nebinger

Community Moderator

Rang: Liferay Legend

Nachrichten: 11115

Eintrittsdatum: 1. September 2006

Neue 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
RE: Liferay service builder on WebLogic
6. Februar 2013 07:57
Antwort

Smilelws2010 lwz

Rang: Regular Member

Nachrichten: 160

Eintrittsdatum: 16. Dezember 2010

Neue 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
RE: Liferay service builder on WebLogic
6. Februar 2013 08:07
Antwort

Smilelws2010 lwz

Rang: Regular Member

Nachrichten: 160

Eintrittsdatum: 16. Dezember 2010

Neue 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?
Mathew Anderson
RE: Liferay service builder on WebLogic
6. Juni 2013 13:17
Antwort

Mathew Anderson

Rang: Junior Member

Nachrichten: 29

Eintrittsdatum: 22. April 2013

Neue 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.