Integrating Amazon SQS service into Eclipse - eclipse

I am trying to integrate Amazon SQS into eclipse but I'm having a hard time and I have no clue how to do that. I have watched many you tube videos and they all are with intelliJ or with visual studio code.
I tried with visual studio code but by default location is changing in the credentials.
Can anyone let me know the dependencies to add and how to create a project so that I can integrate AWS and also how to run the final application and how to make changes in the queue created?

To use the AWS SDK for Java V2 in Eclipse, all you need to do is create a Maven Project in Eclipse. Then look at the AWS SDK Github repo here:
https://github.com/awsdocs/aws-doc-sdk-examples/tree/master/javav2/example_code/sqs
See this illustration.
Open the POM located here and copy and paste it into your Maven project's POM file. That will add the required dependencies into your project. Now you can add the examples to your project to get SQS examples working in Eclipse.
Of course, you need to setup your development environment - which includes setting up your AWS credentials. To learn how to do this, see this topic:
Get started with the AWS SDK for Java 2.x

Related

How to run/debug java web service project in eclipse

I have a Java Web Service project which was just handed over to me by a colleague who just resigned (no one is assisting me in my new company). Im new to Java (J2EE) and my background is .Net + frontend + azure so I am pretty much very confused with setting up and running the java project. Also, Since my background is .Net Im referencing everything with how things work in Visual Studio from running a project, setting up a project to setting up and debugging a WCF project which I realized now is very different from eclipse + java.
I would really appreciate if someone could explain to me how I can run this project which is supposedly a java web service (as I was told)?
First I have a project that is like this:
Im assuming that the project boxed as blue is the webservice (and the rest are just libraries)? Is this correct? if so how do I run and debug the project using eclipse
Second when I click on debug as -> debug on server this is all I see:
Another colleague told me to install JBOSS (I haven't installed a server in eclipse) because that is what they used. Is there good documentation (step-by-step guide) on how to install JBOSS to run in eclipse. Im assuming that JBOSS + eclipse is like IIS express + Visual studio. Are there also other alternatives to JBOSS + eclipse like perhaps tomcat + ecplise that I can configure.
I really really find it hard to setup the java web service project in eclipse I have little to no prior experience with java j2ee programming especially with web services so any clarifications with my questions would be much appreciated. To sum up:
How would I really know that the project is a java webservice?
If so, how do I run the project and host the project using debugging in eclipse with tomcat or jboss?
I would appreciate if anyone can point me to the right direction of figuring out the source code
From here we can only guide you, you will have to go through some tutorials to understand how java projects work.
Your project is a webservice project according to your web.xml file because its having context params for rest.
the context param sets a front url to your webservice which in this case is gametime.
Check these tutorials and you will understand how it works
http://www.mkyong.com/tutorials/jax-rs-tutorials/
Create simple examples given in the above tutorial and then you can execute your's program
Jboss is a application server which we use to run our app.
You can install jboss in eclipse or you can use it externally also.
To install eclipse and jboss you can follow the link
http://theopentutorials.com/tutorials/java-ee/installing-jboss-tools-in-eclipse/
The other option is to download eclipse and jboss seperately
and use them.
Go to jbosshome/bin
If you download both of them seperately
then in that case for jboss
Invoke the add-user.sh or add-user.bat script. ...
Choose to add a Management user. ...
Choose the realm for the user. ...
Enter the desired username and password. ...
Choose whether the user represents a remote JBoss Enterprise Application Platform 6 server instance. ...
Enter additional users. ...
Create users non-interactively.
After this go to eclipse and follow steps of below link to add jboss to eclipse
http://www.mastertheboss.com/eclipse/jboss-eclipse/jboss-and-eclipse
A Java web application among other things has a predefined directory structure including folders named WEB-INF, WEB-CONTENT etc.
On how to deploy a web application to Tomcat via Eclipse you can follow the steps in this tutorial.

eclipse with new aws java web project, upgrade jar version

I'm not sure if I'm on the right track, but I can't find similar question on google or stackoverflow.
I'm using eclipse (luna), and I have this plugin from amazon, aws toolkit. When I create a project by clicking 'new aws web project', a new project will be created, and inside the aws sdk for java, some of the jar files have a version which is not I want, for example, spring-core-3.0.7.jar.
I tried convert this project to maven project and include dependency with latest spring-webmvc 4.x, but is seems two packages have conflict with each other. ref:
why .NoSuchMethodError: org.springframework.core.convert.converter.ConverterRegistry.addConverter
Two Maven Dependency for latest and old version conflicts
Spring MVC - Why the NoSuchMethodError exception when deploying context?
I tried to delete or upgrade the jar from aws sdk for java, but I can't find a way to delete it or upgrade it.
Then, I tried to create a normal java web project, convert to maven project and include the aws-java-sdk-core from maven repository, but after that I can't use the deploy to elastic beanstalk function.
Actually, I just want to create a project which let me use the latest spring framework, and also able to deploy to aws elastic beanstalk.
Follow steps:
create aws java web project
convert to maven project
delete aws java sdk package
add necessary jar using maven pom.xml
upload to aws elastic beanstalk
it works.

Eclipse(+AppEngine SDK) & Google "push-to-deploy" GIT repository

Is it possible to use Eclipse (with AppEngine SDK plugin) and Google "push-to-deploy" together? I have managed to install "gcloud"-tools and initialize a project fine! But now I can't figure out how to combine Eclipse project structure and the structure generated by "gcloud init". I mean I would like to do this:
1) Use Eclipse to edit the application and test it locally in Development server as before
2) But also utilize Google "Push-to-deploy" GIT repository (instead of GitHub)
Is this possible or feasible and is there any instructions how to do this kind of project setup correctly.
Thanks for any tips!
After some more experiments with gcloud (Google Cloud SDK) I would recommend creating the project with Maven and use Maven for building & running the development server. Still you can import the Maven project in Eclipse and use that as Java editor + remote debugger. Here's the instruction to get started:
https://developers.google.com/appengine/docs/java/tools/maven
Also Google Endpoints is quite nice tool for building REST APIs (though it still has some weaknesses, like limited support for HttpServletRequest data and poor authorization support in Development server)
https://developers.google.com/appengine/docs/java/endpoints/

