Java EE

17K

Solutions

9K

Contributors

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.

https://ninite.com/oracle_java and https://www.oracle.com/technetwork/java/javase/overview/oracle-jdk-faqs.html show JAVA on business PCs is NO longer free as of 10 months ago, therefore I plan to switch to a different package since I really don't have any APPS that need Java, but still would like to have installed if needed.

Has anyone switched to Amazon Corretto and AdoptOpenJDK ?

Any other suggestions ?
0
Hi team i Have a jsp page where one drop down and 4 fields are there 1st is showing month-year , 2nd , 3rd and 4th are showing date picker.
data come in table at the time of page load all rows are enabled when i checked particular row then it is enabled for modification.
i want  suppose i select 3 from drop down then at the time of page load only those rows are enabled having 1st mYear data first no is equal to or more then 3.
i my below code suppose i select 3 from drop down then all rows having mYear data 1st number is more then or equal to 3 should only enable other
check boxes rows are disable even checkbox is disable and no check operation is also be perform on that particular row checkbox.please let me know if you need more clarification.my code is below -


<html><head>
<link rel="stylesheet" href="https://code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
<script src="https://code.jquery.com/jquery-1.12.4.js"></script>
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
<script>
  
function toggle(theBox){ 
	var rows = theBox.parentNode.parentNode.parentNode.rows;
	alert(rows);
	for(var r=1;r < rows.length;r++){ 
		var cells = rows[r].cells; 
		var rowDisabled = (cells[0].getElementsByTagName("input")[0].checked==false); 
		for(var c=1;c < cells.length;c++){ 
			var theFld = cells[c].getElementsByTagName("input")[0]; 
			theFld.disabled = rowDisabled; 
		} 
	} 
}
	window.onload = function(){
		var theTab = 

Open in new window

0
Hi Team ,

I have a page which shows date from database in tabular format . 1st explain my scenario that in my jsp page 4 fields are there 1st field display the month-year , rest 3 fields are date field having date picker . now my requirement that 1st filed month-year is there 1st number indicates the month so according to 1st filed month rest of the 3 date picker  previous months should be disabled.
suppose in first row of table  1st field is 3-2020 so month for that particular row so rest 3 date picker filed only from march month dates are available , January and February is disabled in that particular row as well as past date from already populated date of same month .one more scenario in my below page 3rd row 1st filed is 3-2020 so 1st field is 3 means month is march so in that particular row P Date is 12/03/2020 so in that particular cell calendar should not  select less then 12/03/2020 date only enable more then future that not previous date .same is with Q date and B date .

please let me know if more clarification needed and please find the code below -


<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<link rel="stylesheet"
	href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
<script src="https://code.jquery.com/jquery-1.12.4.js"></script>
<script 

Open in new window

0
hi am having this error in my spring
spring
0
I am currently refactoring some of our old code, from Strut to Spring. It is a legacy application and some of the tables in the database don't have foreign key constraints.

ER.png
I am dealing with the above tables. A BookMarketingMedium (=a newspaper, magazine)  can have zero or more BookMarketingMediumEmails (=when we inform the newspapers that an article has been published on our website). The BookMarketingMediumEmails table does not have any foreign keys and two composite keys: bookMarketingMediumId and languageId.

To deal with the composite key, I had created an embeddable class:

BookMarketingMediumEmail.java:

@Data
@EqualsAndHashCode(of = { "email" })
@Embeddable
public class BookMarketingMediumEmail
{
    @EmbeddedId
    private BookMarketingMediumEmailIdentity bookMarketingMediumEmailIdentity;

    @NotNull
    private String subject = "";

    @Email
    @NotNull
    private String email = "";

    public BookMarketingMediumEmail(BookMarketingMediumEmailIdentity bookMarketingMediumEmailIdentity, String subject, String email)
    {
        this.bookMarketingMediumEmailIdentity = bookMarketingMediumEmailIdentity;
        this.subject = subject;
        this.email = email;
    }

}

Open in new window


BookMarketingMediumEmailIdentity.java:

@Data
@Embeddable
public class BookMarketingMediumEmailIdentity implements Serializable
{
    @NotNull
    private long bookMarketingMediumId;

    @NotNull
    private long languageId;
}

Open in new window



The problem occurs in this class

BookMarketingMedium.java:

@Data
@Entity
@Table(name = "bookMarketingMedium")
public class BookMarketingMedium
{
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private int bookMarketingMediumId;

    @NotNull
    private String medium;

    @NotNull
    private String mediumNameEN;

    @NotNull
    private String mediumNameGE;

    private String mailFrom;

    @ElementCollection(fetch = FetchType.LAZY)
    @CollectionTable(name = "bookMarketingMediumEmail")
    @JoinColumns({
            @JoinColumn(name = "bookMarketingMediumId"),
            @JoinColumn(name = "languageId")
    })
    private Set<BookMarketingMediumEmail> bookMarketingEmail = new HashSet<>();

}

Open in new window


What I would like to achieve is that when I 'get' the BookMarketingMedium it should also load all the BookMarketingMediumEmails that are associated with that particular 'medium'.

Unfortunately, I get the following BeanCreatingException:


Open in new window

0
i have a file xml file but save as XMl spreadsheet 2003 , want to read the XML node file please refer the attached file.
demo.xls
0
hi am having this error in my spring
 .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::  (v2.3.0.BUILD-SNAPSHOT)

2020-02-16 06:54:23.777  INFO 4100 --- [  restartedMain] com.jpa.hibernate.app.AppApplication     : Starting AppApplication on Desmand-PC with PID 4100 (C:\Spring5\app\target\classes started by user in C:\Spring5\app)
2020-02-16 06:54:23.780  INFO 4100 --- [  restartedMain] com.jpa.hibernate.app.AppApplication     : No active profile set, falling back to default profiles: default
2020-02-16 06:54:23.858  INFO 4100 --- [  restartedMain] o.s.b.devtools.restart.ChangeableUrls    : The Class-Path manifest attribute in C:\Users\user\.m2\repository\org\glassfish\jaxb\jaxb-runtime\2.3.2\jaxb-runtime-2.3.2.jar referenced one or more files that do not exist:
0
haveing error runing spring

  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::  (v2.2.3.BUILD-SNAPSHOT)

2020-02-04 20:56:54.990  INFO 7668 --- [           main] c.i.s.b.s.SpringIn5StepsApplication      : Starting SpringIn5StepsApplication on Desmand-PC with PID 7668 (C:\Spring5\spring-in-5-steps\target\classes started by user in C:\Spring5\spring-in-5-steps)
2020-02-04 20:56:54.990  INFO 7668 --- [           main] c.i.s.b.s.SpringIn5StepsApplication      : No active profile set, falling back to default profiles: default
2020-02-04 20:56:55.397  WARN 7668 --- [           main] s.c.a.AnnotationConfigApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'binarySearchImpl' defined in file [C:\Spring5\spring-in-5-steps\target\classes\com\in28minutes\spring\basic\springin5steps\BinarySearchImpl.class]: Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'com.in28minutes.spring.basic.springin5steps.SortAlgorithm' available: expected at least 1 bean which qualifies as autowire
0
am geting error when starting app
restful
package com.in28minutes.spring.basic.springin5steps;

public class BinarySearchImpl {
	
	private SortAlgorithm sortAlgorithm;
	

	public BinarySearchImpl(SortAlgorithm sortAlgorithm) {
		super();
		this.sortAlgorithm = sortAlgorithm;
	}


	
	
	public int binanrySearch(int [] numbers,int numberToSearchFor) {
		int[] sortedNumbers =  ((Object) sortAlgorithm).sort(numbers);
		System.out.println(sortAlgorithm);
		return 3;
		}
	
}


package com.in28minutes.spring.basic.springin5steps;

public interface SortAlgorithm {

}

Open in new window

0
while defining a Base Model of teh database  is it necessary to define
private Map<String, Object> objectMap = new HashMap<String, Object>();

is this correct to define <String ,Object> or any other way so that future it may not trouble in the code.Let us me know expert as this is important we are doing a college project

@JsonSerialize(using = DefaultSerializer.class)
@MappedSuperclass
public abstract class BaseModel extends Convertable {

      @Id
      @Column(name="id")
      @GeneratedValue(strategy=GenerationType.IDENTITY)
      private int id;
      
      // dis is used to create teh Json view of current object
      @Transient
      private Map<String, Object> objectMap = new HashMap<String, Object>();
      
      public Map<String, Object> getObjectMap() {
            return objectMap;
      }
      
      public int getId() {
            return id;
      }
      
      @Column(updatable = false)
      @CreationTimestamp
      private LocalDateTime created = LocalDateTime.now();
      
      @UpdateTimestamp
      private LocalDateTime lastModified;

      public LocalDateTime getCreated() {
            return created;
      }
      
      public void setCreated(LocalDateTime date) {
            created = date;
      }

      public LocalDateTime getLastModified() {
            return lastModified;
      }
      
      @Override
      public void buildObjectMap() {
            objectMap.put("id", String.valueOf(id));
      }
      
      @Override
      public String toJSONString() {
            buildObjectMap();
            GsonBuilder builder = new GsonBuilder();
            Gson gson = builder.create();
            return gson.toJson(objectMap,
0
Improving code quality and automate the review process in java

i am using sonar is there any other free source available for this code quality
0
Can some body help me with the concept of   Set method in java with respect to database concept.

something like this
                
		Set<OrgUnitsLan> orgUnitsLan= .getOrgUnits()

Open in new window


The error it is showing in getOrgUnits ? let me know the concept of it.
0
Hi,
I have no issue to connect to SQL server, having IP and port like

1??.?.?.?,59365

through SSMS. How to achieve the same, to change Java code below, to be able to connect to SQL server, in Java?

                  final String un = "casey";
                  final String pw = "****";
                  final String host = "jdbc:sqlserver://caseydid o\\mssqlex press:1433 ;databaseN ame=stock" ;

                  final String sql = "SELECT * FROM STAFF_DATA";
                  //loading the driver class
                  Class.forName("com.microso ft.sqlserv er.jdbc.SQ LServerDri ver"); //This is for driver sqljdbc2*
                  //   Class.forName("com.microso ft.jdbc.sq lserver.SQ LServerDri ver"); /*This is for driver sqljdbc4*/
                  final Connection conn = DriverManager.getConnection(un, pw, host);

Open in new window

0
Hi,

I have given my code below. I need to navigate to each and every Div and print the application name then click on related "Read more" link to verify it belongs to the same application. Like that, i have 10+ applications names and related "Read more" links. I tried different code but every time getting some error. Not able to write correct code.
The code::

search: {
			List<WebElement> divs = driver.findElements(By.xpath("//div[@class = 'container-fluid']/div/div[@class= 'col-md-4']"));
			for (WebElement div : divs) {
				int i = 1;
				List<WebElement> appNames = div.findElements(By.xpath("//div[@class = 'header1']/h4"));
				for (WebElement appName : appNames) {
					TestDriver.logReport("INFO", "APPLICATION NAME: " + appName.getText());
					if (!appName.getText().isEmpty()) {
						WebElement readMoreLink = driver
								.findElement(By.xpath("//div[@class = 'footer1']/a[contains(text(),'Read More...')]"));
						clickWebElement(readMoreLink);
					}
				}
				if (i > 0) {
					break search;
				}
			}
		}

Open in new window


The html code::


<div class="container-fluid">
   <div class="row" style="padding-left: 5%;padding-right: 5%">
        <div class="col-md-4">
            <div class="card1" data-app-id="1">
                <div class="header1">
                    <img src="red/images/new_ccr.png">
             [b]   <h4 class="title1">Requirements</h4>[/b] - Application name
                </div>
                <div class="content1">
            

Open in new window

0
error clicking a link in java application
Nov 04, 2019 8:28:23 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server version name:   Apache Tomcat/9.0.20
Nov 04, 2019 8:28:23 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server built:          May 3 2019 22:26:00 UTC
Nov 04, 2019 8:28:23 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server version number: 9.0.20.0
Nov 04, 2019 8:28:23 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: OS Name:               Windows 10
Nov 04, 2019 8:28:23 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: OS Version:            10.0
Nov 04, 2019 8:28:23 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Architecture:          amd64
Nov 04, 2019 8:28:23 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Java Home:             C:\Java\jdk1.8.0_111\jre
Nov 04, 2019 8:28:23 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: JVM Version:           1.8.0_111-b14
Nov 04, 2019 8:28:23 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: JVM Vendor:            Oracle Corporation
Nov 04, 2019 8:28:23 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: CATALINA_BASE:         C:\Users\Desmond\eclipse-workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0
Nov 04, 2019 8:28:23 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: CATALINA_HOME:         C:\Program Files\Apache Software Foundation\Tomcat 9.0

Open in new window

0
how to check .xls file is based on xml or word file because in both extension is .xls . i have a xml file having extension .xls how to check the format because if i check extension its always come like .xls .
0
hi am having the following error
mvn clean
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for guru.springframework:pet-clinic-web:jar:0.0.5
[WARNING] 'dependencies.dependency.(groupId:artifactId:type:classifier)' must be unique: org.junit.jupiter:junit-jupiter-api:jar -> version (?) vs
5.5.0-RC1 @ guru.springframework:pet-clinic-web:[unknown-version], C:\spring5Clinic\pet-clinic-web\pom.xml, line 97, column 21
[WARNING] 'dependencies.dependency.(groupId:artifactId:type:classifier)' must be unique: org.mockito:mockito-junit-jupiter:jar -> version 2.22.0 vs
 (?) @ guru.springframework:pet-clinic-web:[unknown-version], C:\spring5Clinic\pet-clinic-web\pom.xml, line 107, column 21
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING]
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] tdm-pet-clinic                                                     [pom]
[INFO] pet-clinic-data                                                    [jar]
[INFO] pet-clinic-web                                                     [jar]
[INFO]
[INFO] ----------------< guru.springframework:tdm-pet-clinic >-----------------
[INFO] Building
0
Given a cluster.cfg websphere file is there a procedure to convert to a jetty web.xml file?
ideally guide me to example code in GitHub  that shows how to take jndi definitions in the cluster.xml and apply them in war containing web.xml  file equivalent for jetty server.
I cannot share my exact cluster.cfg file only that it is a cluster.cfg typical jindi settings I suppose I could put the sample file in minus all the settings I'm looking for a general tutorial or GitHub example to guide me...
0
hi
its a non technical question to some senior folks out there in software companies
i am planning to take a break from work for a year or 2. i have 9 years experience as a java developer.

does taking a year long break from work lower my chances of getting job ?
should i have a solid reason or do some online course so as to justify it ?
my main reason to take a break is to up my health as i have been stressed out too much. dont know whether that will qualify as a genuine reason.

or it doesnt matter at all ? i clear the interview and i am in.

any suggestions are welcome
thanks
1
hi am having this error in my app http error
httpcode
import {Http} from '@angular/http';
import {EventEmitter, Injectable} from '@angular/core';
import {Observable} from 'rxjs';
import {map} from 'rxjs/operators';
import {Task} from './task.model';


@Injectable()
export class TaskService {

    onTaskAdded = new EventEmitter<Task>();

    constructor(private http: Http) {

    }

    getTasks() {
        return this.http.get('/api/tasks').map(response => response.json());
    }

    saveTask(task: Task, checked: boolean) {
        task.completed = checked;
        return this.http.post('/api/tasks/save', task).map(response => response.json());
    }

    addTask(task: Task) {
        return this.http.post('/api/tasks/save', task).map(response => response.json());
    }

}


app module
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';

import { AppComponent } from './app.component';
import { TasksComponent } from './tasks/tasks.component';
import { TasksAddComponent } from './tasks/tasks-add/tasks-add.component';
import { TasksListComponent } from './tasks/tasks-list/tasks-list.component';
import {FormsModule} from '@angular/forms';
import {HttpModule} from '@angular/http';

@NgModule({
  declarations: [
    AppComponent,
    TasksComponent,
    TasksAddComponent,
    TasksListComponent
  ],
  imports: [
    BrowserModule,
      HttpModule,
      FormsModule,

  ],
  providers: [],
  bootstrap: 

Open in new window

0
hi am geting this error
mvn compile
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for guru.springframework:pet-clinic-web:jar:0.0.5
[WARNING] 'dependencies.dependency.(groupId:artifactId:type:classifier)' must be unique: org.junit.jupiter:junit-jupiter-api:jar -> version (?) vs
5.5.0-RC1 @ guru.springframework:pet-clinic-web:[unknown-version], C:\spring5Clinic\pet-clinic-web\pom.xml, line 97, column 21
[WARNING] 'dependencies.dependency.(groupId:artifactId:type:classifier)' must be unique: org.mockito:mockito-junit-jupiter:jar -> version 2.22.0 vs
 (?) @ guru.springframework:pet-clinic-web:[unknown-version], C:\spring5Clinic\pet-clinic-web\pom.xml, line 107, column 21
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING]
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] tdm-pet-clinic                                                     [pom]
[INFO] pet-clinic-data                                                    [jar]
[INFO] pet-clinic-web                                                     [jar]
[INFO]
[INFO] ----------------< guru.springframework:tdm-pet-clinic >-----------------
[INFO] Building tdm-pet-clinic
0
hi when creating new spring boot application in eclipse what must i choose
enterprise application or Dynamic web project i also what to add angular in this project and later use hirbinate
0
hi where do i add this
 @Bean
    DataSource dataSource() throws SQLException {
        OracleDataSource dataSource = new OracleDataSource();
        dataSource.setUser(username);
        dataSource.setPassword(password);
        dataSource.setURL(url);
        dataSource.setImplicitCachingEnabled(true);
        dataSource.setFastConnectionFailoverEnabled(true);
        return dataSource;
    }

Open in new window

mavenerror3.jpg
0
hi am not geting the preview
preview
0
hi am geting error in my app
Oct 02, 2019 8:34:09 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server version name:   Apache Tomcat/9.0.20
Oct 02, 2019 8:34:09 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server built:          May 3 2019 22:26:00 UTC
Oct 02, 2019 8:34:09 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server version number: 9.0.20.0
Oct 02, 2019 8:34:09 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: OS Name:               Windows 10
Oct 02, 2019 8:34:09 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: OS Version:            10.0
Oct 02, 2019 8:34:09 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Architecture:          amd64
Oct 02, 2019 8:34:09 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Java Home:             C:\Java\jdk1.8.0_111\jre
Oct 02, 2019 8:34:09 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: JVM Version:           1.8.0_111-b14
Oct 02, 2019 8:34:09 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: JVM Vendor:            Oracle Corporation
Oct 02, 2019 8:34:09 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: CATALINA_BASE:         C:\Users\Desmond\eclipse-workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0
Oct 02, 2019 8:34:09 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: CATALINA_HOME:         C:\Program Files\Apache Software
0

Java EE

17K

Solutions

9K

Contributors

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.