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

x

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.

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

Sign up to Post

How  can I  resolve  this Error?I am a newbie in Graphql..I am trying  to call  graphql  API in angular.Below is my  code

export type DataTagsNames = {
	DATA_TAG_NM:String;
	DATA_TAG_ID:String;
	DSPLY_LINE_CNT:String;
	FLD_ENBL_IND:String;
	CNTXT_SCRN_IND:String;
	SHOW_DATA_IND:String;
	INJ_IND:String;
	RLT_ENTY_NM:String;
	CNTXT_SCRN_GRP_NM:String;
	PRTPT_TYPE_CD:String;
	DATA_TAG_PRTPT_CD:String;
	DATA_TAG_PRFM_R_CD:String;
	READ_ONLY_IND:String;
	EMTY_DLTE_IND:String;
	STWRD_EDT_IND:String;
}

export type Query = {
	allDataTagsNames: DataTagsNames[];
}

Open in new window

export class ListComponent implements OnInit {
  datatagsdetails: Observable<DataTagsNames[]>;
  constructor(private apollo: Apollo) { }

  ngOnInit() {
    this.datatagsdetails = this.apollo.watchQuery<Query>({
      query: gql`
        query allDataTagsNames {
          DataTagsNames {
           
          DATA_TAG_NM
           DATA_TAG_ID
           DSPLY_LINE_CNT
           FLD_ENBL_IND
           CNTXT_SCRN_IND
           SHOW_DATA_IND
           INJ_IND
           RLT_ENTY_NM
           CNTXT_SCRN_GRP_NM
           PRTPT_TYPE_CD
           DATA_TAG_PRTPT_CD
           DATA_TAG_PRFM_R_CD
           READ_ONLY_IND
           EMTY_DLTE_IND
           STWRD_EDT_IND

          }
        }
      `
    })
      .valueChanges
      .pipe(
        map(result => result.data.allDataTagsNames)
      );

Open in new window

0
Learn Ruby Fundamentals
LVL 12
Learn Ruby Fundamentals

This course will introduce you to Ruby, as well as teach you about classes, methods, variables, data structures, loops, enumerable methods, and finishing touches.

MQ under glassfish called imqdbroker not running when i double click on windows laptop.
path is
C:\Program Files\glassfish-4.0\mq\bin
i am not able to open default hosts under jms host to see that same mq that is supposed to be started
Please advise
MQ_glasfish.png
MQ_glasfish_2.png
0
hi,

I build one stateless session bean example with presentation tier html inddex page and web tier servlet within ejb web project then business tier in the ejb project


<!DOCTYPE html>
<!--
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
-->
<html>
    <head>
        <title>TODO supply a title</title>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
    </head>
    <body>
        <form action="ConverterServlet" method="POST">
              <input type="number" name="value"></br>
              <select name="type">
                    <option value="C2F">celcius to fahrenheit</option>
                    <option value="F2C">fahrenheit  to celcius</option>
              </select></br>
              <input type="submit" value="Convert">
        </form>
            
    </body>
</html>

Open in new window


do i not need to add close tags for input html element
<input type="submit" value="Convert">

also do i not need to ad begin tag for </br>

please advise

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package servlet;

import bean.ConverterBeanLocal;
import bean.ConverterBeanLocal.ConvertType;
import java.io.IOException;
import java.io.PrintWriter;

Open in new window

0
Hi,

I am looking for a good comprehensive book or video on a real life enterprise project implementation in java and related technologies end to end. I am looking for something which will guide me starting with business analysis, database design, software design and architecture, select various tools and technologies for the project, project implementation in java and related framework and finally deployment. Is there anything available which can help me? Thanks.
0
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{
    status:Int!
}

type payload {
     links:[link]
     catastrophe: Boolean
     number: String
     status: String
     fileType: String
     createDateTimestamp: String
     id: String
     recordOnly: Boolean
     lineOfBusiness: String
     stateCode: String
     dateOfLoss: String
     confidentiality: String
}

type link {
      rel:String
      href:String
}
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

0
Experts,

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

@CrossOrigin
      @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<>();
            workerDao.save(counseling);
            counseilingMap.put("status", HttpStatus.OK);
            counseilingMap.put("data", new ArrayList<>());
            return counseilingMap;
      }

Thanks
0
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
0
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

