Unable to pass the excel file as parameter thru File Parameter.

433 views
Skip to first unread message

Narmadha Vigneshwaran

unread,
Nov 4, 2015, 5:56:10 AM11/4/15
to Jenkins Users
HI
I am unable to pass the excel file as parameter thru File Parameter.Is there any solutions to resolve this issue?

Slide

unread,
Nov 4, 2015, 9:20:38 AM11/4/15
to Jenkins Users
Why aren't you? Do you get an error? You haven't given nearly enough details for anyone to help.

On Wed, Nov 4, 2015 at 3:56 AM Narmadha Vigneshwaran <narmadha.v...@gmail.com> wrote:
HI
I am unable to pass the excel file as parameter thru File Parameter.Is there any solutions to resolve this issue?

--
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/7ae1207d-08c9-469a-9f12-ba670762d25c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Narmadha Vigneshwaran

unread,
Nov 5, 2015, 12:32:06 AM11/5/15
to Jenkins Users
Sorry for the  incomplete info. My requirement is  I will pass an excel file which has the data.The data has been read from file and it needs to be processed.
When  I am using the File Parameter, I am able to select the excel file from my local machine. But when the build started, its failed with the below error.

java.io.FileNotFoundException: sam.xls (The system cannot find the file specified)
	at java.io.FileInputStream.open0(Native Method)
	at java.io.FileInputStream.open(Unknown Source)
	at java.io.FileInputStream.<init>(Unknown Source)
	at java.io.FileInputStream.<init>(Unknown Source)
	at MOU_Console.readExcel(MOU_Console.java:144)
	at MOU_Console.iceLogin(MOU_Console.java:118)
	at MOU_Console.main(MOU_Console.java:81)

C:\Users\nuthiran\.jenkins\jobs\MOU\workspace>exit -1 
Build step 'Execute Windows batch command' marked build as failure
No JDK named ‘null’ found

Hope this is clear enough now.

Narmadha Vigneshwaran

unread,
Nov 5, 2015, 12:33:24 AM11/5/15
to Jenkins Users
The issue here is  Its selecting the file from local and unable to upload the file in the workspace.

Baptiste Mathus

unread,
Nov 5, 2015, 2:43:10 AM11/5/15
to jenkins...@googlegroups.com

What did you put in the config fields for that file parameter, and how do you reference it in your job step(s)?

--
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.

Narmadha Vigneshwaran

unread,
Nov 5, 2015, 4:28:24 AM11/5/15
to Jenkins Users, m...@batmat.net
Ii have used File Parameter as command line arguments.After selecting teh file thru File parameter, I ma passing it as Arugument to the command line.Please refer this screenshot.
file_parameter.png

Daniel Beck

unread,
Nov 5, 2015, 5:10:55 AM11/5/15
to jenkins...@googlegroups.com
What you specify as parameter name is actually the name of the file used in the workspace, and not a variable. So get rid of the surrounding % chars in the batch step.
> To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/538ccf46-3b0d-4088-86d8-9f695227170f%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
> <file_parameter.png>

Narmadha Vigneshwaran

unread,
Nov 5, 2015, 5:44:43 AM11/5/15
to Jenkins Users, m...@beckweb.net
Thanks for the info. But in this case , the excel file should be stored in the workspace. But i want the users to selct the fiel from their local client machine and execute the job.Is it possible?

Narmadha Vigneshwaran

unread,
Nov 5, 2015, 6:04:24 AM11/5/15
to Jenkins Users, m...@beckweb.net
My requirement is  "Users slelect their excel or text file from their local system and run the job".

Slide

unread,
Nov 5, 2015, 7:22:28 AM11/5/15
to Jenkins Users, m...@beckweb.net
The doc for the File Parameter says this: "File parameter allows a build to accept a file, to be submitted by the user when scheduling a new build. The file will be placed inside the workspace at the known location after the check-out/update is done, so that your build scripts can use this file." 

So it should be possible. Can you verify the file exists in the workspace in your build step?

Narmadha Vigneshwaran

unread,
Nov 5, 2015, 11:07:04 AM11/5/15
to Jenkins Users, m...@beckweb.net
If the file does not exist in the workspace, How can the user pass their own file from their client machine to workspace and run the build?

Slide

unread,
Nov 5, 2015, 11:08:30 AM11/5/15
to Jenkins Users, m...@beckweb.net
The file parameter will place the file that is selected into the workspace.

Narmadha Vigneshwaran

unread,
Nov 6, 2015, 1:43:05 AM11/6/15
to Jenkins Users, m...@beckweb.net
What will happen if multiple users want to build the job at the same time with different files?
The scenario is: Users will enter their credentials and select their own files(which has different file names as per the user) and run the job.
User A has the file name as Test1.xls
User B has the file name as  Sample.xlsx.

While User A and B running the job parallely from their client machines, which file will be taken during the run time?
As we have the parameter name as "mou.xls", how the conflict will be resolved?



On Thursday, 5 November 2015 15:40:55 UTC+5:30, Daniel Beck wrote:
file_param.png

Slide

unread,
Nov 6, 2015, 5:26:13 AM11/6/15
to Jenkins Users, m...@beckweb.net
Each run should have it's own workspace (unless you are setting a custom workspace). If you are setting a custom workspace, then you will have issues.

Reply all
Reply to author
Forward
0 new messages