Foren

build-wsdd goal not able to find classes in service archetype project

Ajith Mathews C, geändert vor 11 Jahren.

build-wsdd goal not able to find classes in service archetype project

New Member Beitrag: 1 Beitrittsdatum: 13.04.12 Neueste Beiträge
Hi,

I have a project called as manager which is using the liferay service builder archetype. So basically this would contain the manager-portlet & manager-portlet-service modules. I am able to build the service using the goals liferay:build-service. This goal does not generate the wsdd file. I found that there is another goal used for creating the wsdd file, which is com.liferay.maven.plugins:liferay-maven-plugin:6.1.0:build-wsdd.

I am getting an exception, stating that its not able to find the class file for xyz. The xyz.java class is part of the manager-portlet-service module. I tried including the service jar into the portlet project dependencies section.

Any suggestions on how to make the .class available of the service module available to portlet project? service module generates a jar file as its output.
Ramon Garcia, geändert vor 11 Jahren.

RE: build-wsdd goal not able to find classes in service archetype project

New Member Beiträge: 21 Beitrittsdatum: 11.02.10 Neueste Beiträge
Hi,

I have the same problem... anyone know how to solve it??

Thks.
thumbnail
Amit Doshi, geändert vor 11 Jahren.

RE: build-wsdd goal not able to find classes in service archetype project

Liferay Master Beiträge: 550 Beitrittsdatum: 29.12.10 Neueste Beiträge
Hi Guys,

I am facing same issue in maven based project.

Have you guys found any soulution for this?

Thanks & Regards,
Amit Doshi
Ramon Garcia, geändert vor 11 Jahren.

RE: build-wsdd goal not able to find classes in service archetype project

New Member Beiträge: 21 Beitrittsdatum: 11.02.10 Neueste Beiträge
Hi... for resolve it...
The problem is when you run the generate-wsdd, in the service module, it can't find the serviceBuilder impl classes... to resolve it "easily" I do:
1. - "Copy impl classes from module project to service module"
2. - Do Package
3. - Generate wsdd
4. - Remove impl classes from service module
5 - Do package ... install...
With theses simple steps ... I solved the problem ... I hope you find it useful!
thumbnail
Amit Doshi, geändert vor 11 Jahren.

RE: build-wsdd goal not able to find classes in service archetype project

Liferay Master Beiträge: 550 Beitrittsdatum: 29.12.10 Neueste Beiträge
Thanks for the quick reply Ramon.

I stuck at point

3- Generate wsdd.

I tried this command mvn liferay:build-wsdd -DserverConfigFileName=fileC://server-config.wsdd -DserviceFileName=C://service.xml -X

It gives me below error.



Loading jar:file:/C:/Documents%20and%20Settings/amit.doshi/.m2/repository/com/liferay/portal/portal-impl/6.1.20/portal-impl-6.1.20.jar!/portal.properties
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 9.016s
[INFO] Finished at: Thu Feb 14 18:47:07 IST 2013
[INFO] Final Memory: 8M/34M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.liferay.maven.plugins:liferay-maven-plugin:6.1.20:build-wsdd (default-cli) on project mexico-application-portlet-service: fileC:\server-config.wsdd (The filename, directory name, or volume label syntax is incorrect) -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.liferay.maven.plugins:liferay-maven-plugin:6.1.20:build-wsdd (default-cli) on project mexico-application-portlet-service: fileC:\server-config.wsdd (The filename, directory name, or volume label syntax is incorrect)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:203)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:148)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:140)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:316)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:153)
        at org.apache.maven.cli.MavenCli.execute(MavenCli.java:451)
        at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:188)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:134)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
        at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
        at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
Caused by: org.apache.maven.plugin.MojoExecutionException: fileC:\server-config.wsdd (The filename, directory name, or volume label syntax is incorrect)
        at com.liferay.maven.plugins.AbstractLiferayMojo.execute(AbstractLiferayMojo.java:72)
        at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:107)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:195)
        ... 19 more
Caused by: java.io.FileNotFoundException: fileC:\server-config.wsdd (The filename, directory name, or volume label syntax is incorrect)
        at java.io.FileOutputStream.open(Native Method)
        at java.io.FileOutputStream.<init>(FileOutputStream.java:179)
        at com.liferay.portal.util.FileImpl.write(FileImpl.java:789)
        at com.liferay.portal.util.FileImpl.write(FileImpl.java:768)
        at com.liferay.portal.util.FileImpl.write(FileImpl.java:764)
        at com.liferay.portal.util.FileImpl.write(FileImpl.java:805)
        at com.liferay.portal.kernel.util.FileUtil.write(FileUtil.java:328)
        at com.liferay.portal.tools.WSDDBuilder.build(WSDDBuilder.java:60)
        at com.liferay.maven.plugins.WSDDBuilderMojo.doExecute(WSDDBuilderMojo.java:33)
