Java EE





Java Enterprise Edition (Java EE) is a specification defining a collection of Java-based server and client technologies and how they interoperate. Java EE specifies server and client architectures and uses profiles to define technology sets targeted at specific classes of applications. All Java EE profiles share a set of common features, such as naming and resource injection, packaging rules and security requirements.

hi am having this error
There is a need to add a small method to an existing class inside a JAR file. When I rename the JAR file to zip, I am able to see the Java Class into which I need to add the new method. I do not have a project for this jar as the developer who programmed it is not with the company anymore, and for various reasons the project he developed is not available in the repository. Considering we very rarely need any modification on that jar file, was wondering if it is possible for me to do the required modifications directly within the JAVA file in the JAR, recompile just the CLASS file, re-zip it and rename it to JAR. Since this is an immediate requirement, I felt constructing the project might take more time.

Any inputs/suggestions greatly appreciated :)
hi am having error in my spring boot
log4j:WARN No appenders could be found for logger (org.jboss.logging).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See for more info.
663 [main] INFO - Starting NcsApp on Desmand-PC with PID 17780 (C:\projects\NcsApp\bin started by user in C:\projects\NcsApp)
663 [main] INFO - No active profile set, falling back to default profiles: default
2072 [main] INFO - Started NcsApp in 1.948 seconds (JVM running for 2.427)
2074 [main] INFO org.springframework.boot.autoconfigure.logging.ConditionEvaluationReportLoggingListener -

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2182 [main] ERROR org.springframework.boot.diagnostics.LoggingFailureAnalysisReporter -



A component required a bean named 'NocIigJDBCTemplate' that could not be found.


Consider defining a bean named 'NocIigJDBCTemplate' in your configuration.


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

Open in new window

