Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,463,878
Community Members
 
Community Events
176
Community Groups

Facing Null pointer while accessing the resource folders in Bitbucket pipeline

Hi All,

I am new to bitbucket pipeline and wanting to run my Selenium functional automated test using the bitbucket infrastructure.

I have a Java based project with Maven as the build management tool. I have tried executing the maven command to run the code on the linux instance but apparently getting Null pointer exception for a resource file as below

 

java.io.FileNotFoundException: /opt/atlassian/pipelines/agent/build/src/test/resources/testdata/Contact/CreateContact.json (No such file or directory)
at java.io.FileInputStream.open0(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:138)

I have tried logging in the directory files and but it shows that my files are not cloned in the instance created.

This is the yml file I have created.

image: jamesdbloom/docker-java8-maven

clone:
depth: full

pipelines:
default:
- parallel:
- step:
name: Build and Test
caches:
- maven
script:
- docker run -d -p 4444:4444 --shm-size=2g selenium/standalone-chrome:3.141.59-20210607
- mvn -B verify -Dcucumber.filter.tags="$TAGS" -Dbrowser.type=$BROWSER -DEnvironment=$ENVT -DrunOnRemote=$ON_REMOTE -Dwebdriver.remote.url=$WD_URL
services:
- docker
artifacts:
- target/**.
Attached is the project sturcutre for your reference.
image.png

1 answer

1 accepted

The folder name is Case sensitive, "testdata" folder name should be  testData. 

Refer this - https://community.atlassian.com/t5/Bitbucket-Pipelines-questions/Maven-build-runs-local-but-fails-in-pipeline-with-resource-not/qaq-p/804172

Thanks for the response @Honey Bhatnagar

This seems to have fixed the issue I am facing. 

Suggest an answer

Log in or Sign up to answer
TAGS

Atlassian Community Events