I am doing a project in which one part is openid authentication. I am using Java.
I downloaded the code from the below site:
http://www.ibm.com/developerworks/java/library/j-openid/index.html, it said that he used wicket.
I tried to execute with tomcat server. I am able to compile the java files successfully.
But when I tried to run the openidregistration.html and put www.myopenid.com or (http)://pratap533.myopenid.com, it is not at all responding.
I am in big trouble as I have to complete the project to get my degree.
I included the openid4java.jar, joda-time.jar and wicket.jar file and the C:\Downloads\FileServe Manager\openid4java-sample-app\src all these files in classpath.
So I compiled them and was successful.
I created the wicket folder in webapps and in which I put web-inf. In web-inf I created classes folder and also copied the web.xml in web-inf folder.
In the classes I put all the 4 classes of wicket folder.
When I tried to run the openidregistration.html and put www.myopenid.com or (http)://pratap533.myopenid.com
it was not at all responding..
in web.xml file it is with servlet tags. those tags i did not include them.
Please any body help me..
I think I need to use eclipse, but I am not getting what is the problem.
I tried the following steps with the sample code you have mentioned and its working fine for me except i was getting connection failure error which might be due to the proxy network.
here are the steps for you
Create a dynamic web-application in eclipse IDE.
copy the jars from sample to the jar lib folder in your new project (created in step1).
replace the web.xml from the one from sample application.
copy the SRC folder from the sample application to the one created by you.
If you want to see what is happening inside the application copy the log4j.properties file from sample application to the src folder.
Follow the above 4 steps and you will get a running application what they have in there tutorial.
hope this will work for you.
Related
I created an example microprofile app. And the readme says i can start it with java -jar myjar.jar
But when I try it i get an error that no manifest.mf exists.
I really don't have one in my example generated project. But when I extract the jar, there is one generated, but without a main class.
How is a Microprofile app even supposed to run? I know there is a class extending Application. But how should I handle this manifest file?
Ok sorry just realized IntelliJ placed the projet into another folder. So now I have two folders. And handled the wrong project.
Recently While I was doing a Dynamic web project,I forgot to include OJDBC.jar in the WEB-INF folder.But the code ran file without showing any Class Not Found Exception.But when my friend did the same,Class not found exception was shown.Then when he included the OJDBC.jar in the WEB-INF folder,the code ran fine.I am not able to understand why this is the case.Is it not mandatory to include OJDBC file in WEB-INF folder?And we both used Apache Tomcat Server.
As you can see from the above screenshot,I experimented by not including OJDBC.jar in the WEB-INF folder.The code ran fine.Please tell me why this is the case?
Well, Eclipse builds the context's classpath joining libraries from several locations:
Of corse, the <tomcat_home>\lib\*.jar files.
The <project>\WEB-INF\lib\*.jar files.
... and also the deployment assembly entries (within the project's properties).
Check out every one of these and compare with your partner ones.
I am trying to create a WebServices REST project with IntelliJ IDEA. The idea is to supply some files to the user, but it seems that I can't find them in Tomcat's directory. For now I am trying to serve just a simple index.html page, but Java reports that the file could not be found. My current project structure is this: I thought that any data should be in the WEB-INF folder, or have I put it in the wrong place? Also, this is my GET function with the class I'm using: Any idea what I am missing?
I am using spring MVC validation for my login form in eclipse.
Here i want to add my jar files (Hibernate-validator,javax.validator etc..) into the lib folder in the WEB CONTENT.But if every time i add it will get into Javascript Resources.
I do found these question in forum but still cant get the right answer.Can any suggest me want i have to do.
Check if any copy of it is actually physically being copied to your javascript resoures at runtime. If so there might be some setup which is doing so, otherwise there is no possibility of your jar files being copied to your javascript resources.
I have a web application that I developed in Java over Play 2.2 framework.
When I am running the app locally one of my java class which is accessing some files in the project folders run fine.
After I create a jar file and run it, the java code is not able to read those files. The files are in the public folder and I have ensured packaged in the jar.
There are other files which I have referred from HTML and they are accessible but the java classes are not able to access the files.
Please help me solve this issues.
I think you are trying to access a file inside a jar. If I have understood your question. Please correct me if I am wrong
You could use something like this:
InputStream is = this.getClass().getClassLoader().getResourceAsStream(fileFromJarFile);
If test.txt was in the root of your JAR file, you'd use:
InputStream is = this.getClass().getClassLoader().getResourceAsStream("test.txt");
NOTE : The file and the java class needs to be in same jar file.
The code was all fine in my case, the directory structure at the jar side was where I missed the part.
I had to keep the files/folders in the directory as same as that of the jar as #APaul said, I tried that but it did not work because I was using a batch to run the jar. My files should have been in the folder containing the batch file. My bad!
Anyways Thanks #APaul.