Fórum

LR 7: Problem with service deployment

Klaus Bachmaier, modificado 7 Anos atrás.

LR 7: Problem with service deployment

Regular Member Postagens: 223 Data de Entrada: 30/09/13 Postagens Recentes
I try to create a simple service builder example project with Liferay IDE 3.0.1, but I'm stuck while trying to deploy my service.

What happend yet:

- I created a new Liferay workspace project, and a servicebuilder module inside that workspace
- adjusted a simple service.xml to fit my needs and built the service
- implemented TestserviceLocalServiceImpl and rerun servicebuilder
- Had to adjust BuildPaths for service and api projects in Eclipse as Eclipse was always complaining that my Java source code wouldn't be on any classpath. Afterwards buildpaths seem to be OK now, as all imports in the service project are solved correctly. No problems during build.
- Testservice-api project deployed successfully
- Testservice-service project won't be started on the server with exceptions like this one:


org.osgi.framework.BundleException: Could not resolve module: Testservice-service [505]
  Unresolved requirement: Import-Package: com.mycompany.liferay.exception


That problem is not related to any specific class. If I copy the class with the unresolved requirement to my service project (just to see what happenes) the same exception appears with the next class from the api project.

- testservice-api is marked as "Active" in gogo shell
- testservice-service is marked as "Installed" in gogo shell

build.gradle of the service project has this entry:

compile project(":modules:Testservice:Testservice-api")


What's missing so that my service bundle will find the classes from the api bundle on the server?
thumbnail
David H Nebinger, modificado 7 Anos atrás.

RE: LR 7: Problem with service deployment

Liferay Legend Postagens: 14919 Data de Entrada: 02/09/06 Postagens Recentes
Can you check your bnd.bnd file from the API project to ensure it has the Export-Package declaration w/ all of your packages?





Come meet me at the LSNA!
Klaus Bachmaier, modificado 7 Anos atrás.

RE: LR 7: Problem with service deployment

Regular Member Postagens: 223 Data de Entrada: 30/09/13 Postagens Recentes
Yes, all packages from my *-api project are named under "Export-Package" in the bnd.bnd.
thumbnail
David H Nebinger, modificado 7 Anos atrás.

RE: LR 7: Problem with service deployment

Liferay Legend Postagens: 14919 Data de Entrada: 02/09/06 Postagens Recentes
Hmm, would you mind sharing both of your bnd.bnd files? Feel free to mask out sensitive info...





Come meet me at the LSNA!
Klaus Bachmaier, modificado 7 Anos atrás.

RE: LR 7: Problem with service deployment

Regular Member Postagens: 223 Data de Entrada: 30/09/13 Postagens Recentes
This is the content of the bnd.bnd from the API module:

Bundle-SymbolicName: ticketservice-api
Bundle-Version: 1.0.0
Export-Package:\
	com.mycompany.test.exception,\
	com.mycompany.test.model,\
	com.mycompany.test.service,\
	com.mycompany.test.service.persistence


...and this is the bnd.bnd from the service module:


Bundle-SymbolicName: ticketservice-service
Bundle-Version: 1.0.0
Liferay-Require-SchemaVersion: 1.0.0
Liferay-Service: true
thumbnail
David H Nebinger, modificado 7 Anos atrás.

RE: LR 7: Problem with service deployment

Liferay Legend Postagens: 14919 Data de Entrada: 02/09/06 Postagens Recentes
Okay, I checked your bnds against ones that I have that are working.

Can you change the service module bnd.bnd file to be the following and try it again:


Bundle-SymbolicName: ticketservice-service
Bundle-Version: 1.0.0
Liferay-Require-SchemaVersion: 1.0.0
Liferay-Service: true
Liferay-Spring-Context: META-INF/spring


Otherwise our files match and there should not be an issue w/ them.






Come meet me at the LSNA!
Klaus Bachmaier, modificado 7 Anos atrás.

RE: LR 7: Problem with service deployment

Regular Member Postagens: 223 Data de Entrada: 30/09/13 Postagens Recentes
Unfortunately I still get "unresolved requirements" Errors, after I added the last line of the service modules bnd.bnd
thumbnail
David H Nebinger, modificado 7 Anos atrás.

RE: LR 7: Problem with service deployment

Liferay Legend Postagens: 14919 Data de Entrada: 02/09/06 Postagens Recentes
Reviewing this thread, is this a typo or an actual issue:

org.osgi.framework.BundleException: Could not resolve module: Testservice-service [505]
Unresolved requirement: Import-Package: com.mycompany.liferay.exception

and

Export-Package:\
com.mycompany.test.exception,\
com.mycompany.test.model,\
com.mycompany.test.service,\
com.mycompany.test.service.persistence






Come meet me at the LSNA!
Klaus Bachmaier, modificado 7 Anos atrás.

RE: LR 7: Problem with service deployment

Regular Member Postagens: 223 Data de Entrada: 30/09/13 Postagens Recentes
This was my fault when "refactoring" my class names for this thread. The original packages had "liferay" in their names, and i forgot to alter this one correctly for this thread.

Nevertheless, I never found out what the reason for problems have been. I just recreated the service with a slightly different name and it worked instantly. I compared both versions, but never found out where the differnces where. Anyway I may go a little bit further now. Next stop: Trying to use my service from a MVC Portlet. It's hard to find a good example on the web though. Only found examples yet, where the service is called directly from a JSP page.
thumbnail
David H Nebinger, modificado 7 Anos atrás.

RE: LR 7: Problem with service deployment

Liferay Legend Postagens: 14919 Data de Entrada: 02/09/06 Postagens Recentes
Check out the https://github.com/liferay/liferay-blade-samples/tree/master/liferay-workspace/modules/blade.servicebuilder.web blade example. It uses the SB sample in the Liferay MVC portlet implementation.

It should get you where you are going!






Come meet me at the LSNA!