This is my first workflow project and I'm having trouble checking out my 
project from Subversion.  I'm using the Docker image of 1.580.2.

I am trying that syntax:
    checkout scm: [ $class: "SubversionSCM", locations: [ remote:'
http://svn.repo.de/foo/trunk', credentialsId:'123-123-123-123' ] ]

But I am getting a stacktrace:

java.lang.ClassCastException: 
sun.reflect.generics.reflectiveObjects.ParameterizedTypeImpl cannot be cast to 
java.lang.Class
        at 
org.jenkinsci.plugins.workflow.structs.DescribableHelper.coerce(DescribableHelper.java:161)
        at 
org.jenkinsci.plugins.workflow.structs.DescribableHelper.buildArguments(DescribableHelper.java:133)
        at 
org.jenkinsci.plugins.workflow.structs.DescribableHelper.instantiate(DescribableHelper.java:81)
        at 
org.jenkinsci.plugins.workflow.structs.DescribableHelper.coerce(DescribableHelper.java:183)
        at 
org.jenkinsci.plugins.workflow.structs.DescribableHelper.buildArguments(DescribableHelper.java:133)
        at 
org.jenkinsci.plugins.workflow.structs.DescribableHelper.instantiate(DescribableHelper.java:81)
        at 
org.jenkinsci.plugins.workflow.steps.StepDescriptor.newInstance(StepDescriptor.java:95)
        at org.jenkinsci.plugins.workflow.cps.DSL.invokeMethod(DSL.java:133)
        at 
org.jenkinsci.plugins.workflow.cps.CpsScript.invokeMethod(CpsScript.java:98)
        at 
org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:45)
        at 
org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:42)
        at 
org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
        at 
com.cloudbees.groovy.cps.sandbox.DefaultInvoker.methodCall(DefaultInvoker.java:15)
        at WorkflowScript.run(WorkflowScript:3)
        at Unknown.Unknown(Unknown)
        at ___cps.transform___(Native Method)
        at 
com.cloudbees.groovy.cps.impl.ContinuationGroup.methodCall(ContinuationGroup.java:69)
        at 
com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.dispatchOrArg(FunctionCallBlock.java:100)
        at 
com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.fixArg(FunctionCallBlock.java:76)
        at sun.reflect.GeneratedMethodAccessor327.invoke(Unknown Source)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at 
com.cloudbees.groovy.cps.impl.ContinuationPtr$ContinuationImpl.receive(ContinuationPtr.java:72)
        at 
com.cloudbees.groovy.cps.impl.CollectionLiteralBlock$ContinuationImpl.dispatch(CollectionLiteralBlock.java:55)
        at 
com.cloudbees.groovy.cps.impl.CollectionLiteralBlock$ContinuationImpl.item(CollectionLiteralBlock.java:45)
        at sun.reflect.GeneratedMethodAccessor363.invoke(Unknown Source)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at 
com.cloudbees.groovy.cps.impl.ContinuationPtr$ContinuationImpl.receive(ContinuationPtr.java:72)
        at 
com.cloudbees.groovy.cps.impl.CollectionLiteralBlock$ContinuationImpl.dispatch(CollectionLiteralBlock.java:55)
        at 
com.cloudbees.groovy.cps.impl.CollectionLiteralBlock$ContinuationImpl.item(CollectionLiteralBlock.java:45)
        at sun.reflect.GeneratedMethodAccessor363.invoke(Unknown Source)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at 
com.cloudbees.groovy.cps.impl.ContinuationPtr$ContinuationImpl.receive(ContinuationPtr.java:72)
        at 
com.cloudbees.groovy.cps.impl.CollectionLiteralBlock$ContinuationImpl.dispatch(CollectionLiteralBlock.java:55)
        at 
com.cloudbees.groovy.cps.impl.CollectionLiteralBlock$ContinuationImpl.item(CollectionLiteralBlock.java:45)
        at sun.reflect.GeneratedMethodAccessor363.invoke(Unknown Source)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at 
com.cloudbees.groovy.cps.impl.ContinuationPtr$ContinuationImpl.receive(ContinuationPtr.java:72)
        at 
com.cloudbees.groovy.cps.impl.ConstantBlock.eval(ConstantBlock.java:21)
        at com.cloudbees.groovy.cps.Next.step(Next.java:58)
        at com.cloudbees.groovy.cps.Continuable.run0(Continuable.java:145)
        at 
org.jenkinsci.plugins.workflow.cps.CpsThread.runNextChunk(CpsThread.java:164)
        at 
org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.run(CpsThreadGroup.java:267)
        at 
org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.access$000(CpsThreadGroup.java:70)
        at 
org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:176)
        at 
org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:174)
        at 
org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService$2.call(CpsVmExecutorService.java:47)
        at java.util.concurrent.FutureTask.run(FutureTask.java:262)
        at 
hudson.remoting.SingleLaneExecutorService$1.run(SingleLaneExecutorService.java:111)
        at 
jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28)
        at 
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
        at java.util.concurrent.FutureTask.run(FutureTask.java:262)
        at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        at java.lang.Thread.run(Thread.java:745)


My entire script is:


node {
  checkout scm: [ $class: "SubversionSCM", locations: [ 
remote:'https://mysvn/myrepo/trunk', credentialsId: 
'9c46a078-536d-419a-8baa-36aeaf8c7a1d' ] ]
  def mvnHome = tool 'Maven 3.2.5'
  sh "${mvnHome}/bin/mvn clean test"
}


