留言板

Liferay 7 JSF Portlet WAR, Maven and WSDD

Ingo Schildmann,修改在6 年前。

Liferay 7 JSF Portlet WAR, Maven and WSDD

New Member 帖子: 14 加入日期: 11-12-21 最近的帖子
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
thumbnail
Neil Griffin,修改在6 年前。

RE: Liferay 7 JSF Portlet WAR, Maven and WSDD

Liferay Legend 帖子: 2655 加入日期: 05-7-27 最近的帖子
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,修改在6 年前。

RE: Liferay 7 JSF Portlet WAR, Maven and WSDD

New Member 帖子: 14 加入日期: 11-12-21 最近的帖子
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