</init>


It would it be great help. if you attach your pom.xml and also the command that you used to generate wsdd.

Thanks & Regards,
Amit Doshi
Ramon Garcia, geändert vor 11 Jahren.

RE: build-wsdd goal not able to find classes in service archetype project

New Member Beiträge: 21 Beitrittsdatum: 11.02.10 Neueste Beiträge
Hi Amit,

Can you try:
mvn liferay:build-wsdd
Executing it inside the portlet project?
I do it without the use of the params...
Hope it helps...
thumbnail
Alexey Kakunin, geändert vor 11 Jahren.

RE: build-wsdd goal not able to find classes in service archetype project

Liferay Master Beiträge: 621 Beitrittsdatum: 07.07.08 Neueste Beiträge
Hi!

I've added bug for this problem into JIRA: http://issues.liferay.com/browse/MAVEN-69?focusedCommentId=278393#comment-278393

But after investigating how class-loader working in plugin (at least in 6.1.1-SNAPSHOT version) - I found what portlet/target/classes is added into classpath, so, to make build-wsdd working we just need compile generated classes.

To do it we can call mvn target after liferay:build-service but before liferay:build-wsdd

==
Alexey Kakunin
EmDev Limited
thumbnail
Amit Doshi, geändert vor 11 Jahren.

RE: build-wsdd goal not able to find classes in service archetype project

Liferay Master Beiträge: 550 Beitrittsdatum: 29.12.10 Neueste Beiträge
Hi Alexey,

Thanks for creating the ticket. I am also facing same issue.

As my project is going through tough times and I can't able to find the solution for it . So, I have to migrate it into ANT as I am not so good in MAVEN.

I will give a try as per your above comment and check it whether it is working or not.

Thanks & Regards,
Amit Doshi
Ron J, geändert vor 9 Jahren.

RE: build-wsdd goal not able to find classes in service archetype project

Junior Member Beiträge: 45 Beitrittsdatum: 18.11.12 Neueste Beiträge
Alexey Kakunin:
Hi!

I've added bug for this problem into JIRA: http://issues.liferay.com/browse/MAVEN-69?focusedCommentId=278393#comment-278393

But after investigating how class-loader working in plugin (at least in 6.1.1-SNAPSHOT version) - I found what portlet/target/classes is added into classpath, so, to make build-wsdd working we just need compile generated classes.

To do it we can call mvn target after liferay:build-service but before liferay:build-wsdd

==
Alexey Kakunin
EmDev Limited



This fix worked for me on the first build-wsdd but after making mods to the services and rerunning build-service I cannot get build-wsdd to work anymore. Has anyone experienced this?
thumbnail
Robert Smith, geändert vor 6 Jahren.

RE: build-wsdd goal not able to find classes in service archetype project

Junior Member Beiträge: 63 Beitrittsdatum: 15.10.09 Neueste Beiträge
FYI,
If you are using Liferay 7 and want to use the wsdd-builder with maven, I have found how to get the wsdd plugin to work.
  • Find the portal-kernel.jar in your bundle and place it in your classpath
  • add a <classPath> tag to your wsdd.builder <configuration> section
  • add 2 semicolon separated entries to your classpath - portal-kernel.jar;target/classes

Run your wsdd-builder:build from the service project basedir.
And thats it.
thumbnail
Hamidul Islam, geändert vor 6 Jahren.

RE: build-wsdd goal not able to find classes in service archetype project

Regular Member Beiträge: 111 Beitrittsdatum: 22.05.08 Neueste Beiträge
Robert Smith:
FYI,
If you are using Liferay 7 and want to use the wsdd-builder with maven, I have found how to get the wsdd plugin to work.
  • Find the portal-kernel.jar in your bundle and place it in your classpath
  • add a <classPath> tag to your wsdd.builder <configuration> section
  • add 2 semicolon separated entries to your classpath - portal-kernel.jar;target/classes

Run your wsdd-builder:build from the service project basedir.
And thats it.

Hi Robert,
I am using Liferay 7. Here is my configuration
<classPath>C:/Users/hamidul.islam/Desktop/com.liferay.portal.kernel-2.6.0.jar;target/classes</classPath>
Note: I have kept com.liferay.portal.kernel-2.6.0.jar in class path also

I am still getting the same error.Can you please help me?

Regards
Hamidul Islam