[xwiki-users] Help using m2eclipse to create an Xwiki java Macro
I'm hoping to create a simple Xwiki macro to allow users an easy way to create local file:// links to internal network shares through the WYSIWYG macros feature. This is also an excuse for me to try to get m2eclipse to work for building Xwiki as well. However, so far the plugin doesn't seem to be working right. I'm generally following the guide here: http://platform.xwiki.org/xwiki/bin/view/DevGuide/RenderingMacroTutorial#HCr... I first attempted at using Eclipse's m2eclipse plugin to create a new maven project, but had some troubles with this. I first added a maven archetypes catalog through the Window->Preferences->Maven->Archetypes menu. I added a remote catalog using the url "http://svn.xwiki.org/svnroot/xwiki/platform/xwiki-tools/trunk/xwiki-archetyp...". Then, by going through the new maven project wizard, I checked the "include snapshot archetypes" box and the xwiki-archetype-macro shows up. I then fill out the input boxes, for example something like: Group ID: com.lyraphase Artifact ID: localFileLinkMacro Version: 0.0.1-SNAPSHOT Package: com.lyraphase I click finish and it simply says "Failed to create project". The event details for the error in the log are: -------------------------------------------- eclipse.buildId=unknown java.version=1.6.0_20 java.vendor=Sun Microsystems Inc. BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_US Framework arguments: -product org.eclipse.epp.package.php.product Command-line arguments: -os win32 -ws win32 -arch x86 -product org.eclipse.epp.package.php.product Error Tue May 25 18:28:55 MDT 2010 Failed to create project. java.lang.NullPointerException at org.apache.maven.artifact.repository.DefaultArtifactRepositoryFactory.createArtifactRepository(DefaultArtifactRepositoryFactory.java:90) at org.maven.ide.eclipse.internal.project.ProjectConfigurationManager.resolveArchetype(ProjectConfigurationManager.java:540) at org.maven.ide.eclipse.internal.project.ProjectConfigurationManager.createArchetypeProject(ProjectConfigurationManager.java:463) at org.maven.ide.eclipse.wizards.MavenProjectWizard$5.runInWorkspace(MavenProjectWizard.java:279) at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:38) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55) -------------------------------------------- I then gave up on that, and just made a new directory and ran the maven command line mentioned in the Macro Tutorial through Cygwin. I entered the Group ID, etc... The command seemed to work, however again m2eclipse chokes on missing maven dependencies after doing a "Import -> Existing Maven Project". The console log in Eclipse also shows *tons* of warnings about checksums failing and some missing pom files. For example: 5/25/10 6:02:18 PM MDT: [WARN] *** CHECKSUM FAILED - Checksum failed on download: local = 'f4993fe96db30ae57ca4d71e34ebe200b63981b6'; remote = 'eaf4f3d8c6ee17e73ca671a496a4b307f83aed63' - IGNORING 5/25/10 6:02:19 PM MDT: [WARN] *** CHECKSUM FAILED - Checksum failed on download: local = 'aaeb993ef6348a2e5102df06b408d8bb220d609e'; remote = '79231f9f429a3ba10c5d260b4e683fe7599498d0' - IGNORING Most of that stuff is uninteresting, but I snipped out some of the more interesting messages I found within the mess. -------------------------------------------- 5/25/10 5:46:08 PM MDT: Unable to update index for xwiki-externals|http://maven.xwiki.org/externals: Resource nexus-maven-repository-index.properties does not exist 5/25/10 5:52:57 PM MDT: Missing artifact org.xwiki.platform:xwiki-core-rendering-parser-wikimodel:jar:2.3-SNAPSHOT:compile 5/25/10 5:46:10 PM MDT: Unable to update index for xwiki-plugins-externals|http://maven.xwiki.org/externals: Resource nexus-maven-repository-index.properties does not exist 5/25/10 5:52:57 PM MDT: Missing artifact org.xwiki.platform:xwiki-core-rendering-parser-wikimodel:jar:2.3-SNAPSHOT:compile 5/25/10 6:02:19 PM MDT: Missing artifact org.xwiki.platform:xwiki-core-rendering-parser-wikimodel:jar:2.3-SNAPSHOT:compile 5/25/10 6:02:24 PM MDT: Maven Builder: FULL_BUILD 5/25/10 6:02:24 PM MDT: Build errors for localFileLinkMacro; org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal on project localFileLinkMacro: Missing: ---------- 1) org.xwiki.platform:xwiki-core-rendering-parser-wikimodel:jar:2.3-SNAPSHOT Try downloading the file manually from the project website. Then, install it using the command: mvn install:install-file -DgroupId=org.xwiki.platform -DartifactId=xwiki-core-rendering-parser-wikimodel -Dversion=2.3-SNAPSHOT -Dpackaging=jar -Dfile=/path/to/file Alternatively, if you host your own repository you can deploy the file there: mvn deploy:deploy-file -DgroupId=org.xwiki.platform -DartifactId=xwiki-core-rendering-parser-wikimodel -Dversion=2.3-SNAPSHOT -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id] Path to dependency: 1) com.lyraphase:localFileLinkMacro:pom:pom:1.0-SNAPSHOT 2) org.xwiki.platform:xwiki-core-rendering-parser-wikimodel:jar:2.3-SNAPSHOT ---------- 1 required artifact is missing. for artifact: com.lyraphase:localFileLinkMacro:pom:1.0-SNAPSHOT from the specified remote repositories: xwiki-externals (http://maven.xwiki.org/externals, releases=true, snapshots=true), xwiki-releases (http://maven.xwiki.org/releases, releases=true, snapshots=false), xwiki-snapshots (http://maven.xwiki.org/snapshots, releases=false, snapshots=true), central (http://repo1.maven.org/maven2, releases=true, snapshots=false) --------------------------------------------
Hi James, I don't know what the problem is with m2eclipse (I haven't used it to run an archetype) but for the second problem it was because of an invalid dependency. I've fixed it in SVN. For now you can simply edit the generated pom.xml and replace xwiki-core-rendering-parser-wikimodel with xwiki-core-rendering-syntax-wikimodel Thanks for reporting this. -Vincent On May 26, 2010, at 2:43 AM, James Cuzella wrote:
I'm hoping to create a simple Xwiki macro to allow users an easy way to create local file:// links to internal network shares through the WYSIWYG macros feature. This is also an excuse for me to try to get m2eclipse to work for building Xwiki as well. However, so far the plugin doesn't seem to be working right.
I'm generally following the guide here: http://platform.xwiki.org/xwiki/bin/view/DevGuide/RenderingMacroTutorial#HCr...
I first attempted at using Eclipse's m2eclipse plugin to create a new maven project, but had some troubles with this. I first added a maven archetypes catalog through the Window->Preferences->Maven->Archetypes menu. I added a remote catalog using the url "http://svn.xwiki.org/svnroot/xwiki/platform/xwiki-tools/trunk/xwiki-archetyp...".
Then, by going through the new maven project wizard, I checked the "include snapshot archetypes" box and the xwiki-archetype-macro shows up. I then fill out the input boxes, for example something like:
Group ID: com.lyraphase Artifact ID: localFileLinkMacro Version: 0.0.1-SNAPSHOT Package: com.lyraphase
I click finish and it simply says "Failed to create project". The event details for the error in the log are: -------------------------------------------- eclipse.buildId=unknown java.version=1.6.0_20 java.vendor=Sun Microsystems Inc. BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_US Framework arguments: -product org.eclipse.epp.package.php.product Command-line arguments: -os win32 -ws win32 -arch x86 -product org.eclipse.epp.package.php.product
Error Tue May 25 18:28:55 MDT 2010 Failed to create project.
java.lang.NullPointerException at org.apache.maven.artifact.repository.DefaultArtifactRepositoryFactory.createArtifactRepository(DefaultArtifactRepositoryFactory.java:90) at org.maven.ide.eclipse.internal.project.ProjectConfigurationManager.resolveArchetype(ProjectConfigurationManager.java:540) at org.maven.ide.eclipse.internal.project.ProjectConfigurationManager.createArchetypeProject(ProjectConfigurationManager.java:463) at org.maven.ide.eclipse.wizards.MavenProjectWizard$5.runInWorkspace(MavenProjectWizard.java:279) at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:38) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55) --------------------------------------------
I then gave up on that, and just made a new directory and ran the maven command line mentioned in the Macro Tutorial through Cygwin. I entered the Group ID, etc... The command seemed to work, however again m2eclipse chokes on missing maven dependencies after doing a "Import -> Existing Maven Project". The console log in Eclipse also shows *tons* of warnings about checksums failing and some missing pom files. For example:
5/25/10 6:02:18 PM MDT: [WARN] *** CHECKSUM FAILED - Checksum failed on download: local = 'f4993fe96db30ae57ca4d71e34ebe200b63981b6'; remote = 'eaf4f3d8c6ee17e73ca671a496a4b307f83aed63' - IGNORING 5/25/10 6:02:19 PM MDT: [WARN] *** CHECKSUM FAILED - Checksum failed on download: local = 'aaeb993ef6348a2e5102df06b408d8bb220d609e'; remote = '79231f9f429a3ba10c5d260b4e683fe7599498d0' - IGNORING
Most of that stuff is uninteresting, but I snipped out some of the more interesting messages I found within the mess.
-------------------------------------------- 5/25/10 5:46:08 PM MDT: Unable to update index for xwiki-externals|http://maven.xwiki.org/externals: Resource nexus-maven-repository-index.properties does not exist
5/25/10 5:52:57 PM MDT: Missing artifact org.xwiki.platform:xwiki-core-rendering-parser-wikimodel:jar:2.3-SNAPSHOT:compile
5/25/10 5:46:10 PM MDT: Unable to update index for xwiki-plugins-externals|http://maven.xwiki.org/externals: Resource nexus-maven-repository-index.properties does not exist
5/25/10 5:52:57 PM MDT: Missing artifact org.xwiki.platform:xwiki-core-rendering-parser-wikimodel:jar:2.3-SNAPSHOT:compile
5/25/10 6:02:19 PM MDT: Missing artifact org.xwiki.platform:xwiki-core-rendering-parser-wikimodel:jar:2.3-SNAPSHOT:compile 5/25/10 6:02:24 PM MDT: Maven Builder: FULL_BUILD 5/25/10 6:02:24 PM MDT: Build errors for localFileLinkMacro; org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal on project localFileLinkMacro: Missing: ---------- 1) org.xwiki.platform:xwiki-core-rendering-parser-wikimodel:jar:2.3-SNAPSHOT
Try downloading the file manually from the project website.
Then, install it using the command: mvn install:install-file -DgroupId=org.xwiki.platform -DartifactId=xwiki-core-rendering-parser-wikimodel -Dversion=2.3-SNAPSHOT -Dpackaging=jar -Dfile=/path/to/file
Alternatively, if you host your own repository you can deploy the file there: mvn deploy:deploy-file -DgroupId=org.xwiki.platform -DartifactId=xwiki-core-rendering-parser-wikimodel -Dversion=2.3-SNAPSHOT -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]
Path to dependency: 1) com.lyraphase:localFileLinkMacro:pom:pom:1.0-SNAPSHOT 2) org.xwiki.platform:xwiki-core-rendering-parser-wikimodel:jar:2.3-SNAPSHOT
---------- 1 required artifact is missing.
for artifact: com.lyraphase:localFileLinkMacro:pom:1.0-SNAPSHOT
from the specified remote repositories: xwiki-externals (http://maven.xwiki.org/externals, releases=true, snapshots=true), xwiki-releases (http://maven.xwiki.org/releases, releases=true, snapshots=false), xwiki-snapshots (http://maven.xwiki.org/snapshots, releases=false, snapshots=true), central (http://repo1.maven.org/maven2, releases=true, snapshots=false) --------------------------------------------
I could not say what was the issue with M2Eclipse because i never use archetypes (when i need to do a new macro i generally copy/paste an existing one) but it's possible it just because it was unable to properly parse the pom.xml because of the dependency issue. For example M2Eclipse is generally unable to finish importing a project when there is an issue in the pom.xml file. On Wed, May 26, 2010 at 08:10, Vincent Massol <[email protected]> wrote:
Hi James,
I don't know what the problem is with m2eclipse (I haven't used it to run an archetype) but for the second problem it was because of an invalid dependency. I've fixed it in SVN.
For now you can simply edit the generated pom.xml and replace xwiki-core-rendering-parser-wikimodel
with
xwiki-core-rendering-syntax-wikimodel
Thanks for reporting this. -Vincent
On May 26, 2010, at 2:43 AM, James Cuzella wrote:
I'm hoping to create a simple Xwiki macro to allow users an easy way to create local file:// links to internal network shares through the WYSIWYG macros feature. This is also an excuse for me to try to get m2eclipse to work for building Xwiki as well. However, so far the plugin doesn't seem to be working right.
I'm generally following the guide here: http://platform.xwiki.org/xwiki/bin/view/DevGuide/RenderingMacroTutorial#HCr...
I first attempted at using Eclipse's m2eclipse plugin to create a new maven project, but had some troubles with this. I first added a maven archetypes catalog through the Window->Preferences->Maven->Archetypes menu. I added a remote catalog using the url "http://svn.xwiki.org/svnroot/xwiki/platform/xwiki-tools/trunk/xwiki-archetyp...".
Then, by going through the new maven project wizard, I checked the "include snapshot archetypes" box and the xwiki-archetype-macro shows up. I then fill out the input boxes, for example something like:
Group ID: com.lyraphase Artifact ID: localFileLinkMacro Version: 0.0.1-SNAPSHOT Package: com.lyraphase
I click finish and it simply says "Failed to create project". The event details for the error in the log are: -------------------------------------------- eclipse.buildId=unknown java.version=1.6.0_20 java.vendor=Sun Microsystems Inc. BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_US Framework arguments: -product org.eclipse.epp.package.php.product Command-line arguments: -os win32 -ws win32 -arch x86 -product org.eclipse.epp.package.php.product
Error Tue May 25 18:28:55 MDT 2010 Failed to create project.
java.lang.NullPointerException at org.apache.maven.artifact.repository.DefaultArtifactRepositoryFactory.createArtifactRepository(DefaultArtifactRepositoryFactory.java:90) at org.maven.ide.eclipse.internal.project.ProjectConfigurationManager.resolveArchetype(ProjectConfigurationManager.java:540) at org.maven.ide.eclipse.internal.project.ProjectConfigurationManager.createArchetypeProject(ProjectConfigurationManager.java:463) at org.maven.ide.eclipse.wizards.MavenProjectWizard$5.runInWorkspace(MavenProjectWizard.java:279) at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:38) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55) --------------------------------------------
I then gave up on that, and just made a new directory and ran the maven command line mentioned in the Macro Tutorial through Cygwin. I entered the Group ID, etc... The command seemed to work, however again m2eclipse chokes on missing maven dependencies after doing a "Import -> Existing Maven Project". The console log in Eclipse also shows *tons* of warnings about checksums failing and some missing pom files. For example:
5/25/10 6:02:18 PM MDT: [WARN] *** CHECKSUM FAILED - Checksum failed on download: local = 'f4993fe96db30ae57ca4d71e34ebe200b63981b6'; remote = 'eaf4f3d8c6ee17e73ca671a496a4b307f83aed63' - IGNORING 5/25/10 6:02:19 PM MDT: [WARN] *** CHECKSUM FAILED - Checksum failed on download: local = 'aaeb993ef6348a2e5102df06b408d8bb220d609e'; remote = '79231f9f429a3ba10c5d260b4e683fe7599498d0' - IGNORING
Most of that stuff is uninteresting, but I snipped out some of the more interesting messages I found within the mess.
-------------------------------------------- 5/25/10 5:46:08 PM MDT: Unable to update index for xwiki-externals|http://maven.xwiki.org/externals: Resource nexus-maven-repository-index.properties does not exist
5/25/10 5:52:57 PM MDT: Missing artifact org.xwiki.platform:xwiki-core-rendering-parser-wikimodel:jar:2.3-SNAPSHOT:compile
5/25/10 5:46:10 PM MDT: Unable to update index for xwiki-plugins-externals|http://maven.xwiki.org/externals: Resource nexus-maven-repository-index.properties does not exist
5/25/10 5:52:57 PM MDT: Missing artifact org.xwiki.platform:xwiki-core-rendering-parser-wikimodel:jar:2.3-SNAPSHOT:compile
5/25/10 6:02:19 PM MDT: Missing artifact org.xwiki.platform:xwiki-core-rendering-parser-wikimodel:jar:2.3-SNAPSHOT:compile 5/25/10 6:02:24 PM MDT: Maven Builder: FULL_BUILD 5/25/10 6:02:24 PM MDT: Build errors for localFileLinkMacro; org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal on project localFileLinkMacro: Missing: ---------- 1) org.xwiki.platform:xwiki-core-rendering-parser-wikimodel:jar:2.3-SNAPSHOT
Try downloading the file manually from the project website.
Then, install it using the command: mvn install:install-file -DgroupId=org.xwiki.platform -DartifactId=xwiki-core-rendering-parser-wikimodel -Dversion=2.3-SNAPSHOT -Dpackaging=jar -Dfile=/path/to/file
Alternatively, if you host your own repository you can deploy the file there: mvn deploy:deploy-file -DgroupId=org.xwiki.platform -DartifactId=xwiki-core-rendering-parser-wikimodel -Dversion=2.3-SNAPSHOT -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]
Path to dependency: 1) com.lyraphase:localFileLinkMacro:pom:pom:1.0-SNAPSHOT 2) org.xwiki.platform:xwiki-core-rendering-parser-wikimodel:jar:2.3-SNAPSHOT
---------- 1 required artifact is missing.
for artifact: com.lyraphase:localFileLinkMacro:pom:1.0-SNAPSHOT
from the specified remote repositories: xwiki-externals (http://maven.xwiki.org/externals, releases=true, snapshots=true), xwiki-releases (http://maven.xwiki.org/releases, releases=true, snapshots=false), xwiki-snapshots (http://maven.xwiki.org/snapshots, releases=false, snapshots=true), central (http://repo1.maven.org/maven2, releases=true, snapshots=false) --------------------------------------------
users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
-- Thomas Mortagne
On Wed, May 26, 2010 at 12:10 AM, Vincent Massol <[email protected]> wrote:
Hi James,
I don't know what the problem is with m2eclipse (I haven't used it to run an archetype) but for the second problem it was because of an invalid dependency. I've fixed it in SVN.
For now you can simply edit the generated pom.xml and replace xwiki-core-rendering-parser-wikimodel
with
xwiki-core-rendering-syntax-wikimodel
Thanks for reporting this. -Vincent
Thanks, that fixed it! Now have Eclipse working pretty well for coding, however I'm confused how I can debug or run my code within Eclipse for testing. It appears to me that the maven build process is working. When I click on "Run" or "Debug" it also looks like it is able to start a Tomcat 6.0 instance on my local machine. However, going to either "http://localhost" or "http://localhost/xwiki" in my browser results in an "unable to connect" message. I tried right clicking on the server instance within the "Servers" tab in Eclipse and choosing "Add and Remove" and then added the only thing in the list ("xem-web-debug" ) to the "Configured" resources side of the dialog. This results in the following error: eclipse.buildId=unknown java.version=1.6.0_20 java.vendor=Sun Microsystems Inc. BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_US Framework arguments: -product org.eclipse.epp.package.php.product Command-line arguments: -os win32 -ws win32 -arch x86 -product org.eclipse.epp.package.php.product Error Thu May 27 17:07:44 MDT 2010 Task failed org.eclipse.core.runtime.CoreException: Publishing failed with multiple errors at org.eclipse.jst.server.tomcat.core.internal.PublishOperation2.throwException(PublishOperation2.java:169) at org.eclipse.jst.server.tomcat.core.internal.PublishOperation2.execute(PublishOperation2.java:82) at org.eclipse.wst.server.core.model.ServerBehaviourDelegate.performTasks(ServerBehaviourDelegate.java:1136) at org.eclipse.wst.server.core.model.ServerBehaviourDelegate.publish(ServerBehaviourDelegate.java:853) at org.eclipse.wst.server.core.model.ServerBehaviourDelegate.publish(ServerBehaviourDelegate.java:708) at org.eclipse.wst.server.core.internal.Server.publishImpl(Server.java:2731) at org.eclipse.wst.server.core.internal.Server$PublishJob.run(Server.java:278) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55) Contains: File not found: /xem-web-debug/src/main/webapp/WEB-INF/commons-logging.properties. Contains: File not found: /xem-web-debug/src/main/webapp/WEB-INF/portlet.xml. Contains: File not found: /xem-web-debug/src/main/webapp/WEB-INF/struts-bean.tld. Contains: File not found: /xem-web-debug/src/main/webapp/WEB-INF/struts-config.xml. Contains: File not found: /xem-web-debug/src/main/webapp/WEB-INF/struts-form.tld. Contains: File not found: /xem-web-debug/src/main/webapp/WEB-INF/struts-html.tld. Contains: File not found: /xem-web-debug/src/main/webapp/WEB-INF/struts-logic.tld. Contains: File not found: /xem-web-debug/src/main/webapp/WEB-INF/struts-template.tld. Contains: File not found: /xem-web-debug/src/main/webapp/WEB-INF/struts.tld. Contains: File not found: /xem-web-debug/src/main/webapp/WEB-INF/web.xml. Contains: File not found: /xem-web-debug/src/main/webapp/redirect. ---------------------------------------------------- Am I doing this right? Thanks again, - James Cuzella
On May 28, 2010, at 1:16 AM, James Cuzella wrote:
On Wed, May 26, 2010 at 12:10 AM, Vincent Massol <[email protected]> wrote:
Hi James,
I don't know what the problem is with m2eclipse (I haven't used it to run an archetype) but for the second problem it was because of an invalid dependency. I've fixed it in SVN.
For now you can simply edit the generated pom.xml and replace xwiki-core-rendering-parser-wikimodel
with
xwiki-core-rendering-syntax-wikimodel
Thanks for reporting this. -Vincent
Thanks, that fixed it! Now have Eclipse working pretty well for coding, however I'm confused how I can debug or run my code within Eclipse for testing.
See http://dev.xwiki.org/xwiki/bin/view/Community/Debugging There's a tutorial there for debugging in Eclipse. Thanks -Vincent
It appears to me that the maven build process is working. When I click on "Run" or "Debug" it also looks like it is able to start a Tomcat 6.0 instance on my local machine. However, going to either "http://localhost" or "http://localhost/xwiki" in my browser results in an "unable to connect" message.
I tried right clicking on the server instance within the "Servers" tab in Eclipse and choosing "Add and Remove" and then added the only thing in the list ("xem-web-debug" ) to the "Configured" resources side of the dialog.
This results in the following error:
eclipse.buildId=unknown java.version=1.6.0_20 java.vendor=Sun Microsystems Inc. BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_US Framework arguments: -product org.eclipse.epp.package.php.product Command-line arguments: -os win32 -ws win32 -arch x86 -product org.eclipse.epp.package.php.product
Error Thu May 27 17:07:44 MDT 2010 Task failed
org.eclipse.core.runtime.CoreException: Publishing failed with multiple errors at org.eclipse.jst.server.tomcat.core.internal.PublishOperation2.throwException(PublishOperation2.java:169) at org.eclipse.jst.server.tomcat.core.internal.PublishOperation2.execute(PublishOperation2.java:82) at org.eclipse.wst.server.core.model.ServerBehaviourDelegate.performTasks(ServerBehaviourDelegate.java:1136) at org.eclipse.wst.server.core.model.ServerBehaviourDelegate.publish(ServerBehaviourDelegate.java:853) at org.eclipse.wst.server.core.model.ServerBehaviourDelegate.publish(ServerBehaviourDelegate.java:708) at org.eclipse.wst.server.core.internal.Server.publishImpl(Server.java:2731) at org.eclipse.wst.server.core.internal.Server$PublishJob.run(Server.java:278) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55) Contains: File not found: /xem-web-debug/src/main/webapp/WEB-INF/commons-logging.properties. Contains: File not found: /xem-web-debug/src/main/webapp/WEB-INF/portlet.xml. Contains: File not found: /xem-web-debug/src/main/webapp/WEB-INF/struts-bean.tld. Contains: File not found: /xem-web-debug/src/main/webapp/WEB-INF/struts-config.xml. Contains: File not found: /xem-web-debug/src/main/webapp/WEB-INF/struts-form.tld. Contains: File not found: /xem-web-debug/src/main/webapp/WEB-INF/struts-html.tld. Contains: File not found: /xem-web-debug/src/main/webapp/WEB-INF/struts-logic.tld. Contains: File not found: /xem-web-debug/src/main/webapp/WEB-INF/struts-template.tld. Contains: File not found: /xem-web-debug/src/main/webapp/WEB-INF/struts.tld. Contains: File not found: /xem-web-debug/src/main/webapp/WEB-INF/web.xml. Contains: File not found: /xem-web-debug/src/main/webapp/redirect.
----------------------------------------------------
Am I doing this right?
Thanks again, - James Cuzella _______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
On Fri, May 28, 2010 at 12:46 AM, Vincent Massol <[email protected]> wrote:
On May 28, 2010, at 1:16 AM, James Cuzella wrote:
On Wed, May 26, 2010 at 12:10 AM, Vincent Massol <[email protected]> wrote:
Hi James,
I don't know what the problem is with m2eclipse (I haven't used it to run an archetype) but for the second problem it was because of an invalid dependency. I've fixed it in SVN.
For now you can simply edit the generated pom.xml and replace xwiki-core-rendering-parser-wikimodel
with
xwiki-core-rendering-syntax-wikimodel
Thanks for reporting this. -Vincent
Thanks, that fixed it! Now have Eclipse working pretty well for coding, however I'm confused how I can debug or run my code within Eclipse for testing.
See http://dev.xwiki.org/xwiki/bin/view/Community/Debugging
There's a tutorial there for debugging in Eclipse.
Thanks -Vincent
I had been following this guide, however I must have missed the part about changing the JVM arguments for the tomcat service on windows. I currently am having troubles building Xwiki from source within Eclipse, so I tested whether the debug function works by simply adding the current xwiki-enterprise WAR from the download page. (I basically just created a JAR from the configured instance of Xwiki that I had previously set up for testing). Now, I'm running into yet another maven issue when trying to get it compiled from source: [INFO] Scanning for projects... [WARNING] [WARNING] Some problems were encountered while building the effective model for com.xpn.xwiki.platform:xwiki-core:jar:2.4-SNAPSHOT [WARNING] The expression ${pom.version} is deprecated. Please use ${project.version} instead. @ com.xpn.xwiki.platform:xwiki-core:2.4-SNAPSHOT, C:\Documents and Settings\jcuzella\My Documents\src\eclipse_workspace\xwiki-all\core\xwiki-core\pom.xml [WARNING] [WARNING] It is highly recommended to fix these problems because they threaten the stability of your build. [WARNING] [WARNING] For this reason, future Maven versions might no longer support building such malformed projects. [WARNING] [INFO] [INFO] ------------------------------------------------------------------------ [INFO] Building XWiki Platform - Core - Core 2.4-SNAPSHOT [INFO] ------------------------------------------------------------------------ [WARNING] Missing POM for velocity-tools:velocity-tools:jar:1.4 [WARNING] Missing POM for org.xwiki.platform:xwiki-core-rendering-macro-id:jar:2.4-SNAPSHOT [INFO] [INFO] --- maven-enforcer-plugin:1.0-beta-1:enforce (default) @ xwiki-core --- [INFO] [INFO] --- aspectj-maven-plugin:1.0-beta-2:compile (backward-compatibility-aspects) @ xwiki-core --- [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 2.657s [INFO] Finished at: Fri May 28 16:03:40 MDT 2010 [INFO] Final Memory: 4M/15M [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.codehaus.mojo:aspectj-maven-plugin:1.0-beta-2:compile (backward-compatibility-aspects) on project xwiki-core: Execution backward-compatibility-aspects of goal org.codehaus.mojo:aspectj-maven-plugin:1.0-beta-2:compile failed: Plugin org.codehaus.mojo:aspectj-maven-plugin:1.0-beta-2 or one of its dependencies could not be resolved: Missing: ---------- 1) com.sun:tools:jar:1.4.2 Try downloading the file manually from the project website. Then, install it using the command: mvn install:install-file -DgroupId=com.sun -DartifactId=tools -Dversion=1.4.2 -Dpackaging=jar -Dfile=/path/to/file Alternatively, if you host your own repository you can deploy the file there: mvn deploy:deploy-file -DgroupId=com.sun -DartifactId=tools -Dversion=1.4.2 -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id] Path to dependency: 1) org.codehaus.mojo:aspectj-maven-plugin:maven-plugin:1.0-beta-2 2) com.sun:tools:jar:1.4.2 ---------- 1 required artifact is missing. for artifact: org.codehaus.mojo:aspectj-maven-plugin:maven-plugin:1.0-beta-2 from the specified remote repositories: xwiki-plugins-externals (http://maven.xwiki.org/externals, releases=true, snapshots=true), xwiki-plugins-releases (http://maven.xwiki.org/releases, releases=true, snapshots=false), xwiki-plugins-snapshots (http://maven.xwiki.org/snapshots, releases=false, snapshots=true), central (http://repo1.maven.org/maven2, releases=true, snapshots=false) -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginResolutionException
On 05/29/2010 12:05 AM, James Cuzella wrote:
On Fri, May 28, 2010 at 12:46 AM, Vincent Massol<[email protected]> wrote:
On May 28, 2010, at 1:16 AM, James Cuzella wrote:
On Wed, May 26, 2010 at 12:10 AM, Vincent Massol<[email protected]> wrote:
Hi James,
I don't know what the problem is with m2eclipse (I haven't used it to run an archetype) but for the second problem it was because of an invalid dependency. I've fixed it in SVN.
For now you can simply edit the generated pom.xml and replace xwiki-core-rendering-parser-wikimodel
with
xwiki-core-rendering-syntax-wikimodel
Thanks for reporting this. -Vincent
Thanks, that fixed it! Now have Eclipse working pretty well for coding, however I'm confused how I can debug or run my code within Eclipse for testing.
Actually I think you should have a look at http://svn.xwiki.org/svnroot/xwiki/platform/xwiki-tools/trunk/xem-web-debug-...
It's an Eclipse project that is already configured for hacking XE. Just follow the instruction in the README.txt It's true that you should complement that information with that you found on the Wiki page (e.g., AspectJ configuration, etc.) Anyway I think that you should definitely start from the xem-web-debug-eclipse project. -Fabio
On Mon, May 31, 2010 at 4:49 AM, Fabio Mancinelli <[email protected]> wrote:
On 05/29/2010 12:05 AM, James Cuzella wrote:
On Fri, May 28, 2010 at 12:46 AM, Vincent Massol<[email protected]> wrote:
On May 28, 2010, at 1:16 AM, James Cuzella wrote:
On Wed, May 26, 2010 at 12:10 AM, Vincent Massol<[email protected]> wrote:
Hi James,
I don't know what the problem is with m2eclipse (I haven't used it to run an archetype) but for the second problem it was because of an invalid dependency. I've fixed it in SVN.
For now you can simply edit the generated pom.xml and replace xwiki-core-rendering-parser-wikimodel
with
xwiki-core-rendering-syntax-wikimodel
Thanks for reporting this. -Vincent
Thanks, that fixed it! Now have Eclipse working pretty well for coding, however I'm confused how I can debug or run my code within Eclipse for testing.
Actually I think you should have a look at http://svn.xwiki.org/svnroot/xwiki/platform/xwiki-tools/trunk/xem-web-debug-...
It's an Eclipse project that is already configured for hacking XE. Just follow the instruction in the README.txt
It's true that you should complement that information with that you found on the Wiki page (e.g., AspectJ configuration, etc.)
Anyway I think that you should definitely start from the xem-web-debug-eclipse project.
-Fabio
Thanks for pointing me towards the README, I'm pretty sure there was no mention of this on the wiki pages I was following. I now set the variables mentioned to point to my checked out xwiki source code. Also, I've tried to follow all the instructions I could find on the wiki (spread out between many pages) multiple times. Sadly, Eclipse just doesn't want to cooperate with me... now it's giving me yet another error :-( The main reason why I hate Eclipse for development is due to the initial project setup and inevitable problems with one's workspace environment that always seem to pop up for me. Is anyone actually developing Xwiki from Windows, or does it require a Linux environment (for symlinks, and a more sane environment)? Anyway, the latest error message seems potentially connected to the file link stuff mentioned in the README file... however, I just don't know where to look anymore as I've gone through the steps multiple times now, checked, and re-checked all my settings. Here's the error: ---------------------------------------------------- Publishing failed with multiple errors: Resource is out of sync with the file system: '/xem-web-debug/src/main/webapp/redirect'. Resource is out of sync with the file system: '/xem-web-debug/src/main/webapp/WEB-INF/web.xml'. Resource is out of sync with the file system: '/xem-web-debug/src/main/webapp/WEB-INF/struts.tld'. Resource is out of sync with the file system: '/xem-web-debug/src/main/webapp/WEB-INF/struts-template.tld'. Resource is out of sync with the file system: '/xem-web-debug/src/main/webapp/WEB-INF/struts-logic.tld'. Resource is out of sync with the file system: '/xem-web-debug/src/main/webapp/WEB-INF/struts-form.tld'. Resource is out of sync with the file system: '/xem-web-debug/src/main/webapp/WEB-INF/portlet.xml'. Resource is out of sync with the file system: '/xem-web-debug/src/main/webapp/WEB-INF/commons-logging.properties'. ---------------------------------------------------- The Apache Tomcat server is started by Eclipse, and I can access the admin pages through http://localhost:8080/. It looks like it's not publishing the files correctly. In Eclipse's server window it says "Tomcat v6.0 Server at localhost [Debugging, Republish]" and stays that way. I can go to Tomcat's "List Applications" page, and it shows xwiki listed there. However, trying to access http://localhost:8080/xwiki gives a 404 message. Does anyone have a working eclipse workspace for the example macro here? http://platform.xwiki.org/xwiki/bin/view/DevGuide/RenderingMacroTutorial Working with Eclipse can really be a pain sometimes. Thanks, - James Cuzella
I managed to get rid of the "Resource is out of sync" issue with Eclipse by doing an SVN update on xem-web-debug and the xwiki trunks. I then refreshed all projects within Eclipse... But... now it gives more errors! o_0 What a mess... ------------------------------------------------------- Jun 1, 2010 2:18:03 PM org.apache.catalina.core.AprLifecycleListener init INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Java\jre6\bin;.;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;E:\epd2005sp3\2005EXP\SDD_HOME\common\win32\bin;E:\epd2005sp3\2005EXP\SDD_HOME\common\win32\lib;C:\Xilinx\10.1\EDK\bin\nt;C:\Xilinx\10.1\EDK\lib\nt;C:\Xilinx\10.1\ISE\bin\nt;C:\Xilinx\10.1\ISE\lib\nt;C:\Xilinx\10.1\ISE\smartmodel\nt\installed_nt\lib\pcnt.lib;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\Novell\GroupWise;E:\epd2005sp3\2005EXP\MGC_HOME.ixn\bin;E:\epd2005sp3\2005EXP\MGC_HOME.ixn\lib;E:/epd2005sp3/2005EXP/MGC_HOME.ixn\bin;E:/epd2005sp3/2005EXP/MGC_HOME.ixn\lib;C:\Program Files\MATLAB\R2008a\bin;C:\Program Files\MATLAB\R2008a\bin\win32;C:\Xilinx\10.1\ChipScope\bin\nt;C:\Program Files\QuickTime\QTSystem\;C:\WINDOWS\system32\WindowsPowerShell\v1.0;C:\Program Files\Support Tools\;C:\Documents and Settings\jcuzella\My Documents\bin;C:\Documents and Settings\jcuzella\My Documents\bin\apache-maven-2.2.1\bin;C:\Program Files\MySQL\MySQL Server 5.1\bin;C:\Program Files\Java\jdk1.6.0_20\bin Jun 1, 2010 2:18:03 PM org.apache.tomcat.util.digester.SetPropertiesRule begin WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.j2ee.server:xem-web-debug' did not find a matching property. Jun 1, 2010 2:18:03 PM org.apache.coyote.http11.Http11Protocol init INFO: Initializing Coyote HTTP/1.1 on http-8080 Jun 1, 2010 2:18:03 PM org.apache.catalina.startup.Catalina load INFO: Initialization processed in 1288 ms Jun 1, 2010 2:18:04 PM org.apache.catalina.core.StandardService start INFO: Starting service Catalina Jun 1, 2010 2:18:04 PM org.apache.catalina.core.StandardEngine start INFO: Starting Servlet Engine: Apache Tomcat/6.0.26 Jun 1, 2010 2:18:09 PM org.apache.catalina.loader.WebappClassLoader validateJarFile INFO: validateJarFile(C:\Program Files\Apache Software Foundation\Tomcat 6.0\wtpwebapps\xem-web-debug\WEB-INF\lib\gwt-user-2.0.0.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class Jun 1, 2010 2:18:10 PM org.apache.catalina.loader.WebappClassLoader validateJarFile INFO: validateJarFile(C:\Program Files\Apache Software Foundation\Tomcat 6.0\wtpwebapps\xem-web-debug\WEB-INF\lib\servlet-api-2.4.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class log4j:WARN No appenders could be found for logger (org.apache.commons.beanutils.converters.BooleanConverter). log4j:WARN Please initialize the log4j system properly. log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info. Jun 1, 2010 2:18:13 PM org.apache.catalina.core.StandardContext listenerStart SEVERE: Exception sending context initialized event to listener instance of class org.xwiki.container.servlet.XWikiServletContextListener java.lang.RuntimeException: Failed to find the Observation Manager component at org.xwiki.container.servlet.XWikiServletContextListener.contextInitialized(XWikiServletContextListener.java:78) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3972) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4467) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045) at org.apache.catalina.core.StandardHost.start(StandardHost.java:785) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443) at org.apache.catalina.core.StandardService.start(StandardService.java:519) at org.apache.catalina.core.StandardServer.start(StandardServer.java:710) at org.apache.catalina.startup.Catalina.start(Catalina.java:581) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414) Caused by: org.xwiki.component.manager.ComponentLookupException: Failed to lookup component [role = [org.xwiki.observation.ObservationManager] hint = [default]] at org.xwiki.component.embed.EmbeddableComponentManager.initialize(EmbeddableComponentManager.java:348) at org.xwiki.component.embed.EmbeddableComponentManager.lookup(EmbeddableComponentManager.java:99) at org.xwiki.container.servlet.XWikiServletContextListener.contextInitialized(XWikiServletContextListener.java:75) ... 15 more Caused by: org.xwiki.component.phase.InitializationException: Failed to lookup Event Listeners at org.xwiki.observation.internal.DefaultObservationManager.initialize(DefaultObservationManager.java:133) at org.xwiki.component.embed.EmbeddableComponentManager.createInstance(EmbeddableComponentManager.java:407) at org.xwiki.component.embed.EmbeddableComponentManager.initialize(EmbeddableComponentManager.java:341) ... 17 more Caused by: org.xwiki.component.manager.ComponentLookupException: Failed to lookup component [role = [org.xwiki.observation.EventListener] hint = [wikimacrolistener]] at org.xwiki.component.embed.EmbeddableComponentManager.initialize(EmbeddableComponentManager.java:348) at org.xwiki.component.embed.EmbeddableComponentManager.lookupList(EmbeddableComponentManager.java:126) at org.xwiki.component.internal.DefaultComponentManager.lookupList(DefaultComponentManager.java:105) at org.xwiki.observation.internal.DefaultObservationManager.initialize(DefaultObservationManager.java:129) ... 19 more Caused by: org.xwiki.component.manager.ComponentLookupException: Can't find descriptor for the component [role = [org.xwiki.rendering.macro.wikibridge.WikiMacroFactory] hint = [default]] at org.xwiki.component.embed.EmbeddableComponentManager.initialize(EmbeddableComponentManager.java:356) at org.xwiki.component.embed.EmbeddableComponentManager.lookup(EmbeddableComponentManager.java:109) at org.xwiki.component.embed.EmbeddableComponentManager.createInstance(EmbeddableComponentManager.java:381) at org.xwiki.component.embed.EmbeddableComponentManager.initialize(EmbeddableComponentManager.java:341) ... 22 more Jun 1, 2010 2:18:13 PM org.apache.catalina.core.StandardContext start SEVERE: Error listenerStart Jun 1, 2010 2:18:13 PM org.apache.catalina.core.StandardContext start SEVERE: Context [/xwiki] startup failed due to previous errors Jun 1, 2010 2:18:14 PM org.apache.catalina.loader.WebappClassLoader clearReferencesJdbc SEVERE: A web application registered the JBDC driver [org.apache.derby.jdbc.AutoloadedDriver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered. Jun 1, 2010 2:18:14 PM org.apache.catalina.loader.WebappClassLoader clearReferencesJdbc SEVERE: A web application registered the JBDC driver [com.mysql.jdbc.Driver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered.
participants (4)
-
Fabio Mancinelli -
James Cuzella -
Thomas Mortagne -
Vincent Massol