Java REST API adding folders to the project - java

I'm using jersey to build a REST webservice in eclipse everything's work fine but when i added a jar to my project (webContent/WEB-INF/lib) and this jar make use of other files. This files are in folders named "configs". When a use this jar in java project i added configs folder to the java project folder and it work okay :)
So how to add folders to the web project?

i found the answer you just change the working directory.
Run configuration > Arguments > at the bottom you change the working directory

Related

How to use class.java from service.jws in an Axis project?

I'm building a java web service using Apache Axis 1.4. My service.jws is already working well on Tomcat. Now I want to expand this web service, adding more classes which should be used from service.jws. The problem is when I create a class on src folder, I can't import it from my service.jws (located at WebContent folder), how can I do it?
By the way, other thing i've tried was to create the classes I need in another project, generated .jar and added to lib by configuring buildpath, but from service.jws it can't be imported/recognized. However, the lib from axis, that I've added to path by the same way, can be imported and work fine.
Somebody can help me? Thanks.
It worked when I copied otherproject.jar, that I generated, into WEB-INF/lib in my axis project and added it to buildpath by "import jars" in Eclipse (not "import external jars").

How to add jasypt plugin to eclipse

So I am using
Eclipse IDE for Java EE Developers
http://www.eclipse.org/downloads/packages/eclipse-ide-java-ee-developers/keplerrc3
and I am trying to add the jasypt - 1.9.0 plugin to eclipse
Since I am not experienced in this, I only tried one way which is
1- Download the zip file form the following url
http://sourceforge.net/projects/jasypt/files/
2- Unzip the file into the eclipse subdirectory plugins
3- Restart eclipse
However it seems that there is something missing
Go to your downloaded file and go to the lib folder. In there, you have a whole host of jar files. It is most likely the jasypt-1.9.0 jar you want.
In Eclipse: go to: Properties > Java Build Path > Libraries
Choose to add an External Jar and navigate to the location of the jasypt-1.9.0.jar
This will add the jar and its libraries to your project. Note: Look at the API for what you are using if this doesn't work - you may require a different jar to be imported instead/as well.
This is the standard way to add any third-party libraries to your project.

JSON libs for Eclipse

I am trying to connect to a OpenShift PHP database that I already set up. I am trying to connect to it using a eclipse java class. I tried to use Google Http client files but I am not sure how to add these into my project. I tried adding in via a libs folder but it always shows a error. Can anyone guide me on this?
You need to add the library to your classpath in your project project properties.
Project > Properties > Java Build Path > Libraries
Put the jar in your libs folder and add a jar in the libraries settings. If you only get the source, then you have to add the source package to your source folder and everything should be fine. Alternatively you can link the source in externally. However, you should be getting the library as a jar so just throw that in the libs folder and add it in your project properties.

Integration of external jar file in android application using adt 20

I am trying to use external jar file in android application. The jar file is running well in another java application but when I am trying to use the Jar file with Android Application by BuildPath-> Add External Jars; it is showing following errors
"could not find class referenced from method ".
Please help me out from this.
Thanks
Shorav
Maybe the ADK update has messed-up with your project's build-path. Try removing the JAR and add it again to your libs folder, and do a Clean Project.
following poster's comment about not having a libs folder:
You should try this:
Remove all references to the JAR in your project -> your code should not build without error anymore
Create à libs folder at the root of your project
Copy the JAR into the libs folder
(If still not running OK) Right click your project > Android Tools > Fix Project Propertie
If you want to use a Jar in android application you may create it like this:
Open your IDE
Click on new
Choose new Android project
Give the name of your project
Check option make this project as library

Issue with Red5 server

I have installed Red5 server successfully and also am able to run the demos fine. Now, I want to create a sample red5 server application. I created a sample project according to the specific directory structure that Red5 requires. But, now when I try to open this project in Netbeans 6.8, I am unable to because both have a different directory structure. So, Netbeans doesn't consider it as a project. I actually want to convert this project to a war file, so I can deploy it to red5/webapps directory and then red5 deployer service can make project out it automatically. How do I convert this project to a war file? because in Netbeans I am unable to open it. Please help.
I don't know if this will fully answer your questions but this is my configuration.
In the main red5 directory there is a file called project.zip, you can open it to get basic configuration files, directories structure and build files for ant (Pure Java build tool).
Using netbeans, you create a new free-form project and point it to the directory of your project. because of the ant build files the project will be recognized.
Netbeans provides it's own ant version but i prefer to install and use ant from command line.
when you'll run ant in the project directory it will try to find dependencies and probably at first will complain that it cannot find ivy.
Ivy is a dependency manager that red5 project uses that can be found in the following URL: http://ant.apache.org/ivy/download.html
please notice that ant will tell you exactly where it searches for the required jar file, just download the ivy zip, unzip it, and place the jar inside it in the requested directory.
once ant will compile the project properly (just by running the commant ant), it will also create a war file under dist directory.
don't forget to add to your red5 netbeans project the relevant red5 jars in order for the project to compile properly.
I am also prefer use ant from command line. I have two directory structures. One for source files and another for deployment.
This example helped me to start.

Categories

Resources