I just started developing with Java EE and JSF 2.x. Till now I'm very proud of my small applications with Connection to databases and ldap.
Now I need to connect to our Application API via some exteral jar libraries(C:\Program\A\lib1.jar, C:\Program\A\lib2.jar) so that I can add / change things / settings via JSF Webpages over Application API.
I have no idea how to solve this.
Any idea or helpful explanation or tutorial how to do that? (I'm using Wildfly 10.1) and I'm not using Maven.
Putting the jar files as dependency leads to a ClassNotFound exception.
It would be very helpful to get an example on how to add and accesses external jar libraries.
Related
Currently i am working on one application related to document search using lucene. On my Local System the application is running properly. But When i tried to integrate the application with the organization web application the application is not running.
The problem is that organization web application is old one and is using the old libraries "Xerces" and it's getting the conflict and if replace the old "Xerces" libraries with new one "Xerces" the application is not starting since some of the modules are using old one.
Now i think is there some way through which i can create one more application with it's set of libraries in glassfish server so that both the application runs without conflict within the domain1.
Also if there is any better way please suggest me how to proceed
We are currently developing a web application for college and we would like some advice from a more experienced developer.
We have a backend using Hibernate to operate on a MySQL database. Another project is the web UI that uses the API delivered by the backend (registering user, fetching data associated with certain profiles etc.). We use the JSF framework (RichFaces) for the UI. Everything is built using Maven.
The technology we can't decide on is for the communication between UI and logic modules. The first option is to use ApacheCXF to provide SOAP webservices that UI can be a client of. The second option is to use EJBs to invoke backend methods from the UI module.
What approach is more widely-used? As far as we read on the Web, using EJB is faster than SOAP webservices. On the other hand, we don't have any experience with EJBs using Tomcat (we would prefer using Tomcat since it seems to be a cheaper option, however we don't know what we would have to do in order to use EJBs with Tomcat). Additionally, working with webservices since the beginning will allow us to add support for different platforms (for example, Android).
Another aspect which we are discussing is about how should the application be deployed. The alternatives we have considered right now are:
Deploy it as a single WAR project (which would solve the problem we have about communicating the UI with the backend of our application).
Deploy two WAR projects in the same server using webservices for communication between the projects. (We have a prototype using this approach deployed on a Tomcat server)
Deploy a WAR project and EJB project.
Deploy an EAR project which would contain the references to the WAR and EJB projects. (We have a prototype using this approach deployed on a Glassfish server)
The project right now is starting, so we will only be handling a couple hundreds of users right now. However, if the project succeeds we would need to deal with a couple million of users.
Any advice would be appreciated. Thanks.
Edit: So any advice about how the project should be deployed? Is it necessary to use EAR? Is there any advantage if we deploy the project as an EAR module?
Edit 2: We found the advice we needed on this thread: Deploying java applications (Tomcat/Glassfish)
First things first. I would avoid using Web Services if there's no need for it. If you feel that you might need to call this system from external programs and platforms, then go for it. Even then, I would only use the web service interface for external integration, and still have an internal EJB implementation.
EJBs are awesome for enterprise applications. I would highly recommend that you look into that. They provide support for EJB Pooling, Transactions, Aspect oriented programming, Security, Stateful sessions, Java Messaging, JNDI etc. And you can inject them directly inside a Managed Bean (JSF). You said that you will eventually handle millions of users, so I assume that you will want your application to run as fast as possible, I don't think SOAP web services will be a good fit. Remember that SOAP web services encode messages as text, so if your application will be sending binary files etc, then you'll suffer significant performance issues.
As far as deployment goes I would go with an EAR, or a WAR for the JSF and and EAR backend. you can use Injection to pull the classes you need, even remotely, from multiple web applications and other EAR apps.
I'm not sure why you say Tomcat is Cheaper. Glassfish open source edition is a fully functioning JavaEE6 Server and its free. JBoss is also JavaEE compliant and is free. both of them are used in lots of production environments. I find glassfish to be much more user friendly, and would recommend it to EJB noobs :)
I also started with Tomcat, but now I don't use it at all. why use the servlet container only, when you can have the whole shabang? hope this helps.
we use ApacheCXF at work and its has SOAP and Restful. Reliable and relatively easy to setup. I am not sure why you want to use glassfish maybe it's preference but you can implement your projects in eclipse too. It's really that is up to you and your team and the requirements and skill sets your team may have to build and support, that a side CXF webservice+apache + eclipse with maybe two war files would be a good path.
I wouldn't use web services in this case. You can use managed beans as controllers.
Put the logic into EJBs, views into rich faces and control the flow using managed beans.
If you use maven you can generate a project with the structure of EAR (war for web module and jar for ejbs). I don't remember the name of an archetype but you can find it easily.
Is it possible to deploy my Spring/BlazeDS/Java application to elastic beanstalk? I'm using MyEclipse and built a Java Web Project with the required jar files etc. Do you need to specifically create an AWS Java Web Project - reason I ask is the options to include the BlazeDS files aren't there - so I'm wondering if Spring / BlazeDS is even supported? By default the turnkey blazeds runs through Port 8400 - so I imagine there are some additional tasks required to configure the endpoints to work through port 80?
Gracias!
Take a look at this example. Will be trying something similar over the next few weeks.
http://www.riaspace.com/tag/aws/
BlazeDS is not a standalone application, it consists from a bunch of jar files which should be added to your web application. You will also need to declare a servlet in the web.xml file. I wrote an article a couple of years ago how to add the blazeds jar files to a java web application (and what to configure), you can take a look here.
We want to evaluate OpenEJB for our application. We have already performed some tests and now we need to start a pilot project.
While I've seen how to use OpenEJB for testing purposes (mainly for JUnit tests), I have not seen how to set up an EJB 3.X project inside Netbeans for deployment in OpenEJB.
The way we did for testing purposes was to create a new Java EE project, select JBOSS as the Application Server and then manually copy the JARs to OpenEJB. However, we want to be able to debug the code in Netbeans. If I try to do that, NB launches JBOSS or other application servers. I couldn't figure out how to install OpenEJB as a server in Netbeans, I didn't find anything enlightening in Java forums and there were no answers from stackoverflow.
We know we can use an embedded version of OpenEJB, but that is not what we are looking for. So:
What is the suggested project structure for an EJB application for Netbeans + OpenEJB?
Is it possible to use Netbeans' Java EE knowledge (wizards, build system, client applications) with OpenEJB?
If we need to use OpenEJB just as libraries in the classpath, what is the correct approach to generate EJBs and client applications that can work with other EJB containers later (stay Java EE compatible)?
Unfortunately, the folks behind the OpenEJB project have not contributed a server integration plugin for OpenEJB to the NetBeans project... It looks like they haven't published one on the NetBean Plugin Portal, either.
That means that you will need to be creative with your development and debugging.
I guess you could...
register GlassFish Server 3
create an ejb project that targets that server.
code, code, code.
build the project archive (dot-jar file)
start the openejb server in debug mode
copy the jar file created in step 4 to the appropriate location.
Use the 'Attach debugger...' item of the Debug menu to attach to the openejb server that you started in step 5.
If starting openejb requires that you start multiple processes (one for Tomcat and one for the ejb container), you can attach NB to multiple processes at the same time.
I have WebLogic installed in my computer. I already added it as a server in my Eclipse IDE. How do I configure my Web application to run or for it to be deployed on the WebLogic server. I found a sample project and found a weblogic.xml in it. Where do I start? Do I need to add something, etc.
If your web application is already a "Dynamic Web Application", then you should be able to deploy it just by right clicking on it, then Run As > Run on Server and choose the WebLogic Server runtime.
If this doesn't work, maybe you need to add the right facet to your project. Right click on your project and go to Properties > Project Facets and check that Dynamic Web Module is checked.
If this still doesn't work, maybe recreate a "Dynamic Web Application" from scratch and move (or copy) your sources to this newly created project.
Many tutorials are actually available at the WTP Community Resources page. See for example Using the Eclipse Web Tools Platform with Apache Tomcat. It is not specific to WebLogic but if you already have it setup in Eclipse, it should be easy to adapt the specific parts.
PS: It's hard to say anything about your sample project and the weblogic.xml as you didn't provide any detail about them. Maybe try to follow the advices above and, if you still have problems, update your question with more information.
There are a number of resources on using Eclipse with WebLogic, including Oracl'es Enterprise Pack for Eclipse. It's hard to tell without more information, but you need a WebLogic Domain configured with at least an Admin Server to deploy the web application to. When doing local development, it's acceptable to deploy applications to the Admin Server, but beyond this you typically want an Admin Server and a managed server where the application will get deployed to.
Here's some info on Eclipse and WebLogic - http://www.oracle.com/technetwork/developer-tools/eclipse/learnmore/index.html
Question is missing much details. You can find some detailed help here
http://download-llnw.oracle.com/docs/cd/E13222_01/wls/docs90/deployment/index.html