I thought that since jenkins was running as an application in the tomcat
container that the tomcat user is the same as the jenkins user in this
context. That is why I was referring to the tomcat user. Did I
misunderstand how that is working?

I have the Classpath from:

Thread.currentThread().executable.parent.builds[0].properties.get("envVars").CLASSPATH

which comes up empty even though I have a value in the Classpath section of
the "Execute system Groovy script" build task.

Additionally, I have the jar file in ~tomcat/.groovy/lib and the
$TOMCAT_HOME/lib and the script still can't find the driver...

I guess you are talking about env and $PATH from a shell perspective. I
have iterated through everything envVars gives me, which is I guess
equivalent to env and the CLASSPATH is empty.

Thanks,

Lloyd




On Fri, Apr 5, 2013 at 7:06 AM, Kamal Ahmed <[email protected]>wrote:

> I think you should think of the user executing the scripts from user
> "jenkins" perpective.
> also good idea to run "env" or "set" and echo $PATH as shell script, to
> see what environment you have.
> Hope that helps
> -K
>
>
>   ------------------------------
> *From:* Lloyd Meinholz <[email protected]>
> *To:* [email protected]
> *Sent:* Thursday, April 4, 2013 2:21 PM
> *Subject:* system Groovy script claspath question
>
> I'm banging my head trying to solve this issue. I would like one of my
> "system Groovy script"s to insert a row into a database. I need my jdbc
> driver to do this.
>
> I'm on Solaris 10, jdk 1.6.0_35-b10, tomcat 7.0.39, jenkins 1.509, Hudson
> groovy builder 1.13.
>
> The mysql jdbc driver I am using lives in
> /ci/lib/mysql-connector-java-5.1.22-bin.jar. I verified the jar was good by
> unjarring it. I use this jar in another web application to access the same
> mysql server.
>
> I have been unable to have access to the jdbc driver from my script:
>
> FATAL: com.mysql.jdbc.Driverjava.lang.ClassNotFoundException 
> <http://stacktrace.jenkins-ci.org/search?query=java.lang.ClassNotFoundException>:
>  com.mysql.jdbc.Driver
>
>
> I tried:
>
> * adding "/ci/lib" to the Classpath field of the "Execute system Groovy
> Script" build step.
> * adding "-cp /ci/lib" to the Classpath field of the "Execute system
> Groovy Script" build step.
> * adding "/ci/lib/mysql-connector-java-5.1.22-bin.jar" to the Classpath
> field of the "Execute system Groovy Script" build step.
> * adding "-cp /ci/lib/mysql-connector-java-5.1.22-bin.jar" to the
> Classpath field of the "Execute system Groovy Script" build step.
> * putting the driver in the tomcat users ~/.groovy/lib
> * putting the driver in $TOMCAT_HOME/lib
>
> None of these seemed to work. What am I missing?
>
> Thanks,
>
> Lloyd
>
> --
> 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 [email protected].
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>
>
>    --
> 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 [email protected].
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
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 [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to