 Thanks.
0
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 …
0
qry:            
select txnCount,currency,amount,days from test where country='IN' AND ROWNUM<=5;

IT MAY FETCH MAX 5 RECORDS
SOME TIME 1 or 2 or 3....
if the rocords count is less than 5 i have set val as NA
EACH COLUMN I NEED TO FETCH VALUES AND SET INTO LIST THEN NEED TO CONVERT IT AS STRING

LET SEE if the above qry fect 3 records
i want to see txnCount column as "23,34,56,NA,NA"
OUTPUT
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()){
			txnCount.add(rs.getString(1));
			currency.add(rs.getString(2));
			docAmt.add(rs.getString(3));
			avgDays.add(rs.getString(4));
			year = rs.getString(5);
		}
		System.out.println("txn sisss "+txnCount.size());
		System.out.println(5-txnCount.size());
		int size1 = 5-(txnCount.size());
		for(int i=0;i<size1;i++){
			txnCount.add("NA");
		}
		int size2 = 5-(currency.size());
		for(int i=0;i<size2;i++){
			currency.add("NA");
		}
		int size3 = 5-(docAmt.size());
		for(int i=0;i<size3;i++){
			docAmt.add("NA");
		}
		int size4 = 5-(avgDays.size());
		for(int i=0;i<size4;i++){
			avgDays.add("NA");
		}
		String txnCnt= 

Open in new window

0
CompTIA Cloud+
LVL 12
CompTIA Cloud+

The CompTIA Cloud+ Basic training course will teach you about cloud concepts and models, data storage, networking, and network infrastructure.

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
0
HI,
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 ?
Thanks
0
Dear Experts,

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

@CrossOrigin
      @Cacheable("locations")
      @RequestMapping(value = "/locations/", method = RequestMethod.GET, produces = { "application/json" })
      public List<Map<String, Object>> locations() throws Exception {
            this.daoFactory.setClass(Location.class);
            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)
                  jsonLocations.add(location.toJsonizedMap());
            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.

Experts,
what would be the root cause problem of it??


Thanks
0
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)
0
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;
 
 7     
 
 8     
 
 9     public class DataTagsNamesErrorHandler implements ResponseErrorHandler {
 
 10         @Override
 
 11         public boolean hasError(ClientHttpResponse response) throws IOException {
 
 12         	
 
 13  1  return false;
 
 14         }
 
 15     
 
 16         @Override
 
 17         public void handleError(ClientHttpResponse response) throws IOException {
 
 18         }
 
 19     }
 
  
Mutations 

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

Active mutators
•INCREMENTS_MUTATOR
•VOID_METHOD_CALL_MUTATOR
•RETURN_VALS_MUTATOR
•MATH_MUTATOR
•NEGATE_CONDITIONALS_MUTATOR
•INVERT_NEGS_MUTATOR
•CONDITIONALS_BOUNDARY_MUTATOR

Tests examined

Open in new window

0
Hi

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

Thanks
0
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

  CLASSPATH: 

Open in new window

0
Hi,

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

Thanks,
pic1.jpg
0
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.
0
PMI ACP® Project Management
LVL 12
PMI ACP® Project Management

Prepare for the PMI Agile Certified Practitioner (PMI-ACP)® exam, which formally recognizes your knowledge of agile principles and your skill with agile techniques.

Hi,
I was going through the url shortner example on this page -
https://www.interviewbit.com/problems/design-url-shortener/
Although my query is simply about the hashing function that can be used to compute the shortened url .
Here it gives a way to encode the url -
Screen-Shot-2018-08-10-at-6.30.54-PM.png
I have few queries on the same  -
1) suppose i use a base62 hash function to shorten a url or even some other function as anyone can easily discover this then that is not desirable.
what exactly are the reasons for this. Although it does feel bit insecure that someone knows the hash function but so what. what are the pros and cons ?