is it better to represent as String and Object or will there be any issue in the future ?
Thanks Experts sir.

      public void buildObjectMap() {
            Map<String, Object> objectMap =  getObjectMap();
            objectMap.put("id", id);
            objectMap.put("status", this.getStatus());
            objectMap.put("scheduledDate", this.getScheduledDate());
            objectMap.put("visitationPoint", visitationPoint.toJsonizedMap());
            objectMap.put("teamId", this.getTeam().getId());
            objectMap.put("teamName", this.getTeam().getTeamname());
            objectMap.put("locationId", this.getVisitationPoint().getLocation().getId());
            objectMap.put("locationName", this.getVisitationPoint().getLocation().getName());
            objectMap.put("locationType", this.getVisitationPoint().getLocation().getLocationType().getName());
why data format is being set like this below on createdDate ? IS this correct expert ?
      public void buildObjectMap() {
            Map<String, Object> objectMap =  getObjectMap();
            objectMap.put("user_id", worker.getUsername());
            objectMap.put("session_id", session_id);
            objectMap.put("imei1", imei1);
            objectMap.put("imei2", imei2);
            objectMap.put("macId", macId);
            objectMap.put("session_id", session_id);
            // Date format is defined but it is used in the created_Date format which has been specified here
          DateFormat dateFormat = new SimpleDateFormat("yyyy-mm-dd hh:mm:ss");  
       // String strDate = dateFormat.format(super.getCreated());  

I have issue with the code base can some body help me, i am working on JPA but issue is how to pass the value in the findByOrgUnits
which is not correct. The value need to pass is a List value to the other screen. The content is List value which need to be pass to the
 the JPa Below, but the issue is which passing orgUnitTypes i am getting variable is not set correct in the input itself.

public AdminDTO getAllLookupData(int pageNo, int pageSize, String sortType, List<String> sortFields, String locale)
throws CmsDaoException {
            OrgUnitsLang orgUnitsLang;
            Long orgUnitId = orgunit.getOrgunitId();
            Set<OrgTransactionTypes> orgTransactionTypes;
            Languages languages = languagesRepository.findByLocale(locale);
            OrgUnits orgUnit = orgUnitRepo.findByOrgunitId(orgUnitId);
            OrgUnitTypes[] orgUnitsLang;
            List<OrgUnitsLang> orgUnitlang = orgTransactionTypesRepo.findByOrgUnits(orgUnitTypes);
            The code below
    public interface OrgTransactionTypesRepository extends JpaRepository<OrgTransactionTypes, Long>, JpaSpecificationExecutor{

	//to retrieve transaction type ids 
	List<OrgTransactionTypes> findByOrgUnits(OrgUnits orgUnits);
	OrgTransactionTypes findByOrgUnitsAndTransactionTypes(OrgUnits orgUnits,
			LookupTransactionTypes transactionTypes);

	@Query("SELECT orgTransactionTypes from OrgTransactionTypes orgTransactionTypes where orgTransactionTypes.orgUnits in :unitList")
	public List<OrgTransactionTypes> 

Open in new window

Why DTO(data transfer object) are not so good than DAO. Is it my understanding is less or more?

RS sir.
why getAllLookupData method of the below two has to map . i got this code from  internet as i have to look at it as there is some issue in it and can be used in my college project.
any help sir ?

	public ResponseEntity<?> fetch(@RequestHeader("userinfo") String userinfo,PageAttributes pageAttributes) throws AdminServiceException {

		HashMap<String, String> map=HeaderInfoUtility.getCredentials(userinfo);"-----username--------{}--",map.get(USERNAME));"------password-----{}---",map.get(PASSWORD));"------passwordEncrypted-----{}---",map.get(ENCRYPTEDPASSWORD));
		UserContext userContext=new UserContext();
		AdminDTO adminDto = lookupActionsService.getAllLookupData(pageAttributes.getPageNumber(),
				pageAttributes.getPageSize(), pageAttributes.getSortType(), pageAttributes.getSortFields(),
				pageAttributes.getLocale(), userContext);

		return new ResponseEntity<>(adminDto, HttpStatus.OK);

Open in new window

	public AdminDTO getAllLookupData(int pageNumber, int pageSize, String sortType, List<String> sortFields,
			String locale, UserContext userContext) {
		AdminDTO adminDto = null;
		String repositoryType = getRepositoryType();

		try {
			adminDto = adminFactory.getAdminFactory(repositoryType).
					getAllActionsLookupData(pageNumber, pageSize, sortType, sortFields, locale, userContext);
		} catch (CmsRevampFactoryException ce) {
					"Error occurred while retrieving actions lookup :getAllLookupData() {}",
			throw new AdminServiceException(
					"Exception occured while retrieving actions lookup ");

		return adminDto;

Open in new window

How to upgrade JRE to 11+, or downgrade your JDBC driver to Java 8, within CentOS 6?

Here is exception I've got

Exception in thread "main" java.lang.UnsupportedClassVersionError: com/microsoft/sqlserver/jdbc/SQLServerDriver has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(
at Method)
at java.lang.ClassLoader.loadClass(
at sun.misc.Launcher$AppClassLoader.loadClass(
at java.lang.ClassLoader.loadClass(
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(
at Main.doConnect(
at Main.main(
Hi i have a table having 8 columns i want to retrieve data from database and show in jsp page tabular form. after that implement edit , insert and delete in particular row or multiple row simultaneously . please provide a possible code sample as well as.
Hi Experts,

String str = "rptFormat:xls|grpid:1234|langid:en|SchTime:00:00|ftype:xls|P_GENERATEDON:29-10-2019 18:27:55|custidval:10024|";
String str2 = "rptFormat:xls|langid:en|SchTime:00:00|grpid:1234|ftype:xls|P_GENERATEDON:29-10-2019 18:27:55|custidval:10024|";

how to get the string value with out iterating | then :
here two for loop iterations are happended
is there any to get direct value from the string without iterating

i have to get only grpid value as-->1234
Please help and show details to disallow change to Text area below
public class Main {
      public static void main( String[] args )
                  final JFrame frame = new JFrame( "Information" );
                  final JPanel mainPanel = new JPanel();
                  mainPanel.setPreferredSize ( new Dimension( 800, 700 ) );
                  frame.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
                  frame.getContentPane().add ( mainPanel );
                  frame.setLocationRelativeTo( null );

                  // JTextArea supports a subset of HTML and with that you
                  // can change fonts within the text.
                  final JTextArea textArea = new JTextArea(
                              "This is an editable JTextArea. "
                                          + "A text area is a \"plain\" text component, "
                                          + "which means that although it can display text "
                                          + "in any font, all of the text is in the same font." );
                  textArea.setFont( new Font( "Serif", Font.BOLD, 12 ) );
                  textArea.setLineWrap( true );
                  textArea.setWrapStyleWord( true );

                  mainPanel.add( textArea );

                  frame.setVisible( true );      // should be last

            catch( final 

Open in new window

how to get the running production spring boot microservice version
i have one problem one dropdown is there for example dropdown having 2 values A and B
if i select A it works normally and go to the controller but if i select B one more dropdown
open in the same page . please help me out on this.
hi am having issue checking java home in linux
 java --version
Unrecognized option: --version
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.

i have this in my profile
export JAVA_HOME=/usr1/Oracle/jdk1.8.0_221
export PATH=$JAVA_HOME/bin:$PATH
how can i show and hide one table based on a button click in jsp page.
i have button and a i-frame in my jsp page but i want to show that i-frame button while click on that button . when i click on button i-frame content should visible
else hide.
want to fetch 2 columns data from jsp into vector suppose id and name .
after that want to display on same jsp 1 checkbox added in front of each row
while checking the checkbox  send id as checkbox parameter to servlet.
when i m generating .xlsx file it's genrating perfectly but every time some header name is missing .
suppose 20 column is there in a xlsx file some time 1or 2 or 3 header name was missing .
data are coming but only header name is missing there please let me know what is the issue.
want to read a file line by line , each line want to store in string array and want also total no of lines

BufferedReader input = null;
            int numLines = 0;
            String[] lines = null;
            try {

                  input = new BufferedReader(new FileReader(lFilePathStr));
                  try {
                        String line = null;

                        while ((line = input.readLine()) != null) {
                        for(int count = 0; count < numLines; count++) {
                              lines[count] = input.readLine();
                  } catch(Exception e) {
            } catch (IOException ex) {
      in below line only 1st line read after that it will come in catch block please let me know where i am wrong.
hi how can i set java home in linux
i did this in my /etc/profile
java path
but everytime when i start my vm i have to manual set java home
it always point to this
java -version
openjdk version "1.8.0_131"
OpenJDK Runtime Environment (build 1.8.0_131-b12)
OpenJDK 64-Bit Server VM (build 25.131-b12, mixed mode)

i try this
find /usr/lib/jvm/java-1.x.x-openjdk
find: ‘/usr/lib/jvm/java-1.x.x-openjdk’: No such file or directory

i what to do this
find /usr/lib/jvm/java-1.x.x-openjdk.
vim /etc/profile. ...
Press 'i' to get in insert mode.
add: export JAVA_HOME="path that you found" export PATH=$JAVA_HOME/bin:$PATH.
logout and login again, reboot, or use source /etc/profile to apply changes immediately in your current shell.
Hi i have a button name generate in .jsp page , while user click on that button multiple .xls file have been geenrated but i don't want to save those files
to server i want to just download all files in zip format while clicking on generat button.
i have a file .XLS extension but save as XMl spreadsheet 2003 , want to read the file and convert it into .XLS Extension with java code my code is below -

public class ExcelImport {

public boolean readStream(InputStream stream) throws InvalidFormatException {
    boolean success;

    try {
        byte[] bytes = getBytes(stream);
        InputStream wrappedStream = new ByteArrayInputStream(bytes);

        Workbook workbook = WorkbookFactory.create(wrappedStream);
        //XSSFWorkbook workbook = new XSSFWorkbook(new FileInputStream(wrappedStream.toString()));
        for (int i = 0; i <workbook.getNumberOfSheets(); i++) {
            Sheet sheet = workbook.getSheetAt(i);
            for (Row row : sheet) {
        success = true;
    } catch (FileNotFoundException e) {
        success = false;
    } catch (IOException e) {
        success = false;
    return success;

private void IterateThroughRow(Row row) {
    Iterator<Cell> cellIterator = row.cellIterator();

    while (cellIterator.hasNext()) {
        Cell cell =;

        switch (cell.getCellType()) {
            //do something with the content...
            case Cell.CELL_TYPE_STRING:
            case Cell.CELL_TYPE_NUMERIC:

Open in new window

Can someone share the exact steps (step by step) on how to set
X-frame-options in Weblogic (10.3.6, 12.1.3,  & Tomcat
to SAMEORIGIN to fix XFS/clickjacking?

I'm running Solaris 10 & RHEL 6  OS
hi how do i add oracle sql data source when creating spring boot application my database in oracle database 12c

Java EE





Java Enterprise Edition (Java EE) is a specification defining a collection of Java-based server and client technologies and how they interoperate. Java EE specifies server and client architectures and uses profiles to define technology sets targeted at specific classes of applications. All Java EE profiles share a set of common features, such as naming and resource injection, packaging rules and security requirements.