In a textbook exercise, we make 3 Java classes and an XML file.
My questions are:
Where should I save these .java files? I'm using NetBeans 6.5 so the default is My Documents.
What should I name the XML file?
I am using XAMPP so the file WSDL.xml I put in xampp/httdocs but when I open 127.0.0.1:9876[/]ts?wsdl it says page not found.
Note: I do not need to know how to create a Java class. I need to know where to put the file in which the class is defined.
Subjective opinion:
If you don't know such basic things such as placing java files into right directories, perhaps, you should first try a few much simpler examples, than creating a web
service.
In Netbeans, you can create a Java project, than add Java classes by doing
File -> New... -> Java -> Java Class
To learn how to use Netbeans, visit:
http://netbeans.org/kb/
Especially "NetBeans IDE Java Quick Start Tutorial" might be helpful to start.
Furthermore, you don't run Java webapps with some kind of XAMP,
but with Java web servers such as Glassfish or Apache Tomcat.
Both these servers are bundled with Netbeans when you use
Netbeans Java profile (see table at Netbeans download page)
I think you should follow ivan_ivanovich_ivanoff's adive and start with the basics.
When you have done that, you might want to come back here and read my answer to the question Stack Overflow: Simple Java web services. It assumes you know how to compile a Java class and how to package it into a JAR, but since these are pretty basic tasks you have to learn anyhow, it might help you getting your web service up and running.
Look at the example code provided with the book.
Related
I'm aware of all the other questions about this topic, but I haven't found a good solution for my problem. Currently I am trying to use Java code in my C# project. I've already tried to convert the JAR files into .DLL files with IKVM, but this didn't work for me because the JAR files are to complicated to translate into C# because not every component, which were used in Java, can be found in C#. The normal call of the JAR file doesn't work for me either because I need to work with the class instances of the declared classes in the Java code.
Back to my question: Does anybody know how I could use Java code in my project? I've heard that it may be possible to implement Java code like it would be native, is that true? Note that I've to work with the class instances of the classes declared in the Java code.
I highly appreciate any kind of help, sheers!
Edit:
My work around would be that I include batch files, which are calling the JAR files. I will include these batch files into my C# Project and work with the batch files. This may be a even better approach for me because every input and output of the JAR files are done via XML files.
This kind of mixup are not generally a good approach. I think the .Net Framework is very mature and you can find everything you want to do your work.
I would suggest you the following approach :
You can wrap your Java library in a REST API and call it in your C# code. Your REST API can be hosted on an external server or use an embedded server or even a spring boot project.
You can read this post for more details.
I've been handed a JAR file, told it contains a web application, and instructed to deploy it. I'm familiar with java as a language, but I have next to no experience with its web ecosystem. Trying to run it as an executable, I find out it has no main class, so I take a look at the contents, and find that it has a META-INF/web-fragment.xml file, along with a couple of Servlet classes and some config files referenced in the xml. It looks like there is basically everything here for a complete application, but I have no idea how to actually deploy it, and google only yields tutorials on how to build these things from scratch with IDEs and deploy using maven plugins and goals.
Assuming that building from source is out of the question and I only have standard unix and java CLI tools available, based on the information provided (And I can provide more if necessary), what is the simplest way to get this up and running?
A web applicaton should be in a WAR file, not a JAR file, and you should only need to just drop it into the webapp directory of your Tomcat, or follow the instructions for whatever other container you're using.
If it's only a fragment, as appears from the XML, (a) it isn't a webapp, only part of one, and (b) you personally can't deploy it at all. You need the whole thing.
Send the assignment back for clarification.
I trying to create a servlet to logout from multiple JSF applications running on Oracle Glassfish. I tried the following code,
weblogic.servlet.security.ServletAuthentication.logout(request);
weblogic.servlet.security.ServletAuthentication.invalidateAll(request);
weblogic.servlet.security.ServletAuthentication.killCookie(request);
but I am not able to find the JAR file containing the required class in order to get the code to compile. I downloaded Oracle WebLogic and tried various of its JARs, but no one of them made the code to compile.
Which JAR does contain the required class and where can I find it?
The class you are looking for is in a jar named wls-api.jar.
However, you're probably searching for the wrong thing because if you are developing applications to run on Glassfish you should stick with the standard techniques (e.g. JSR-196 described here or here).
Because it isn't obvious what you are trying to implement I can't give any further detailed advice but there is plenty of documentation available about Java EE Security.
I think u need this jar file:
<JDeveloper Home>\Middleware\wlserver_10.3\server\lib\weblogic.jar
The file is located at <WLS_HOME>\middleware\wlserver\server\lib\wls-api.jar
I have big project in Matlab with some pretty complicated GUI. I'd like to put it on my apache server. The idea is: people should've access to it without downloading anything (I mean something like Java applet or web app). I've managed to create a .jar file by using the deploytool but I'm not sure it's the right way. I've read mathworks tutorial, but in the example: http://www.mathworks.com/help/toolbox/javabuilder/ug/bsqrikz-26.html they're using some piece of JavaCode which I don't really know where they got it from. In the end I've created a .war file but the apache sees it only as an archive, not as an application, so clearly I did something wrong.
So, could someone tell what I have to do step-by-step to create a web application from my Matlab code, please?
Thx!
There are a number of webinars by MathWorks showing how. Here is the most recent one I could find:
Application Deployment with MATLAB
For reference, there is a page listing all the options for deploying MATLAB on the web.
I have no idea about converting EAR file into exe(Executable file), Where are i am working with jboss and i developing webservices. I want to give my product as executable file . Can anybody has idea about this.
Thank you
Gobi, you've already posted a question regarding this on 15th March, to which you've got no response. I guess you've just rephrased that same question here.
Might I suggest asking your customer/client how she would like the web service 'ear' delivered? I'm also guessing you might have database scripts, properties/config files etc. I'd put my money on 'a zip containing the ear, database scripts (if any) with related documentation'
There is no way a customer would want to 'double click' your ear and have it installed directly onto a server. If you read your Java EE spec correctly, you'd find a 'deployer' role in there. Its not there for fun. Its a very serious role whose responsibilities include 'configuring' your application.
Think about it.
You mean you want customers/users/whatever to just be able to double-click on your file, and there's a web server up and running? While that would be possible, it's not really the way most people want to run web services. They're very likely to want to run your web service within an existing container, configuring it alongside other services.
An EAR file is already designed to be pretty much droppable within a container, so that's fine. You could also supply a zip file (or an installer) with a sample container setup using any of the free container implementations - either preconfigured with some reasonable default values (e.g. for the port) or running through an installer wizard. I wouldn't spend too much time on it though - I'd assume that most people who want to run a web service will already have some experience of setting up a container, or will have specific requirements you couldn't easily capture in a wizard without a lot of work.
I don't know about making EAR as executable.
There is a editor which converts your project into setup file or installer for windows .
Hope this helps.
I used NSIS editor and recommend it and it only creates installer for windows.
HM NSIS Editor.
you may also have look at izpack