2) Database ID encoded to base_62 also won't be suitable for a production environment because it will leak information about the database. For example, patterns can be learnt to compute the growth rate(new URLs added per day) and in the worst case, copy the whole database.

How is this possible because at most a user can predict the shortenedUrl thats all .
And shortened url, original url is inserted into a database.

Please help me understand why above both are true..
Thanks
1
Hi,
I am planning to build a service like shortening url for learning purpose..I was working on it theoritically.
And realized that i would be needing to store approximately 32 GB of data in the long run...
It will be mostly key value pair data  
eg -
1) www.bity.com/abcdefg  |  www.klasjlkajsf.comalskdfjlaksdjflkasjdfl
2) www.bity.com/abcdefg  | www.laksdjflkasjdflkasd.aldskjflkasdjflkasdf//alsdkfjalsdfj

So i was wondering which database will be better.
Dont know how Mysql will behave when total data reaches 32 GB ?
How long will it take to query it..
Is there some theoritical way to find it out. I think putting an index on the first column should be really fast kind of binary search ?
What are the alternatives  or best way ?
I read about redis that seems to be an in memory database so should be really fast. But it probably cannot store more data than the amount of RAM.
is redis feasible when the amount of data is so big like 32 GB ?
Do we need 32 GB of RAM or there are alternatives ??


Thanks
0
Hi,
I have deployed my code on two machines M1 and M2.
They fetch a USer Object which contains details about name, designation, emailID etc corresponding to a userId.
Currently i am storing them in cache like this :

import com.google.common.cache.Cache;
import com.google.common.cache.CacheBuilder;
    private Cache<String, User> userCache;
 userCache = CacheBuilder.newBuilder()
                .maximumSize(1000)
                .expireAfterWrite(60, TimeUnit.MINUTES).build();

Open in new window


But i just realized that there will be two caches on M1 and M2 separately. That could be an issue because say M1 caches data for a user. But the load balancer than sends the request to M2 and it will have to again fetch data.
what are the possible solutions to this ?
I can think of keeping another machine with all the cache data in RAM.
And so create a cache on M1 and M2 that programmatically connects to this machine.
But then comes the problem of having one more replica of this machine because in case one is down then
we still have data access...
Please suggest what is used to solve this type of problem ?

Thanks
0
I am having a java application with source code and libraries.

I would like to convert the entire java source to DART. Basically wants to convert the java application to DART Application (Java flavour) - https://www.dartlang.org/

Can someone help me what would be the easiest way or best approach or ways to quickly convert a java project to DART project ???

All the functionalities are same and no change in the functionality of the appplication.
0
Hello

I would like to use Junit test for Code below
ANy One help do do " Testing JUnit  "

package com.nam.designer.GUIComponent.Editor.Ecran;

import org.dom4j.Element;

public class BWTabViewContainer extends BWContainer{
	private static final long serialVersionUID = 512395545947425467L;
	private int activeTab=0;
	public BWTabViewContainer(String name, Element node, BWComponent parent, int interfaceType) {
		super(name,node,parent,interfaceType);
	}

Open in new window

     @Override
      
public int getActiveTab(){
		int i=0;
		for(BWComponent child: this.getChilds()){
			if(child.getNode()!=null && "true".equals(child.getNode().attributeValue("isActiveTab"))){
				this.activeTab=i;
				return this.activeTab;
			}
			i++;
		}

Open in new window

           return this.activeTab;
      }
      
public void setActiveTab(int activeTab) {
		this.activeTab = activeTab;
	}

Open in new window

     @Override
      
public Object clone(){
		BWTabViewContainer o = (BWTabViewContainer) super.clone();
		o.setActiveTab(this.activeTab);
		return o;
	}

Open in new window

}
Nam.jpg
0
can any one provide an sample application for tomcat 7.x that can trigger OutOfMemory and hung threads?.
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.

Top Experts In
Java EE
<
Monthly
>