Frequently asked JBOSS Interview Questions And Answers
JBOSS Interview Questions And Answers are as follows –
Q1. What is JBOSS?
Ans: JBoss is a popular open source application server based on JEE technology. Being JEE based, the JBoss supports cross-platform java applications. It was embedded with Apache Tomcat web server. It runs under any JVM of 1.3 or later versions. JBoss supports JNDI, Servlet/JSP (Tomcat or Jetty), EJB, JTS/JTA, JCA, JMS, Clustering (JavaGroups), Web Services (Axis), and IIOP integration (JacORB).
Q2. What is JBoss JBPM?
Ans: JBoss JBPM is a workflow and BPM engine. Enabling the creation of business processes that coordinates between people, applications and services is the functionality of BPM engine. The combination of workflow applications development with process design is a feature of JBoss jBPM. The business process is graphically represented to facilitate a strong link between the business analyst and technical developer. This feature is provided by the JBoss jBPM process designer.
Q3. What’s the difference between Standalone mode and Domain mode?
Ans: When configured in Standalone mode each distribution starts a single JVM process with its own configuration, management instruments and deployments. When configured in Domain mode, multiple servers are managed from a centralized point called Domain Controller which maintain the configuration and provisions applications for deployment on the single nodes which are part of the Domain
Q4. What do you need to set-up a cluster with JBoss?
Ans: Basically starting JBoss with the “all” configuration contains everything needed for clustering:
It has all the libraries for clustering:
JGroups.jar, jboss-cache.jar
Clustered beans (cluster-service.xml)
HA-JNDI
HTTP session replications (tc5-cluster-service.xml)
Farming
HA-JMS
Q5. How do you monitor JBoss and detect the bottleneck of an application?
Ans: Different components of the application are to be measured. This step is to find where the degradation is, whether it is external or internal and where is the appliciation spending all the time. Using Joss JMX agents and monitoring the deployed components to the application server involves in the first step.
After finding the most of the time spent by specific components or libraries or most of the resources, one can use Jprobe a specialized tool for examining the single object or the objects loaded in the memory.
Q6. Is it possible to put a JBoss server instance into multiple cluster at the same time?
Ans: It is technically possible to put a JBoss server instance into multiple clusters at the same time, this practice is generally not recommended, as it increases the management complexity.
Q7. Does Seam run on other application servers besides JBoss?
Ans: Seam runs beautifully on other application servers – just like everything else the Hibernate team does, this is not a JBoss-only thing.
Q8. What’s jBoss cache in short?
Ans: JBossCache enables easy distribution of datasets across your computing environments. It is based on JGroups and enables clustering and high availability of that data. You may choose to distribute the data with JBoss Messaging to move it where it is needed for computation or event-based programming.
Q9. Which Hibernate object wraps the JDBC Connection?
Ans: The Session interface wraps a JDBC Connection. This interface is a single threaded object which represents a single unit of work with application and persistent database. It’s retrieved by the SessionFactory’s openSession() method.
Q10. How can you start a JTA transaction from a Servlet deployed on JBoss?
Ans: JBoss registers in the JNDI tree a JTA UserTransaction Object which can be user to manage a distributed transaction.
Q11. What optimization could I use if the EJB container is the only point of write access to the database?
Ans: You could activate the “Commit Option A” that is the container caches entity bean state between transactions. This option assumesthat the container has exclusive access to the persistentstore and therefore it doesn’t need to synchronizethe in-memory bean state from the persistent store at the beginning of each transaction.
Q12.Which component handles cluster communication in JBoss?
Ans: The JGroups framework provides services to enable peer-to-peer communications between nodes in a cluster. It is built on top a stack of network communication protocols that provide transport, discovery, reliability and failure detection, and cluster membership management services.
Q13. Is it possible to put a JBoss server instance into multiple cluster at the same time?
Ans: It is technically possible to put a JBoss server instance into multiple clusters at the same time, this practice is generally not recommended, as it increases the management complexity.
Q14. What do you know about Seam?
Ans: Built on the standards JavaServer Faces and EJB 3.0, JBoss Seam unifies component and programming models and delivers a consistent and powerful framework for rapid creation of web applications with Java EE 5.0. Seam simplifies web application development and enables new functionality that was difficult to implement by hand before, such as stateful conversations, multi-window operation, and handling concurrent fine-grained AJAX requests. Seam also unifies and integrates popular open source technologies like Facelets, Hibernate, iText, and Lucene.
Q15. How do you monitor JBoss and detect the bottleneck of an application?
Ans: The first step is to measure the different components of your app to see where the degradation is. Is it an external resource (database, message server, etc.)? Is it internal? Where is the app spending all its time?
So the first step could be to to use JBoss JMX agents and monitor the components deployed to the application server. Once it’s clear which component or library takes most of the time or most of resource you can use a more specialized tool like JProbe and examine the single method or the single objects loaded in memory.
Q16. How can you start a JTA transaction from a Servlet deployed on JBoss?
Ans: JBoss registers in the JNDI tree a JTA UserTransaction Object which can be user to manage a distributed transaction.
Q17. What is the difference between validate-on-match and background-validation? can you use both of them?
Ans: When the validate-on-match option is set to true, the database connection is validated every time it is checked out from the connection pool using the validation mechanism specified in the next step.
On the other hand, background-validation fires a background validation as dictated by the background-validation-millis.
You cannot apply both of them, they are mutually exclusive.
Q18. Porting one application from Standalone mode to Domain mode: is it guaranteed that you won’t run in any issue?
Ans: One core difference between Standalone mode and Domain mode is that Standalone mode allows manual deployment of applications by copying archives into the deployment folder. On the other hand, in Domain mode applications are managed and copied through the CLI or the Admin Console into the data folder of the single nodes. That being said, some applications might require to know the physical path where the application has been deployed: one good example is LifeRay portal which requires some workarounds to run in Domain mode. So always check the applications requirement before committing to a change from Standalone mode to Domain mode.
Q19. Why should I prefer mod_cluster over mod_jk?
Ans: In terms of configuration: The httpd side does not need to know cluster topology in advance, so the configuration is dynamic and not static and as a consequence you need very little configuration on the httpd side
In terms of load balancing: You have an improved load balancing as main calculations are done on the backend servers, where more information is available and thus a fine grained web application lifecycle control
Q20. What is the difference between JAX–WS and JAX-RPC?
Ans: Java API for XML-Based RPC (JAX-RPC) is a Legacy Web Services Java API, it uses SOAP and HTTP to do RPCs over the network and enables building of Web services and Web applications based on the SOAP 1.1 specification, Java SE 1.4 or lower.JAX-WS 2.0 is the successor to JAX-RPC 1.1. JAX-WS still supports SOAP 1.1 over HTTP 1.1, so interoperability will not be affected. However there are lots of differences:
JAX-WS maps to Java 5.0 and relies on many of the features new in Java 5.0 like Web Service annotations.
JAX-RPC has its own data mapping model, JAX-WS’s data mapping model is JAXB. JAXB promises mappings for all XML schemas.
JAX-WS introduces message-oriented functionality, dynamic asynchronous functionality which are missing in JAX-RPC.
JAX-WS also add support, via JAXB, for MTOM, the new attachment specification.
- What is JTA?
Java Transaction API (JTA) specifies standard Java interfaces between a transaction manager and the parties involved in a distributed transaction system: the resource manager, the application server, and the transactional applications.
The Java Transaction API (JTA) allows applications to perform distributed transactions, that is, transactions that access and update data on two or more networked computer resources.
The Java Transaction API consists of three elements: a high-level application transaction demarcation interface, a high-level transaction manager interface intended for an application server, and a standard Java mapping of the X/Open XA protocol intended for a transactional resource manager.
Q22. What is the difference between Hibernate and EJB 3? Do not you think EJB 3 is just a clone of Hibernate?
The perception of EJB3 as being a simple clone of Hibernate is primarily based on developer familiarity with Hibernate and a similarity of naming, as well as common purpose, and that Hibernate is morphing itself into an EJB3 implementation based on the work going into the specification, not the other way around.
EJBs are supposed to be components, in the sense that they’re not just one class, but a set of classes, descriptors and usage and management contracts. All of this in order to allow a container (JBoss, Weblogic, etc.) to provide services to those components, and to be able to reuse and distribute this components. This services are, among others, transactions, concurrent access control, security, instance pooling, etc.
Hibernate is “just” an ORM (Object/Relational Mapping) tool. Quick and dirty, this means you can store an object tree belonging to an class hierarchy in a relational DB without writing a single SQL query. Quite cool, IMO. But no transaction control, no instance pooling, no concurrency control, and certainly no security.
Q23. Is the Session Factory Thread safe?
Yes, that is many threads can access it concurrently and request for sessions. It holds cached data that has been read in one unit of work and may be reused in a future unit of work. Good practice is to create it when the application is initialized.
Q24. How can you start a JTA transaction from a Servlet deployed on JBoss?
JBoss registers in the JNDI tree a JTA UserTransaction Object which can be user to manage a distributed transaction.
Q25. What if you need to span your transaction across multiple Servlet invocations?
You can’t with a Servlet. A JTA transaction must start and finish within a single invocation (of the service() method). You should consider using a Stateful SB. In a SFSB with a JTA transaction, the association between the bean instance and the transaction is retained across multiple client calls.
Q26. What are the differences between EJB 3.0 and EJB 2.0?
EJBs are now plain old Java objects (POJO) that expose regular business interfaces (POJI), and there is no requirement for home interfaces.
-Use of metadata annotations, an extensible, metadata-driven, attribute-oriented framework that is used to generate Java code or XML deployment descriptors.
-Removal of the requirement for specific interfaces and deployment descriptors (deployment descriptor information can be replaced by annotations).
-Interceptor facility to invoke user methods at the invocation of business methods or at life cycle events.
-Default values are used whenever possible.
-Reduction in the requirements for usage of checked exception.
-A complete new persistence model (based on the JPA standard), that supersedes EJB 2.x entity beans
Q27. What is the difference between a local-tx-datasource and a xa-datasource? can you use transactions in both?
A local-tx-datasource identifies a data source that uses transactions, even distributed trans actions within the local application server, but doesnt use distributed transactions among multiple application servers. An xa-datasource on the other hand identifies a data source that uses distributed transaction among multiple application servers.
Q28. What do you need to set-up a cluster with JBoss?
Basically starting JBoss with the configuration contains everything needed for clustering:
It has all the libraries for clustering:
– JGroups.jar, jboss-cache.jar
– Clustered beans (cluster-service.xml)
– HA-JNDI
– HTTP session replications (tc5-cluster-service.xml)
– Farming
– HA-JMS
Q29. What optimization could I use if the EJB container is the only point of write access to the database?
You could activate the “Commit Option A” that is the container caches entity bean state between transactions. This option assumes that the container has exclusive access to the persistent store and therefore it doesnt need to synchronize the in-memory bean state from the persistent store at the beginning of each transaction.
Q30. What do you think about BPEL and BPM ? How do they compare?
BPEL and BPM are quite different things so they cannot even be compared. The problems boils down to the fact that these years maybe BPEL has been marketed for something which isn’t: that is a Business Process Management framework.
BPEL is made up for service orchestration, that is publishing new services as a function of other services.
while BPM is needed for handling human task management functionalities and subprocess management.
Q31. Can I use AJAX with Seam?
Yes, Seam provides excellent support for AJAX. First, Seam supports the ICEfaces and Ajax4JSF Ajax component libraries for JSF. If you prefer a more “old fashioned” approach, Seam provides a complete JavaScript remoting framework which lets you call Seam components and subscribe to JMS topics directly from the client. Please refer to the Seam remoting example application on how to use AJAX remoting to implement a chat room.
Q32. What is the directory structure in JBoss?
The following directories are available after JBoss is installed.
modules
bundles
domain
standalone
appclient
bin
docs
welcome-content
Q33. What are the logging levels available?
There is five possible levels:
FATAL
ERROR
WARN
INFO
DEBUG
Q34. How to install JBoss on Linux server?
JBoss installation is very straightforward. You need to download the desired version from JBoss official download page in zip or gz format.
Once downloaded, just extract the file to the location you want to install. If you downloaded zip format, then you can use unzip command to extract it.
unzip jboss-as-7.1.1.Final.zip
Q35. What’s the default port to access Administration Console in JBoss 7?
9990 is the default port. If it’s installed on server1 then you need to access like:
http://server1:9990/admin-console
Q36. What must be done to access Admin Console?
The user must be created under “ManagementRealm” to have console operational. To create the user, you can go to bin folder and execute add-user.sh script.
Q37. How to start JBoss in standalone mode?
Go to the bin folder where JBoss is installed and start with the following command.
./standalone.sh
Q38. How to increase Java Heap Memory in JBoss 7?
Heap Memory can be increased in a respective conf file. To increase memory for standalone;
Go to the bin folder
Edit the standalone.conf file and look for “JAVA_OPTS=” argument line
The default configuration will have a minimum of 64 MB and a maximum of 512 MB. You can increase to the desired value.
Xms – specify the minimum heap size
Xmx – specify the maximum heap sizeCopy
In a similar way, you can adjust the memory for a domain in domain.conf file
Q39. What is the difference between standalone and domain mode?
Standalone mode is single JVM process where every JBoss server has its configuration. If you just need one JVM or development environment, then standalone would be perfect.
Domain mode may have multiple servers where all configuration is managed centralized and often used in production environment.
Q40. Can you create a cluster in standalone mode?
Yes, clustering is possible in standalone mode. However, an application must be deployed on each server/JVM in standalone mode.
Q41. What is difference between <validate-on-match> and <background-validation>?
<validate-on-match> validate the database connection every time, and if a connection is not valid, it will write a warning in the logs.
Having “validate-on-match” configured may have a little high load on the database as it may create lots of requests.
<background-validation> validate the connection periodically based on what frequency is configured for “background-validation-millis”. The default configuration is set to zero means disabled.
Having “ background-validation” set to true will create fewer database connections and it’s side-effects would be not detecting immediately if dead connections.
Q42. What module needed to integrate Apache with JBoss?
There are two modules you can use to connect JBoss with Apache.
mod_proxy
mod_jk
Q43. What are the file types you can deploy in JBoss?
You can deploy almost any kind of Java/J2EE application, and it supports the following file format.
WAR – Web application archive
SAR – Service archive
JAR – Java Archive
EAR – Enterprise application archive
Q44. How can you deploy an application?
There are three possible ways to deploy an application in JBoss application server.
Admin Console – you can deploy the necessary application files through the administration console.
Auto-deploy – leverage file system deployment scanner to auto-deploy files from the deployments folder.
Automation – use automation tool/ant/scripting to deploy an application.
Q45. What marker file type is required to instruct JBoss to deploy?
.dodeploy file suffix is needed for JBoss to deploy or redeploy an application.
Ex:
myfirstapplication.war.dpdeploy
Q46. What are the important types available for marker file deployment?
.dodeploy – instruct to deploy
.deployed – indicate the file is deployed
.pending – deployment is still pending
.undeployed – confirmation that application is undeployed
.failed – deployment is failed for some reason
.skipdeploy – instruct JBoss to ignore the files for auto-deployment
Q47. What does mgmt-user.properties contain?
All admin console users and passwords (encrypted) are stored in mgmt.-user.properties file.
I hope the above gives you an idea of what type of questions being asked in the Interview and wish you good luck.
Related Posts:
- Latest Weblogic Interview Questions and Answers
- Apache Kafka Interview Questions and answers
- Latest Docker Interview Question And Answer
- Apache Tomcat Interview Questions And Answers
- OHS Interview Questions And Answers
- Latest OSB Interview Questions And Answers
- Microserverices Interview Questions And Answers
- TOP 200+ JAVA Interview Questions And Answers
For more Interview Questions And Answers click here