I had developed a lucene search engine (with Lucene 5.2.1) and now I want to embed it into a very simple web application (it has demonstrative purpose, it will run in localhost).
This web application should let the user insert some keywords and navigate through search results (in other words it should let the user read the index that I had created, with appropriate html formatting). I had already made some simple html GUI with Bootstrap.
I'm very new to web applications, but I had been told that a good idea would be embedding Lucene in a TomCat server. I had visited this link, but it's quite old and not very detailed. I have tried to look for "lucene tomcat" but I get results about SolR or very specific posts.
Can anyone please suggest me a good resource or a general approach to my issue?
Many thanks
My solution:
I wrapped my search engine library into a JAR file.
I downloaded zipped version of TomCat 8 and installed it into my Eclipse environment as a new Runtime Enviroment.
I made a Dynamic Web Project in Eclipse (see this video lesson) using TomCat 8 server.
I put the JAR into my webapp (should be something like WebContent\WEB-INF\lib\searchEngine.jar)
I created a Servlet to handle user input.
I did the rest using very simple JSP pages, embedding Java code that uses my JAR (I know, that is not so good but it works!)
Cheers!
Related
this is my first question on stackoverflow and I'm really confused..
I'm new with java and very confused at this moment. I'm planning to create a java web service with spring that handles a webform and a portable scanner device. I get this project for my first in new workplace but I can't move on. I don't know what are the neccesery steps to succeed.
What I want from the Application running step-by-step:
Open in an executable file that
Open a new browser window on localhost and shows a form
Filling out form with input fields, checkbox items, dropdown list,
commentbox,
AND Option for file upload from local and/or call startScan() java method.
startScan() = take photo from device and saves it to project's root folder and rename it as formatted date: "yymmdd_hhmmss"
submitButton()
onSubmitButton() the form data should be saved in database that
later i can download as xml
I have read lot of blogs and watch tutorials but that causes me confused. JPA? Hibernate? REST? REACT? I would like to create a very simple app that can display the form on window browser that is easy to access with bootsrap.
What is the neccesery toolset for doing this as simple as possible?
mysql? postgresql? which of these I can implement, what should i install locally?
If I could came out from back end to front that would be awesome..
Goal: Create a localhost database system that handles the form and scanner device method in a fancy css view.
Now, I'm using eclipse with spring. What are the neccesery dependencies? what are the local requirements for this kind of project? Please, help me with any advices..
I am very grateful for everything
Thank you in advance
I designed something similar, a simple two-page web application with login functionality and application main page that supports database operations and scanning functionality.
I would recommend you to go step-by-step since documentation is also as important, to be able to clearly visualize the project objectives, to know the constraints before-hand, make modifications on-the-fly and as a reference for your peers.
As a newbie with Java development, these are some basic steps and links which I feel would be helpful:
Project Scope Document (Web based tool: Draw.io)
Project Plan Document
Site Map (Web based tool: Draw.io)
Front-end Wireframing (Web-based tool: Balsamiq)
Back-end Wireframing (Microsoft Excel)
Back-end Flow chart (Web-based tool: Draw.io)
Front-end development (Technologies: HTML5, CSS3, Bootstrap 3, JavaScript; Tool: Brackets)
Back-end development (Technologies: PL/SQL or MySQL, Java, JDBC, Servlet, JSP, JSTL; Tools: SQL Developer, JBoss Studio)
Integrating Scanner (Third-party Java APIs)
Technology Stack: This is a simple and very generalized stack preference. You could customize it according to your needs.
Helpful Links on getting started: Java Web Terminology, JBoss Hello-world tutorial, Simple Java web application
Tools: Draw.io and Balsamiq are easy to use web based tools. You could use Bootstrap to make a quick fancy front-end. Brackets is a nice front-end code-editor supporting live-previews. SQL Developer is a wonderful tool if you're using Oracle SQL. JBoss Eclipse IDE has in-built application server which you can use for testing on localhost.
Note: All tools and technologies listed here are either free or include a trial version.
Hope that helps!
For the past few days I'm stuck at trying to pass a PMML file with .xml extension that I created using R and pmml package. After creating a iris.xml PMML file I have no where to go, actually I don't know what to look for. And then I saw Alex Guazzelli's video here, where he tells us to use ADAPA from Zementis to run the PMML files that are created from R.
What I took away from the video is,
I want to do something similar as shown, like uploading my PMML file at some place and input my test files frequently to get the corresponding predicted values.
ADAPA looks great, but looks like it also costs some money. So I would like to look for an alternative, which might not be as user friendly as ADAPA.
Then I found this page where the author says,
So the first step was to get the engine running. I experienced some small problems but Scott fixed them very fast and offered a new war file ready for deployment inside tomcat. It can be obtained under http://code.google.com/p/openscoring/. If you still encounter some problems you could also try my war file. It was built with java version “1.6.0_26” and tested under tomcat 7. After installing the war file using the management console, you could test it by sending a POST request in XML like the following to ‘http://localhost:8080/OpenScoring/Scoring’
Then I found jpmml. The problem here is the package names are very confusing, I don't know which one to install. In fact I don't know how to install each of them. I have basic knowledge of Java, apparently it isn't helpful in the current scenario.
Desperately looking forward for any kind of help.
How do the data flows in your application look like? Zementis' ADAPA is a standalone web service, which lets you do scoring in a request/response fashion. This works for web applications, but is clearly sub-optimal if you're looking to score larger amounts of data.
The JPMML project provides "PMML runtimes" for most popular big data frameworks. For example, if your application is tied to Apache Spark, then you would go for the JPMML-Spark project, if tied to Apache Hive/Pig, then for the JPMML-Pig project, etc. For a simple REST web service you should check out the Openscoring project, which is functionally identical to Zementis' ADAPA.
All JPMML projects can be built from their source checkout using Apache Maven by issuing the following command:
mvn clean install
Some JPMML projects also have their binaries distributed via the Maven Central repository. If you're looking for the Openscoring WAR file, then you need to search for "openscoring-webapp" and on the results page click the "download WAR" link (at the time of writing this, you would get openscoring-webapp-1.2.12.war). This is a standard WAR file that can be dropped to the auto deploy folder of your favourite Java web server (Tomcat?) as it is. The REST API of the web service is fully documented in the README file of the Openscoring project.
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
I am using eclipse IDE for web development....I hav e made my application and now i m trying to integrate a spellchecker in my application..and also as per the limitations of my project i have to use a spellchecker that uses jsp...so i surfed net and found a few and downloaded there demo version...now i m trying to integrate them in my library but its becoming difficult for me to do the same.one i have integrated but the other two are giving me a hard time....If any one could suggest to me nice tutorial which will give me good assist inintegrating a library into my application or can anyone take the trouble of giving me the minute details on how to do it......
the files contained in the spellchecker are of jsp js inc and obviously the jar file....
I would really appreciate any help.....
I have used Jazzy for web application. You have to these API in your jsp. You can also play with AJAX as well. If you application deployed in single environment and not stable then you have take care of dictionary where Jazzy put words. Because when you add words it will be stored in the file. That kind of difficulty you can face in if an application multiple server. Please find tutorial.
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.