Eclipse plugin to SonarQube 4.0 not finding provisioned project or creating new project

I am running the SonarQube plugin with m2e integration inside Eclipse Keplar. I am trying to run with a SonarQube 4.0 standalone server, running from the command-line on a win7 64 box.
When installing and reloading Eclipse the sonar plugin detected m2e and turned on the Sonar "nature" for me, including a project tag. The install also configured the SonarQube Eclipse properties to point to the localhost:9000 server. I can log in to the running server with chrome, and the Eclipse properties has a "test connection" option which passes. I am using empty user and password.
Problem 1: When I try and run SonarQube->Analyze on my project it completes and populates my project with issues. Great, except that this information is not pushed to the server and the start of the console log states:
Retrieve remote issues of project XXXXX...
Project not found on remote SonarQube server [com.company.xxxx:XXXX]
Start SonarQube analysis on XXXX...
INFO: SonarQube Server 4.0
I have tried to provision a project for com.company.xxxx:XXXX, and I have turned the security for provisioning off to act like SonarQube 3, but the project analysis does not get added to the server.
So the plugin can clearly contact the server. I have tried to add the admin credentials to the plugin to get past any permission issues. I have overridden the default maven-generated tag name to something else, and also added provisioning for the new name. I keep getting "Project not found" messages.
Am I missing something? The tutorial on the SonarQube tutorial makes it seem like this is correctly configured, but web searches are not coming up with similar experiences.
This appears to be a result of the Maven integration. Updates are only pushed to the server when running directly against the Maven repository. When running locally the analysis data is compared to the server data to find deltas, but the server data itself is not updated. This actually makes a lot of sense in a team environment, but was a surprise when the SonarQube tutorial calls out Maven integration but not this caveat.
After performing an analysis from the SonarQube server directly against the Maven repo (without Eclipse in the picture at all) the project was created and populated with the data. This data was then available in Eclipse and local analysis would delta against that data (although it would not update it, which also makes sense).

Maven Eclipse Integration

I have recently started out on Maven. I am trying to integrate Maven+eclipse(Juno)+tomcat7.
I have downloaded m2e-wtp plugin for eclipse and created a Maven project whose structure follows a standard Maven project structure. It is also configured a dynamic web project.
It is a multi module project with two modules of flex(f1 AND f2) and one module of webapp(w).I have configured all the plugins correctly and there is no problem with configuration of POMs.
What I want to achieve is :
When I clean and Build project in Eclipse using Project-->Clean,Eclipse does not build the war in target folder of my web application project (w). I also does not copy any of the flex resources to target folder. However,
When I run the project as maven build by right-clicking the web application project and running it as a "maven install" it creates everything as expected.
My question is that if it is possible to achieve what I mentioned in point (1)? Or the only correct way to do this is the way mentioned in point (2).
I am also not able to deploy the generted files in step 2 automatically in tomcat.
Do I need to use another maven plugin for this?
Please note that this i my first experience with Maven + eclispe. I have followed certain tutorials. So, Please be lenient while voting negatively.
From what I know it is not possible to force Eclipse to use Maven directly (I would gladly be proven wrong).
Eclipse does not use Maven to build (1). Using the m2e plugin, it is possible to run maven to perform the build as you discovered (2).
If you are looking for that kind of tight integration you can look at NetBeans or IntelliJ who are using Maven natively.
EDIT:
About (3) there is a Tomcat-Maven-Plugin that can deploy the WAR file created on a running tomcat instance. Check the Usage page for more details.