Forums

angle-left Back

Liferay 7 JSF Portlet WAR, Maven and WSDD

IS
Ingo Schildmann, modified 8 Months ago.

Liferay 7 JSF Portlet WAR, Maven and WSDD

New Member Posts: 12 Join Date: 12/21/11 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
<groupId>com.liferay</groupId>
<artifactId>com.liferay.portal.tools.service.builder</artifactId>
<version>1.0.160</version>
and
<groupId>com.liferay</groupId>
<artifactId>com.liferay.portal.tools.wsdd.builder</artifactId>
<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).

Java2WSDL de.karb.service.http.TaskServiceSoap
  java.lang.ClassNotFoundException: de.karb.service.http.TaskServiceSoap
      at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass(SelfFirstStrategy.java:50)
      at org.codehaus.plexus.classworlds.realm.ClassRealm.unsynchronizedLoadClass(ClassRealm.java:271)
      at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:247)
      at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:239)
      at org.apache.tools.ant.AntClassLoader.findBaseClass(AntClassLoader.java:1393)
      at org.apache.tools.ant.AntClassLoader.loadClass(AntClassLoader.java:1088)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
      at org.apache.axis.utils.ClassUtils$2.run(ClassUtils.java:187)
      at java.security.AccessController.doPrivileged(Native Method)
      at org.apache.axis.utils.ClassUtils.loadClass(ClassUtils.java:160)
      at org.apache.axis.utils.ClassUtils.forName(ClassUtils.java:100)
      at org.apache.axis.wsdl.fromJava.Emitter.setCls(Emitter.java:2079)
      at org.apache.axis.tools.ant.wsdl.Java2WsdlAntTask.execute(Java2WsdlAntTask.java:188)
      at com.liferay.util.ant.Java2WsddTask.generateWsdd(Java2WsddTask.java:112)
      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, modified 8 Months ago.

RE: Liferay 7 JSF Portlet WAR, Maven and WSDD

LIFERAY STAFF Liferay Legend Posts: 2540 Join Date: 7/26/05 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
IS
Ingo Schildmann, modified 8 Months ago.

RE: Liferay 7 JSF Portlet WAR, Maven and WSDD

New Member Posts: 12 Join Date: 12/21/11 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