Hot answers tagged

14

At jClarity we've definitely followed this approach. We have a 'pure' HTML5 front end - AngularJS, HTML, CSS and a host of Javascript micro frameworks which is a separate project to the backend - vert.x with a variety of verticles coded in separate JVM languages as appropriate. The trick is to have a well defined messaging API between the two that is tested ...


10

IIS provides a number of common capabilities that are not available by default in self-hosted web services. Supervisor: it monitors the health of the web application and will kill/respawn the application if it starts looking unhealthy (using too much memory, CPU, etc. -- configurable). Resource limits like CPU usage, connection limits, etc. Run as a certain ...


10

If you re-read your question, you will find the answer perfectly clear. It is a horrible idea but the boss probably doesn't care and just want to scam some poor clients by sending junior employees billed as experts and pocket the difference. Its quite a common occurrence and doesn't usually end well especially for the employee. If they actually have a ...


8

Apache is the Apache Web Server also known as httpd. See http://httpd.apache.org Tomcat is Apache Tomcat. See http://tomcat.apache.org httpd is a web server whereas Tomcat is a Servlet Container. While at the simplest level both can be viewed as web servers that serve static files they have very different focuses. httpd is typically used to host static ...


5

This is essentially what an Object/Relational Mapping Framework (such as Hibernate) can do for you. It provides a layer on top of the database that abstracts away the details of querying the database by providing a database-independent layer and query language. Hibernate provides (among other ways of querying the database) HQL for this: from Cat as cat left ...


5

This is where I feel the Sun enterprise vision for Java failed. The idea is that application servers only vary by implementation and any Java app can be dropped into any container and "just work". If you read their literature from the early days, they also had specific roles called out, like developers who just wrote beans, assemblers who just took beans ...


4

I find it stupid and ridiculous to ask for some one with a specific server implementation experience. Based on my limited experience, our development team is also responsible for the J2EE container. We make sure that the code and server together solve the problem we're working on. Who else would have such insight as to what tools or frameworks are needed ...


4

Jelayn's answer is pretty good, and represents roughly standard practice, esp in the Rails world where a similar solution is baked into the framework. However, the state of the art, as practiced by Facebook, Flickr, Heroku, and IMVU - a pioneer in this - is a bit more advanced. The problem with the standard practice is that it assumes you can write 2 ...


4

I agree with @FrustratedWithFormsDesigner in that it is quite possible, AND that the script for updating your database structure should not be brought along with your application code. Because of this your application would require other permissions allowing to create tables, alter tables, etc. which you most probably don't need during the "normal" usage of ...


3

If you are considering only a scaled out, clustered environment, with replicated Sessions, then you don't have a workaround. All of your objects must be Serializable. But if your application and Java EE architecture allows you to do a scaled out "clustered" environment without replicated Sessions, then you are fine. The only thing you will lose here is the ...


3

Take a look at the SmartCard API for Java This specification describes the Java Smart Card I/O API defined by JSR 268. It defines a Java API for communication with Smart Cards using ISO/IEC 7816-4 APDUs. It thereby allows Java applications to interact with applications running on the Smart Card, to store and retrieve data on the card, etc. The API is ...


2

I usually have db changes deployed outside the main application, usually via a script that is executed by the DBA. I suppose you could do the changes from inside your application, if your application has permission to modify the database structure. I guess what would have to happen is your application would start up, some new procedure would run at startup,...


2

In my experience building applications using Maven for Tomcat 6 and Tomcat 7, I never needed to deploy jars explicitly to Tomcat's common lib directory. Take a look at this post: https://stackoverflow.com/questions/267953/managing-libraries-in-tomcat Answers there indicate that conflicts may arise between classes in the shared common lib folder, and those ...


2

The easiest approach if you can accept the drawbacks is to have tomcat as a passive server such that it never contacts the server app. All data flows the other way by periodicly sending heart beats to tomcat and retrieve the json data you mentioned. The drawbacks is that it will (only) be eventual consistent so you will have to accept a small time delay. ...


2

There are two kinds of threads. Running threads and not-running threads, aka suspended threads. Suspended (not-running) threads are merely data structures. Yes, these data structures necessarily have pointers to code, but they are still very much data structures in every sense of the word. Suspended threads may be resumed and then later once again ...


2

Any existing limitations, except that Java EE specific version needs to support annotations? One thing I know of is ordering. From the Servlet 3.1 specs: The order in which the Listeners, Servlets are loaded from the various framework jars / classes in the WEB-INF/classes or WEB-INF/lib is unspecified when using annotations. If ordering is important ...


2

You can grab requests in several places before they reach the endpoint (and your application). If you want a single class that will handle all incoming requests then define a filter and handle it there, if you're looking into something more global, lets say for all your entire Tomcat applications, try writing a Valve.


2

The standard practice is not to attempt to change what would otherwise be considered a valid request through modding. The whole point of using a web container is so that it can host your application in a uniform way without really requiring dependencies between your application and the actual hosting. Otherwise you would necessarily require the use of ...


2

If you're using microservices then it should not matter which microservice is written using which technology. Having two languages and runtimes for two parts of the systems can have a disadvantage of having to configure two types of deployments but it shouldn't be complicated if done well. On the other hand this seems like using the right toll for the job. ...


1

Why can't you disable HTTPS and redirect requests to HTTP? When a browser makes an HTTPS request the steps go roughly as follows... Look up the host name (FQDN) in DNS if needed to get an ip address. Get a TCP connection to the host's ip address on port 443 ( or other you define ). Try to complete a TLS (or SSL) handshake and start encrypted communication. ...


1

The main goal of this architecture change is to avoid problems related to the fact of having different pieces of software doing similar work, but with different rules and algorithms, thus leading to coding mistakes and non-uniform behaviors across the system for a single entity. The way you do that is to create an API, and require everyone to use that API ...


1

TL;DR latency is unpredicatable in general. Start with investigating worst case. If REST host goes down, a call will only return after TCP timeout (configurable, defaults can reach 10 minutes). To prevent this ensure, you have adequate timeouts set on client's side and be ready to handle failures. Latency also depends on distance, hardware, software and ...


1

Absolutely, there is no reason they can not run on the same server. By default the web server runs on port 80 and tomcat runs on port 8080 so there are no port conflicts. I have configured a setup where a static/promo website is served by apache2 and then once the user logs in to the site they will be directed to www.bla.com/app which apache2 directs ...


1

Are you using a connection pool? very often I have seen developers using an application server without a connection pool and the majority of the time is spent establishing DB connections which are very heavy processes. Apart from that using a profiler like jprofiler (for which you can get an eval license) would be your best port of call to diagnose your ...


1

The enterprise features of Java (as in those in JEE) are not implemented by Oracle/Sun and are instead contained within the Java Enterprise Edition specification. As a result there are numerous implementations of application servers - Tomcat, Jetty, WebSphere, etc, all of which implement different parts of the JEE specification. Because you are using ...


1

thats right, the first package is to include ehcache into your own application (this application could also be just a REST Interface for the cache ) the second one bundels already an application server with it, because you need to run it on dedicated hardware which more memory, you need a shared cache for many webservers, or you dont have java client. ..... ...


Only top voted, non community-wiki answers of a minimum length are eligible