Any idea how to fix?


On Wednesday, December 17, 2014 at 6:38:36 AM UTC-8, Kohsuke Kawaguchi 
wrote:
>
> So in your working version how do you specify the AdditionalCredentials 
> instance? And how come you don't have the credentialId? I have a feeling 
> that what you really wanted is just to pass in credentials, not so much 
> "additionalCredentials":
>
> Assuming that, I'd rewrite your following script:
>
> checkout scm: new hudson.scm.SubversionSCM('http://svn.repo.de/foo/trunk', 
> '123-123-123-123', '.')
>
>
> ... into this:
>
> checkout scm: [ $class: "SubversionSCM", locations: [ remote:'
> http://svn.repo.de/foo/trunk', credentialsId:'123-123-123-123' ] ]
>
>
> This version relies less on a specific constructor. (I haven't verifieid 
> if generic SCM step can get the databinding of nested ModuleLocation done 
> like this, but I believe Jesse implemented this some time ago.)
>
> Right now, the best way to get to snippet like this is to use the snippet 
> generator, so I need to check if it does that. Given your question, I 
> assume it didn't.
>
> Beyond that I also think we need more docs (probably auto-generated form 
> the source code as opposed to manually authored to prevent it from getting 
> out of sync), something like what Chef does 
> <https://docs.chef.io/resource_file.html>, so that a simple common case 
> like this can be readily looked up from examples.
>
> When I write Chef recipes I look at these docs all the time, and the same 
> for Maven.
>
>
> 2014-12-17 4:09 GMT-08:00 Stefan Lorenz <lorenz...@gmail.com <javascript:>
> >:
>>
>> Hi,
>>
>> I used the wrong syntax in the workflow-plugin
>>
>> I'm using this now:
>>
>> checkout scm: new hudson.scm.SubversionSCM('http://svn.repo.de/foo/trunk'
>> , '123-123-123-123', '.')
>>
>> It's the wrong/depcated constructor probably but it works now...
>>
>> thx for your response
>>
>>
>> Am Mittwoch, 17. Dezember 2014 09:53:22 UTC+1 schrieb Jennifer Hofmeister:
>>>
>>>  Hi Stefan,
>>>
>>>  
>>>
>>> did you add credentials in the checkout step, or only in the Addtional 
>>> Credentials part? It’s necessary to specify them in both places.  
>>>
>>>  
>>>
>>> If the problem doesn’t go away, maybe https://issues.jenkins-ci.org/
>>> browse/JENKINS-22542 can provide some solutions for you.
>>>
>>>  
>>>
>>> Cheers
>>>
>>>  
>>>
>>> Jennifer
>>>
>>>  
>>>
>>> *Von:* jenkins...@googlegroups.com [mailto:jenkins...@googlegroups.com] *Im 
>>> Auftrag von *Stefan Lorenz
>>> *Gesendet:* Dienstag, 9. Dezember 2014 23:40
>>> *An:* jenkins...@googlegroups.com
>>> *Betreff:* [workflow-plugin] svn credentials problem when running on a 
>>> remote node
>>>
>>>  
>>>  
>>> Hi,
>>>  
>>>  
>>>  
>>> Is it possible to get AdditionalCredentials from the SubversionSCM into 
>>> a workflow, because I always get this:
>>>  
>>>  
>>>  
>>> Caused by: org.tmatesoft.svn.core.SVNCancelException: svn: E200015: OPTIONS 
>>> ...
>>>
>>>  Caused by: org.tmatesoft.svn.core.SVNCancelException: svn: E200015: No 
>>> credential to try. Authentication failed
>>>
>>>  
>>>
>>>  
>>>
>>> My build step looks like that:
>>>
>>>
>>> checkout scm: [$class: 'SubversionSCM', locations: [new 
>>> hudson.scm.SubversionSCM.ModuleLocation('http://svn.repo.foo/bar/trunk', 
>>> ".")], additionalCredentials: [new hudson.scm.SubversionSCM.
>>> AdditionalCredentials('<http://svn.repo.foo:80> Foo Subversion 
>>> Repository', 'svn.repo.foo')]]
>>>
>>>   
>>>
>>> Can this work?
>>> Or is there a example how to handle that?
>>>
>>>
>>> Thx
>>> Stefan
>>>
>>>   
>>>
>>>  
>>>
>>>  -- 
>>> You received this message because you are subscribed to the Google 
>>> Groups "Jenkins Users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send 
>>> an email to jenkinsci-use...@googlegroups.com.
>>> To view this discussion on the web visit https://groups.google.com/d/
>>> msgid/jenkinsci-users/4aa5bda3-ccd6-4004-8345-
>>> a8c7f67e6445%40googlegroups.com 
>>> <https://groups.google.com/d/msgid/jenkinsci-users/4aa5bda3-ccd6-4004-8345-a8c7f67e6445%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>  
>>  -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Jenkins Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to jenkinsci-use...@googlegroups.com <javascript:>.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/jenkinsci-users/b2888cc4-038a-48c4-bbca-648ccb0c1b96%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/jenkinsci-users/b2888cc4-038a-48c4-bbca-648ccb0c1b96%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
> -- 
> Kohsuke Kawaguchi
>  

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/6458f00a-9e9d-4075-87d5-b6b4a4b28069%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to