Artifactory Can't Save POM with CURL

Help
2008-12-15
2013-04-05
  • Peter Pilgrim
    Peter Pilgrim
    2008-12-15

    Hi

    It was great to meet you at Devoxx 2008 last week, and thanks for the JFrog tee-shirt,

    I am using Artifactory 1.3.0 beta 6.1 with Apache Ivy.

    I see there is a HTTP error 500 when I use CURL.exe to upload the POM file.

    In my Ant File. I have a Macrodefinition for CURL.exe

       <macrodef name="curl-upload">
            <attribute name="sourcefile" description="source file" />
            <attribute name="url" description="target URL" />
            <attribute name="username" description="server login username" />
            <attribute name="password" description="server login password" />
            <attribute name="datamode" default="--data-ascii" description="member of the set {--data, --data-binary, --data-ascii }"  />
            <sequential>
                <!-- curl -v -X PUT - -data-binary @mylib-1.0.jar -u admin:XYZ1234 http://localhost:8080/artifactory/libs-releases-local/org/jfrog/test/1.0/mylib-1.0.jar  -->
                <echo> Uploading file @{sourcefile} to target URL @{url} </echo>
                <exec executable="${curl.exe}">
                    <arg value="-v" />
                    <arg value="-X" />
                    <arg value="PUT" />
                    <arg value="@{datamode}" />
                    <arg value="@{sourcefile}" />
                    <arg value="-u" />
                    <arg value="@{username}:@{password}" />
                    <arg value="@{url}" />
                    <!-- <arg value="" /> -->
                </exec>
            </sequential>
        </macrodef>

    And the next thing is a INSTALL SHARED  REPOSITORY target

       <target name="makepom" depends="init" description="Generates the Maven 2 Apache POM file">
            <ivy:makepom ivyfile="${basedir}/ivy.xml" pomfile="${target.dir}/${project.artifact}-${project.version}.pom">
                <mapping conf="compile" scope="compile" />
                <mapping conf="runtime" scope="runtime" />
                <mapping conf="test" scope="test" />
                <mapping conf="provided" scope="provided" />
            </ivy:makepom>
            <echo> ${artifactory.repo.url}/${artifactory.repo.project.organisation}/${project.version}/${project.artifact}-${project.version}.pom </echo>
        </target>

        <target name="install-shared" depends="jar, makepom" description="Publish the target modules into the SHARED Apache Ivy Repository">
            <echo> Uploading JAR file into Artifactory via cURL </echo>
            <echo>
                project.organisation=${project.organisation}
                artifactory.repo.project.organisation=${artifactory.repo.project.organisation}
            </echo>
            <!-- curl -v -X PUT - -data-binary @mylib-1.0.jar -u admin:XYZ1234 http://localhost:8080/artifactory/libs-releases-local/org/jfrog/test/1.0/mylib-1.0.jar  -->
            <curl-upload sourcefile="${target.dir}/${project.artifact}-${project.version}.jar"
                datamode="--data-binary"
                username="${artifactory.manager.username}" password="${artifactory.manager.password}"
             url="${artifactory.repo.url}/${artifactory.repo.project.organisation}/${project.version}/${project.artifact}-${project.version}.jar" />
           
            <!-- FIXME: This almost works. Uploading the POM file generates an internal server error
            in Artifactory. Hmmm *PP* 15/Dec/2008
            -->
            <echo>Upload POM file to Artifactory via cURL </echo>
            <curl-upload sourcefile="${target.dir}/${project.artifact}-${project.version}.pom"
                username="${artifactory.manager.username}" password="${artifactory.manager.password}"
             url="${artifactory.repo.url}/${artifactory.repo.project.organisation}/${project.version}/${project.artifact}-${project.version}.pom" />
           
            <echo>Upload Ivy file to Artifactory via cURL </echo>
            <curl-upload sourcefile="${basedir}/ivy.xml"
                username="${artifactory.manager.username}" password="${artifactory.manager.password}"
             url="${artifactory.repo.url}/${artifactory.repo.project.organisation}/${project.version}/${project.artifact}-${project.version}.ivy" />
           
            <echo message="Project ${ant.project.name} published to shared repository with version ${project.version}" />
        </target>

    Here is the artifactory.log from the server.

    2008-12-15 12:09:54,006 [ERROR] (o.a.w.s.RepoFilter  :63) - Sending HTTP error code 500:Failed to save resource 'echannel-releas
    es-local:com/lloydstsbcorporatemarkets/echannel/pmhub/0.1-SNAPSHOT/pmhub-0.1-SNAPSHOT.pom'.
    java.lang.RuntimeException: Failed to save resource 'echannel-releases-local:com/lloydstsbcorporatemarkets/echannel/pmhub/0.1-SN
    APSHOT/pmhub-0.1-SNAPSHOT.pom'.
            at org.artifactory.repo.jcr.JcrRepoBase.saveResource(JcrRepoBase.java:542) [artifactory-core-1.3.0-beta-6.1.jar:na]
            at org.artifactory.engine.UploadServiceImpl.doProcess(UploadServiceImpl.java:214) [artifactory-core-1.3.0-beta-6.1.jar:n
    a]
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [na:1.6.0_05]
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [na:1.6.0_05]
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [na:1.6.0_05]
            at java.lang.reflect.Method.invoke(Method.java:597) [na:1.6.0_05]
            at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:310) [spring-aop-2.5.5.jar:2.5.
    5]
            at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182) [sp
    ring-aop-2.5.5.jar:2.5.5]
            at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149) [spring-aop
    -2.5.5.jar:2.5.5]
            at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106) [spring-tx
    -2.5.5.jar:2.5.5]
            at org.artifactory.jcr.lock.LockingAdvice.invoke(LockingAdvice.java:79) [artifactory-core-1.3.0-beta-6.1.jar:na]
            at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) [spring-aop
    -2.5.5.jar:2.5.5]
            at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) [spring-aop-2.5.5.jar:2.5.5]
            at $Proxy45.doProcess(Unknown Source) [na:na]
            at org.artifactory.engine.UploadServiceImpl.process(UploadServiceImpl.java:109) [artifactory-core-1.3.0-beta-6.1.jar:na]
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [na:1.6.0_05]
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [na:1.6.0_05]
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [na:1.6.0_05]
            at java.lang.reflect.Method.invoke(Method.java:597) [na:1.6.0_05]
            at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:310) [spring-aop-2.5.5.jar:2.5.
    5]
            at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:198) [spring-aop-2.5.5.jar:2.5.5]
            at $Proxy45.process(Unknown Source) [na:na]
            at org.artifactory.webapp.servlet.RepoFilter.execute(RepoFilter.java:122) [RepoFilter.class:na]
            at org.artifactory.webapp.servlet.RepoFilter.doFilter(RepoFilter.java:73) [RepoFilter.class:na]
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) [catalina.jar:na]
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) [catalina.jar:na]
            at org.artifactory.webapp.servlet.AccessFilter.useAuthentication(AccessFilter.java:187) [AccessFilter.class:na]
            at org.artifactory.webapp.servlet.AccessFilter.authenticateAndExecute(AccessFilter.java:134) [AccessFilter.class:na]
            at org.artifactory.webapp.servlet.AccessFilter.doFilterInternal(AccessFilter.java:118) [AccessFilter.class:na]
            at org.artifactory.webapp.servlet.AccessFilter.doFilter(AccessFilter.java:87) [AccessFilter.class:na]
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) [catalina.jar:na]
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) [catalina.jar:na]

    All this was based on a comment that Yaov pasted on my jroller blog.

    Running on Tomcat 6.0.16

    I will upgrade to the RC1 later this week. I have got some project issues to resolve first ;-)