[
https://issues.apache.org/jira/browse/SLING-2631?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13487751#comment-13487751
]
Robert Munteanu commented on SLING-2631:
----------------------------------------
I've located the problem. The path of the resource is obtained using
{code}resource.getPath().getLocation(){code}
which returns an absolute filesystem path, while the path of the parent is
obtained using
{code}resource.getContainer().getFullPath(){code}
which returns the path relative to the workspace. In certain cases, and most of
all in nested project or projects not completely inside Eclipse this fails to
detect the proper relative path. I've updated the path handling and added some
toString() methods for ease of debugging.
> [Tooling] SlingclipseListener incorrectly calculates parent paths
> -----------------------------------------------------------------
>
> Key: SLING-2631
> URL: https://issues.apache.org/jira/browse/SLING-2631
> Project: Sling
> Issue Type: Sub-task
> Components: Extensions
> Reporter: Robert Munteanu
> Assignee: Antonio Sanso
> Attachments: SLING-2631.diff
>
> Original Estimate: 0h
> Remaining Estimate: 0h
>
> I get lots of such exceptions when I start Eclipse. I disabled sync after
> every save for now.
> !ENTRY org.eclipse.core.resources 4 2 2012-10-25 23:30:31.945
> !MESSAGE Problems occurred when invoking code from plug-in:
> "org.eclipse.core.resources".
> !STACK 0
> java.lang.IllegalArgumentException: Invalid uri
> 'http://localhost:8080metrixx-commons-core/target/classes/META-INF':
> invalid port number
> at
> org.apache.commons.httpclient.HttpMethodBase.<init>(HttpMethodBase.java:222)
> at
> org.apache.commons.httpclient.methods.ExpectContinueMethod.<init>(ExpectContinueMethod.java:93)
> at
> org.apache.commons.httpclient.methods.EntityEnclosingMethod.<init>(EntityEnclosingMethod.java:119)
> at
> org.apache.commons.httpclient.methods.PostMethod.<init>(PostMethod.java:106)
> at
> org.apache.sling.slingclipse.http.impl.RepositoryImpl.addNode(RepositoryImpl.java:37)
> at
> org.apache.sling.slingclipse.SlingclipseListener$1.visit(SlingclipseListener.java:91)
> at
> org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:69)
> at
> org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:80)
> at
> org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:80)
> at
> org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:80)
> at
> org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:80)
> at
> org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:80)
> at
> org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:49)
> at
> org.apache.sling.slingclipse.SlingclipseListener.resourceChanged(SlingclipseListener.java:42)
> at
> org.eclipse.core.internal.events.NotificationManager$1.run(NotificationManager.java:291)
> at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
> at
> org.eclipse.core.internal.events.NotificationManager.notify(NotificationManager.java:285)
> at
> org.eclipse.core.internal.events.NotificationManager.broadcastChanges(NotificationManager.java:149)
> at
> org.eclipse.core.internal.resources.Workspace.broadcastPostChange(Workspace.java:395)
> at
> org.eclipse.core.internal.resources.Workspace.endOperation(Workspace.java:1530)
> at
> org.eclipse.core.internal.resources.Resource.refreshLocal(Resource.java:1712)
> at
> org.eclipse.core.internal.refresh.RefreshJob.runInWorkspace(RefreshJob.java:167)
> at
> org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:38)
> at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira