Vous êtes sur la page 1sur 30

Steps to do Part B Receiver Program

Pre-Requisites
Eclipse IDE for Java EE Developers

http://www.eclipse.org/downloads/
AWS Toolkit for eclipse
AWS toolkit for Eclipse
(http://docs.aws.amazon.com/AWSToolkitEclipse/latest/GettingStartedGuide/t
ke_setup_install.html)
Go to help tab

Click on Install new software

Type

http://aws.amazon.com/eclipse in Work With text area. Click Add button

Select All and then Click on Next

Wait for the installation to complete.

Click Next

Click on Finish button.

Click OK.

2) Servlet API.JAR file

Download the JAR file from


http://mvnrepository.com/artifact/javax.servlet/javax.servlet-api/3.0.1
Place the file in the src folder in Receiver program code.
Sample Path : D:\Personal\MS 3 rd SEM\EC3 Assignment\SATHISH\ECIIImaster\Receiver\src

3) Please make sure Java is installed in your machine.

Import the Receiver program code to your machine.


Click on File tab ,, Import button

Click on General---Existing Projects to Workplace

Select the Receiver folder by browsing .

Click on Finish button.

After importing , you will see the below screen.

There will some errors in program code.


Steps to rectify those error.

Right Click on Receiver in the project explorer

Click on Properties

Click on JAVA BUILD PATH

Click on Libraries

Click on JRE System Library JAVA SE Unbound and click Remove button

Click on Add Library

JRE System Library

Click on Next

Click on Alternate JRE and click on finish button

Now click on Add External JARs

Select the JAR file from the location which you have placed.

Click on OK
Next Updating the code
Changes in code files
Go to Java Resources srccom.eciii-Select ReceiverServlet file

Changes required in Line 44 and Line 45


Change the unrecognized characters with ; in both line no 44 and 45

To Rectify the target runtime error


Go to Window-Preferences

Go to Server---Run Time environments


Click on Add
Select Amazon Web Services
Apache Tomcat 8.0
Click on Finish Button

Click on OK
Change whoami.txt with your name and Number.
Change web.xml file 20 th line with your SQS end point.
Change AwsCredentials.properties with your access key and secret key.
After doing the changes in 4 files.Its Time to add your AWS credentials to
Eclipse.
1.

Open Eclipse's Preferences dialog box and click AWS Toolkit in the sidebar.

2.

Type or paste your access key ID in the Access Key ID box.

3.

Type or paste your secret access key in the Secret Access Key box.

4.

Click Apply or OK to store your access key information.

Add your access key and Secret key here in the above screen. Click OK
Now its time to run the program.

Receiver----Run As---Run on Server


Before doing this click on AWS icon

Click on Show AWS Explorer View

In the AWS Explorer please make sure that you have selected the region
where you have your SQS configured

For example : ASIA PACIFIC (SINGAPORE)

Please bear with me .I am unable to provide screenshots for the below


steps due to my local system proxy issues.

Follow the steps as mentioned.


Next Screen
In this screen you will need to enter Application Name and Environment
Name.
Application Name
Environment Name
Application Name and Environment Name should contain your BITS ID or name .This
will appear in your URL.
Click on Next
Next Screen
In this screen you will need to add a new key pair by giving only name for
it and uncheck the Incremental Deployment option.
Key Pair
Click on Add (plus icon) Give any name
Click on OK
Please remove the checked option in Incremental Deployment.
In Next screen you will be able to see the Receiver program in right side.
Click on Next and Click on finish button.

Now your code will be publishing to the AWS elastic beanstalk.You will be
able to see the window publishing in your Eclipse screen.
At this time you will be able to see your server at the bottom of Eclipse .
Server -----It will stop sometimes .you need to start it manually by right
click ---start. Please make sure your server is running all the time when
your code is getting published to AWS.
Now go to your AWS console. Click on Elastic Beanstalk.
Now you should able to view your receiver application .
Get the URL .
Sample URL:

Receiver URL:
http://2013ht78094-ezwprrwmk3.elasticbeanstalk.com/

How to check whether your URLs are correct or not

http://2013ht78094-ezwprrwmk3.elasticbeanstalk.com/whoami

Sender URL
http://vaibhavan-r-2013ht78094.elasticbeanstalk.com/

http://vaibhavan-r-2013ht78094.elasticbeanstalk.com/whoami

Send the message Hello-Everyone-Welcoming-U-All-2-The-World-Of-AWSServices


In Senders send URL.

http://vaibhavan-r-2013ht78094.elasticbeanstalk.com/send/HelloEveryone-Welcoming-U-All-2-The-World-Of-AWS-Services

Vous aimerez peut-être aussi