Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Ingo Schildmann
Liferay 7 JSF Portlet WAR, Maven and WSDD
October 24, 2017 9:03 AM
Answer

Ingo Schildmann

Rank: New Member

Posts: 12

Join Date: December 21, 2011

Recent Posts

Hi,

I'm upgrading a Liferay Primefaces Portlet from Liferay 6.1.1-ce-ga2 to 7.0-ga4.
I'm using Maven as build tool.

I could sucessfully build and deploy the resulting WAR.
Now I want to make a service work again, that the portlet offered.

I added the service.xml to the project and added to the pom the build plugins
1<groupId>com.liferay</groupId>
2<artifactId>com.liferay.portal.tools.service.builder</artifactId>
3<version>1.0.160</version>
and
1<groupId>com.liferay</groupId>
2<artifactId>com.liferay.portal.tools.wsdd.builder</artifactId>
3<version>1.0.8</version>

I used the goal service-builder:build sucessfully to generate the service.
But I can't use the goal wsdd-builder:build to generate the WSDD-files,
because of a ClassNotFoundException (the generated service classes in /src/main/java can't be found).

 1 Java2WSDL de.karb.service.http.TaskServiceSoap
 2  java.lang.ClassNotFoundException: de.karb.service.http.TaskServiceSoap
 3      at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass(SelfFirstStrategy.java:50)
 4      at org.codehaus.plexus.classworlds.realm.ClassRealm.unsynchronizedLoadClass(ClassRealm.java:271)
 5      at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:247)
 6      at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:239)
 7      at org.apache.tools.ant.AntClassLoader.findBaseClass(AntClassLoader.java:1393)
 8      at org.apache.tools.ant.AntClassLoader.loadClass(AntClassLoader.java:1088)
 9      at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
10      at org.apache.axis.utils.ClassUtils$2.run(ClassUtils.java:187)
11      at java.security.AccessController.doPrivileged(Native Method)
12      at org.apache.axis.utils.ClassUtils.loadClass(ClassUtils.java:160)
13      at org.apache.axis.utils.ClassUtils.forName(ClassUtils.java:100)
14      at org.apache.axis.wsdl.fromJava.Emitter.setCls(Emitter.java:2079)
15      at org.apache.axis.tools.ant.wsdl.Java2WsdlAntTask.execute(Java2WsdlAntTask.java:188)
16      at com.liferay.util.ant.Java2WsddTask.generateWsdd(Java2WsddTask.java:112)
17      at com.liferay.portal.tools.wsdd.builder.WSDDBuilder._createServiceWSDD(WSDDBuilder.java:159)


The page https://dev.liferay.com/de/develop/reference/-/knowledge_base/7-0/wsdd-builder-gradle-plugin mentions
the property builderClasspath.
Is it possible to set this in the Maven configuration of the plugin?
If not, is the WSDD-Builder only usable with Gradle?
Is there a documentation how to add a simple Gradle-buildfile to a Maven project for building the WSDD files?

Thanks,
Ingo Schildmann
Neil Griffin
RE: Liferay 7 JSF Portlet WAR, Maven and WSDD
October 24, 2017 10:00 AM
Answer

Neil Griffin

LIFERAY STAFF

Rank: Liferay Legend

Posts: 2511

Join Date: July 26, 2005

Recent Posts

Hi Ingo,

I recommend that you read the forum thread titled Problem to cosume Liferay 7 service in JSF portlet. In that thread I attached a file named test1.zip that shows how to do this with Maven. Note that for Liferay Portal 7.0, the ServiceBuilder API is its own jar, and the ServiceBuilder Impl is also its own jar. In other words, you would not generate services directly in your JSF portlet war project.

Kind Regards,

Neil
Ingo Schildmann
RE: Liferay 7 JSF Portlet WAR, Maven and WSDD
October 26, 2017 5:54 AM
Answer

Ingo Schildmann

Rank: New Member

Posts: 12

Join Date: December 21, 2011

Recent Posts

Hi Neil,
thanks for the test1.zip with the customer service. It was helpful to seperate the service from the portlet.

But it had the same problem, that I couldn't create the WSDD with Maven .
I built then the service with Gradle and the API with Maven, so I could easily use the API in my portlet.

But although I could connect to the service with SOAP, the ServiceTracker in ..ServiceUtil.getService() returned null.

I then decided that the jsonws REST implementation is sufficient and gave up the SOAP web service.
So I could abandon Gradle in the project and build API and service with Maven.

Kind regards,
Ingo

Participate in the State of Liferay Community 2017. Help the community and even win some prizes!