[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More


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.

Share tech news, updates, or what's on your mind.

Sign up to Post

Can anyone please  help?I am a newbie in GraohQL,...I am   trying  to expose my  API using  GraphQL  . I am  getting the  error  below

Here  is  my  schema:-

type Query {
  payloads: [payload!]!
type serviceStatus{

type payload {
     catastrophe: Boolean
     number: String
     status: String
     fileType: String
     createDateTimestamp: String
     id: String
     recordOnly: Boolean
     lineOfBusiness: String
     stateCode: String
     dateOfLoss: String
     confidentiality: String

type link {
And below is my  resolver  method:-

public ResponseEntity<String> payloads(){
    		   String uri = "URL  to my  API";		
    			HttpHeaders headers=new HttpHeaders();

    			RestTemplate restTemplate = new RestTemplate(); 
    			return restTemplate.exchange(uri,HttpMethod.GET,entity,String.class);	

Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'graphQLServletRegistrationBean' defined in class path resource [com/oembedler/moon/graphql/boot/GraphQLWebAutoConfiguration.class]: Unsatisfied dependency expressed through method 'graphQLServletRegistrationBean' parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating 

Open in new window

C++ 11 Fundamentals
LVL 12
C++ 11 Fundamentals

This course will introduce you to C++ 11 and teach you about syntax fundamentals.

I'm unable to compile first java program.

javac is not recognized.  Please see attached.
Hello Sirs
I am using serious issues with Charset Encoding in a REST application. I use Spring and the encoding in the bean MessageSource and Tymeleaf resolver  is set to UTF-8.
I get this when I return Json string:
\ufffd replacing special characters like é, or any other letter with accent.
How can I solve this?

Best regards.

is it good to have a ParseException or try catch   which would be much better way handling...

      @RequestMapping(value = "save/", method = RequestMethod.POST, produces = { "application/json" })
      public Map<String, Object> createCounseling(@RequestBody String counselingData) throws Parse{
            JsonObject CounselingObject = Json.parse(counselingData).asObject();
            HibernateDao<Counseling> workerDao = counselingDaoFactory.getNewDao(Counseling.class);
            Counseling counseling = getCounselingObject(CounselingObject);
            Map<String, Object> counseilingMap = new HashMap<>();
            counseilingMap.put("status", HttpStatus.OK);
            counseilingMap.put("data", new ArrayList<>());
            return counseilingMap;

Dear Experts,

let us know if logger is good for production or we have remove it out ? is that slows down at the applicationl level ?
if we use only after catch is that ok..
logger.warn("proceeding with incomplete request from mobile: {}. cause: {}, message: {}", 
					requestBody.length(), ex.getCause(), ex.getMessage());

Open in new window

let us know  in our application we are using hashmap  is that good or map would be good ?
	@RequestMapping(value = beneficiaryURL, method = RequestMethod.POST, produces = {"application/json" })
	public HashMap<String, Object> screeningRecord(@RequestBody String requestBody, 
			HttpServletRequest request) throws Exception {
		String remoteAddr = request.getRemoteAddr();
		logger.info("got request from: {}", remoteAddr);
		logger.debug("{}: received message: {}", remoteAddr, requestBody);
		HashMap<String, Object> screeningRespone = new HashMap<>();	
		// Transaction id is generated
		String transactionId = String.format("%s-%s", UUID.randomUUID().toString(), 
				dateTimeFormatter.format(new Date()));
		logger.info("{}: Generated id: {}, url: {}. Saving...", remoteAddr, 
				transactionId, beneficiaryURL);
		SubmissionInfo submissionInfo = new SubmissionInfo(transactionId, requestBody, 
				SubmissionInfo.PENDING, beneficiaryURL);
		Integer partition = null;
		try {
			Map<String, Object> jsonRequest = load(requestBody);
			Long microPlanId = Long.valueOf(jsonRequest.get("microPlanId").toString());
			partition = 

Open in new window

I have a java program which will connect to DB and write into an excel sheet.

Now I would like to make each sheet in workbook as a table and print in outlook and sent via mail also attaching the mail excel sheet using java program.

Any thoughts
Hi All,

How to copy some rows of data from excel sheet to new excel sheet in mac using java and if possible throw mail with the attachment of new excel sheet?

Note: Mac office 2011

Encountered Error as below on tomcat v9 server post deploying WS and trying to extract the response in SOAP UI

[/services/flasht] only the HTTP methods [POST GET] are covered. All other methods are uncovered.
02-Oct-2018 15:43:01.331 SEVERE [main] org.apache.tomcat.util.descriptor.web.SecurityConstraint.findUncoveredHttpMethods For security constraints with URL pattern [/management] only the HTTP methods [POST GET] are covered. All other methods are uncovered.
02-Oct-2018 15:43:01.331 SEVERE [main] org.apache.tomcat.util.descriptor.web.SecurityConstraint.findUncoveredHttpMethods For security constraints with URL pattern [/Response] only the HTTP methods [POST GET] are covered. All other methods are uncovered.
02-Oct-2018 15:43:28.901 INFO [main] org.apache.catalina.core.ApplicationContext.log ContextListener: contextInitialized()
02-Oct-2018 15:43:28.901 INFO [main] org.apache.catalina.core.ApplicationContext.log SessionListener: contextInitialized()
02-Oct-2018 15:43:28.904 INFO [main] org.apache.catalina.core.ApplicationContext.log ContextListener: attributeAdded('StockTicker', 'async.Stockticker@461270d7')
02-Oct-2018 15:47:57.945 SEVERE [http-nio-8080-exec-2] org.apache.catalina.core.ApplicationContext.log StandardWrapper.Throwable
 java.lang.NoSuchMethodError: org.objectweb.asm.ClassReader.accept(Lorg/objectweb/asm/ClassVisitor;I)V
      at com.sun.jersey.spi.scanning.AnnotationScannerListener.onProcess(AnnotationScannerListener.java:136)
      at …

Please have the code  and let me know what is the issue

	@RequestMapping(value = "microplan/{teamId}", method = RequestMethod.GET, produces = { "application/json" })
	public ResponseEntity<?> visitationPlanMobile(@PathVariable int teamId) throws Exception {

		List<Map<String, Object>> responeObject = new ArrayList<>();
		try {
			responeObject = visitationPointMobile(teamId);
			return new ResponseEntity<>(responeObject, HttpStatus.OK);
		}catch(Exception e){
			logger.error("Error Get Micro Plan {}",e.getMessage());
			return new ResponseEntity<>(responeObject, HttpStatus.INTERNAL_SERVER_ERROR);

Open in new window

public List<Map<String, Object>> visitationPointMobile(@PathVariable int teamId) throws Exception {
		Map<String, Object> queryFilter = new HashMap<String, Object>();
		queryFilter.put("team_id", teamId);
		//queryFilter.put("status", VisitationPlan.ACTIVE);
		HibernateDao<VisitationPlan> workerDao = daoFactory.getNewDao(VisitationPlan.class);
		return getVisitationPlanMapMobile(workerDao.findList(queryFilter));

Open in new window

This is error comes some times making our service down

01-10-2018 11:44:34.380 ^[[35m[http-nio-8080-exec-15]^[[0;39m ^[[34mINFO ^[[0;39m c.d.d.c.VisitationPlanController.getVisitationPlanMapMobile - MicroPlan Location Id: 24395
01-10-2018 11:44:34.382 ^[[35m[http-nio-8080-exec-15]^[[0;39m ^[[1;31mERROR^[[0;39m c.d.d.c.VisitationPlanController.visitationPlanMobile - Error Get Micro Plan null
select txnCount,currency,amount,days from test where country='IN' AND ROWNUM<=5;

SOME TIME 1 or 2 or 3....
if the rocords count is less than 5 i have set val as NA

LET SEE if the above qry fect 3 records
i want to see txnCount column as "23,34,56,NA,NA"
String txnCount-->"23,34,56,NA,NA"

similary for the rest of the columns as well

i have written below code is there any better approach?

ResultSet rs = st.executeQuery(Query());
		List<String> txnCount = new ArrayList<String>();
		List<String> currency = new ArrayList<String>();
		List<String> docAmt = new ArrayList<String>();
		List<String> avgDays = new ArrayList<String>();
		System.out.println("size " + rs.getFetchSize());
		while (rs.next()){
			year = rs.getString(5);
		System.out.println("txn sisss "+txnCount.size());
		int size1 = 5-(txnCount.size());
		for(int i=0;i<size1;i++){
		int size2 = 5-(currency.size());
		for(int i=0;i<size2;i++){
		int size3 = 5-(docAmt.size());
		for(int i=0;i<size3;i++){
		int size4 = 5-(avgDays.size());
		for(int i=0;i<size4;i++){
		String txnCnt= 

Open in new window

JavaScript Best Practices
LVL 12
JavaScript Best Practices

Save hours in development time and avoid common mistakes by learning the best practices to use for JavaScript.

miss kyle santos  main appko apni native bhasha main sawaal karta hoon jiska mujhe jaldi she jaldi samadhaan chahiye sawaal yeh hai ki main aapni email I'd ya mobile number pe java ya java script chalana chahta hoon MATLAB confirm karna chahta hoon waise mujhe java ya java scrip aati nahin hai yani mujhe maloom nahi ki java ya java script kya hota hai air mujhe java programing bhi nahi aati hai main bad itna chahta hoon ki main aapne system she kuch alag karke dekhu is me mujhe romanch hota hai isliye main chahta hoon ki main aapne cell phone number ya email I'd dwara jaisa bhi sambhav ho sake main videos aur anaye samagri download maroon Jo ki play bhi ho sake air main unhe play kar saku MATLAB ki java ya java script she videos download karon iske alawa doosri baat ki kye aaise files hain Jo mere mobile system me java ya java documents gain Jo download ho chuke gain Jo ki play nahin ho rahe play karne par in files ko mera system support nahin karts hai Jai's ki mera system main zop ,jpj,png,axp,docx,xisx,PDF aur bhi kayen tarah ki files gain Jo ki mera system ko support nahin karti aap mujhe is ka much tarika sujheye ki main in files ko kaise play karoon aur jaldi se mere is sawaal ko sahi kijiye mera yahi mat hai thank you
The problem is to design a solution for finding the number of users who are watching a particular video eg. on youtube etc.
Here is what i thought about solving it.
If the video is playing than every 5th minute from GMT it will send a play event
I will maintain a table containing  (userId, movieId, timeStamp)
So to count how many viewers playing a video i will simply have to count the number of entries in the table with the movieID and timeStamp not later than 5 minutes. Because if a play event is not recieved for 6 minutes than the video must not be playing...
And each time a play event is received the timeStamp will be updated to the current time.

Also i will run a cronJob that will be clearing entries that are not getting updated.
Will maintain a cache containing the count for each movie and will update it at a regular interval from the table.

Each video that is being played will send a https request for the number of current viewers every 6th minute and the number of viewers will be updated.
Please suggest if there is any flaw in this approach. or any better approach ?
Any pros and cons ?
Dear Experts,

 I have created a Restful API which is being consumed from android application. The api is below.

      @RequestMapping(value = "/locations/", method = RequestMethod.GET, produces = { "application/json" })
      public List<Map<String, Object>> locations() throws Exception {
            return getLocationMap(daoFactory.getLargestUnits());
      } and  

private List<Map<String, Object>> getLocationMap(List<Location> locations) {
            logger.info("fetching microplan location from: {}", locations.size());
            List<Map<String, Object>> jsonLocations = new ArrayList<Map<String, Object>>();
            for (Location location : locations)
            logger.debug("loaded microplan location {}.", jsonLocations.size());
            return jsonLocations;

sometimes it tells service is down from the application.
But  if I  just run this  this api from the postman and I could able to login into the application again and it works fine.

what would be the root cause problem of it??

How to fix this error in java program

Exception in thread "main" org.eclipse.swt.SWTException: Failed to create Ole Client. result = -2147221164
      at org.eclipse.swt.ole.win32.OLE.error(Unknown Source)
      at org.eclipse.swt.ole.win32.OleClientSite.<init>(Unknown Source)
      at com.fis.OfacLoadCheck.main(OfacLoadCheck.java:31)
Hi Experts,
how to form a dynamic string array from the below inputs

String countries="sg,sk,hk,ke" //this string having country names dynamically
countries max will be five and min will be one value separated with comma(,)

i have to form dynamic string array based on above countries
user can choose any country but max will be 5 countries min 1 country
country values are dynacmic

how to form dynamic string array

new String[] {"sheet one"+ "sg" , "sheet two" + "sk","sheet three" + "hk","sheet four" + "ke","sheet five" + "ug","summary"}
new String[] {"sheet one"+ "sg" , "sheet two" + "sk","sheet three" + "hk","sheet four" + "ke","summary"}
new String[] {"sheet one"+ "sg" , "sheet two" + "sk","sheet three" + "hk","summary"}
I would like  to insert a row for  title not a Particular cell but show assign entire row cell for the title
 here is the piece of snippet code, i do not how to add a title for the entire row

HSSFWorkbook workbook = new HSSFWorkbook();
    HSSFSheet sheet = workbook.createSheet("EDR Raw Data");

    Row header = sheet.createRow(0);
Hello Experts,

I was writing a restful apis
I would like to have a snippet of code to  which will handle the exception like
If request was successful, then return 2xx code (3xx for redirect).
 If there was an internal logic error on a server, then return 5xx. If there is anything wrong in client request, then return 4xx code.
 like to have a user friendly description of the errors...

I am a newbie on mutation testing. I am using  PIT  to test my  code.Can anyone please  suggest  how  can I resolve this  code?

      import java.io.IOException; 
 5     import org.springframework.http.client.ClientHttpResponse;
 6     import org.springframework.web.client.ResponseErrorHandler;
 9     public class DataTagsNamesErrorHandler implements ResponseErrorHandler {
 10         @Override
 11         public boolean hasError(ClientHttpResponse response) throws IOException {
 13  1  return false;
 14         }
 16         @Override
 17         public void handleError(ClientHttpResponse response) throws IOException {
 18         }
 19     }

13  1.replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE

Active mutators

Tests examined

Open in new window


I am looking for Java training 1:1 in US .Core Java ,Advanced Java (nHibernate), Spring, Spring boot using Eclipse. Any good recommendation.

Become a Certified Penetration Testing Engineer
LVL 12
Become a Certified Penetration Testing Engineer

This CPTE Certified Penetration Testing Engineer course covers everything you need to know about becoming a Certified Penetration Testing Engineer. Career Path: Professional roles include Ethical Hackers, Security Consultants, System Administrators, and Chief Security Officers.

Old software needing to be virtualized, hopefully on AWS. Wondering if it would be better suited to outsouce an upgrade for this or simply get this basic jBoss server operational.

I am using this as a template for the steps: https://mobiarch.wordpress.com/2012/07/30/running-jboss-as-7-on-amazon-ec2/ but it is obviously for a newer version so I have tweaked it a bit.

I have an application that was coded on jBoss3.2.3 almost 15 years ago and I'm having difficulty getting a basic server operational on AWS. I'm using a micro instance of Red Hat, and have installed JDK 1.5 using these steps: https://dzone.com/articles/installing-oracle-java6-ubuntu

"java -version"

[ec2-user@ip-172-31-24-211 bin]$ java -version
java version "1.5.0_22"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_22-b03)
Java HotSpot(TM) 64-Bit Server VM (build 1.5.0_22-b03, mixed mode)

Open in new window

Also have set this in <JBOSS>/bin/run.conf.: JAVA_OPTS="-Xms64m -Xmx86m -XX:MaxPermSize=64m"

Trying to start just the basic install from <JBOSS>/bin/:
[ec2-user@ip-172-31-24-211 bin]$ sh run.sh
run.sh: Missing file: /lib/tools.jar
run.sh: Unexpected results may occur.  Make sure JAVA_HOME points to a JDK and not a JRE.

  JBoss Bootstrap Environment

  JBOSS_HOME: /home/ec2-user/jboss-3.2.3

  JAVA: java

  JAVA_OPTS: -Xms64m -Xmx86m -XX:MaxPermSize=64m -Dprogram.name=run.sh


Open in new window


i am working on  a j2ee application and have java 8u11 installed on my machine. when i install higer version of java. on some places it is throwing the attached exception.
it's say "can not verify the self deployment rule set.jar". i have gone through the various options i.e to uncheck the some security settings in java control panel.

is there any solution of this issue except  deploying the new jar with ruleset.xml

apache tomcat 8.5.33 doesn't start up when I double click the startup.bat file from the bin directory.The window opens and closes immediately.
Please help.
Hi all,

I have problem to display my PDF file in an existing popup window using spring framework. The workflow is when I click a button from the main page, it popups a new window (child) and showing progress status. After the file finished generating, I set the view in controller and return to jsp. However, the PDF file displays (using DefaultResourceLoader and response.flushBuffer) in the main page instead of the popup window. I want to show in popup. Anything wrong? How can I specify which window the PDF should be displayed?

Please help. Thanks.
May I know how to popup pdf file in Spring framework?
Websocket or TCP or Push Notification ????

I am planning to build a mobile app to see the updates of stocks being added by the user as soon the price got updated.

1. Do we need to use Websocket or TCP or push notification in this case? Which one is better ?
2. Do we have any stock market test API's which supports Websocket or TCP or Push notification to cross check the feasibility, stability, reliability and latency ?
3. What are the differences between websocket vs TCP vs Push Notification ???

Need answers for the above three questions and the final decision as well. Please Suggest.

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.

Top Experts In
Java EE