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

I have a very large data file with millions of transaction records. A typical transaction structure will be something like "Transaction ID, Customer ID, and more columns for other details". Transaction ID is unique across the file. Customer ID can repeat as there could be multiple transactions from the same customer, and these can come sequentially or could be distributed across the file. I want to process this file using multithreading. But the condition is that at any given time, only one customer can be processed by any thread which means if any thread is processing a transaction for customer id 100, then no other thread can pick up any other transaction for that customer id 100 till that thread completes processing for the current transaction. I know some synchronization is required around customer id but can someone suggests how we can achieve this in the best manner? The language is java.
0
Exploring ASP.NET Core: Fundamentals
LVL 13
Exploring ASP.NET Core: Fundamentals

Learn to build web apps and services, IoT apps, and mobile backends by covering the fundamentals of ASP.NET Core and  exploring the core foundations for app libraries.

In my shop we continue to be in "database performance hell"; albeit highly suspect our J2EE application code's poor design.  It is well known our application has problems, but at the end of the day everything culminates with the database.  Our application developers use Hibernate, and JPA to interface with our 3-Node Oracle 12c RAC database.

We are generating all of the usually reports ( AWR, ADDM, ASH ) in an attempt to nail down where the problems are.  And, yes the reports have identified 8 or so really bad queries, in some cases with either no recommendation, or recommendations to re-write.  Should have mentioned earlier, the database team does write or generate any of the SQL-queries for the application, these are all originated from the application developers.

We now realize performance should be monitored over a period of time. These reports are not easy to understand and as you know have a huge amounts of information.  Hugely suspect some information is more relevant than others.

 Big question:  if my team needs to focus in on 3-4 items in the AWR, ADDM, ASH reports --which/what items should we set our attention to?
1
I am trying to add an action to a NSButton but it is not working

I create my NSButtton programmatically:

-(NSView *)rowTable:(CGFloat) heightOnPanel :(NSString *) textValue: (CGFloat) width: (CGFloat) height :(int) intColor{
    NSView *viewce = [[NSView alloc] initWithFrame:CGRectMake(0, heightOnPanel, 320, 40)];
    NSButton *layerBt = [[NSButton alloc] initWithFrame:NSMakeRect(0, 0, width, height)];

    [layerBt setTitle:textValue];

    [layerBt setButtonType:NSMomentaryPushInButton];
    [layerBt setTarget:nil];
    [layerBt setAction:@selector(buttonPressed:)];
    [viewce addSubview:layerBt];

    return viewce;
}

Open in new window



and here is IBAction method:


- (IBAction)buttonPressed:(id) sender{
    NSLog(@"hello world");
}

Open in new window


Could you point me to what I am missing?

Thanks
0
Why BigDecimal.Sclae() not not working for non decimal value

      public static void main(String[] args) {
            // TODO Auto-generated method stub
            formatBD(2,new BigDecimal(10));
            formatBD(2,new BigDecimal(10.0567));
            formatBD(2,new BigDecimal(10.05));
            formatBD(2,new BigDecimal(10.000023));
      }
      
      public static void   formatBD(int sca,BigDecimal amount)
      {
            System.out.println(amount.scale() > 0 ? amount.setScale(2, BigDecimal.ROUND_CEILING) : amount);
      }
}

Output :10
10.06
10.06
10.01
0
How we can change some text into italic using docx4j API of java into a word document and also save as the original file?
0
hi am having this error when starting intergrated weblogic in 12.2.1.3.0 in window 7 64 bit

[Waiting for the domain to finish building...]
[06:34:01 PM] IntegratedWebLogicServer Domain is invalid.  Regenerating it...
[06:34:05 PM] Creating IntegratedWebLogicServer Domain...
[06:35:28 PM] ERROR:  An error occurred while building the default domain.
Please see this log file for more details:
C:\Users\rdp\AppData\Roaming\JDeveloper\system12.2.1.3.42.170820.0914\o.j2ee.adrs\BuildDefaultDomain.log
The Server Instance cannot be started because the IntegratedWebLogicServer Domain was not built successfully.

Adding environment variable to WLST script USER_MEM_ARGS = -Xms32m -Xmx1024m -XX:MaxPermSize=384m
Log File:      C:\Users\rdp\AppData\Roaming\JDeveloper\system12.2.1.3.42.170820.0914\o.j2ee.adrs\BuildDefaultDomain.log
Label:         JDEVADF_12.2.1.PATCHSETS_GENERIC_170820.0914.S
Product Home:  C:\jdeveloper12\jdeveloper\jdev\
Domain:        C:\Users\rdp\AppData\Roaming\JDeveloper\system12.2.1.3.42.170820.0914\DefaultDomain

BuildDefaultDomain1.py      2018-12-20 18:34:05

cmd.exe /c ""C:\jdeveloper12\oracle_common\common\bin\wlst.cmd" "C:\Users\rdp\AppData\Roaming\JDeveloper\system12.2.1.3.42.170820.0914\o.j2ee.adrs\BuildDefaultDomain1.py""
Process started
wlst > Java HotSpot(TM) 64-Bit Server VM warning: Ignoring option MaxPermSize; support was removed in 8.0
wlst > 
wlst > Initializing WebLogic Scripting Tool (WLST) ...
wlst > 
wlst > WARNING: An …
0
Need help on Spring Boot Project Structure to be deployed in an external tomcat.

Files we have

1. Html
2. css
3. javascript
4. back-end files - controller, service, repository etc.,
5. Angular JS

Please advise.
0
WildFly Full 12.0.0.Final (WildFly Core 4.0.0.Final) - java.lang.OutOfMemoryError: Java heap space Error and crashes.

OS: Centos 7
Java: JDK 8

Problem: Everyday in peak hours, server is stop responding. Getting HEAP error.

JVM OPTS used:
-server -XX:+DoEscapeAnalysis -XX:+UseConcMarkSweepGC -XX:+CMSClassUnloadingEnabled -XX:+UseParNewGC -XX:+ExplicitGCInvokesConcurrent -XX:CMSInitiatingOccupancyFraction=80 -XX:CMSIncrementalSafetyFactor=20 -XX:+UseCMSInitiatingOccupancyOnly -verbose:gc -Xloggc:gc.log.`date +%Y%m%d%H%M%S` -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintGCApplicationStoppedTime -XX:+UseCompressedOops -XX:+UseCompressedClassPointers -XX:CompressedClassSpaceSize=2048M -XX:MetaspaceSize=2048M -XX:MaxMetaspaceSize=2048M -Xmx16G -Xms16G  -Djava.net.preferIPv4Stack=true

Open in new window


Exception:
2018-11-26 09:05:35,740 ERROR [org.jboss.threads.errors] (default task-41) Thread Thread[default task-41,5,main] threw an uncaught exception: java.lang.OutOfMemoryError: Java heap space

2018-11-26 09:08:10,951 ERROR [org.jboss.threads.errors] (default task-12) Thread Thread[default task-12,5,main] threw an uncaught exception: java.lang.OutOfMemoryError: Java heap space

2018-11-26 09:04:21,639 ERROR [org.jboss.threads.errors] (default task-4) Thread Thread[default task-4,5,main] threw an uncaught exception: java.lang.OutOfMemoryError: Java heap space

2018-11-26 09:08:10,950 ERROR [org.jboss.threads.errors] (default task-30) Thread 

Open in new window

0
Hi All,

Is this possible to invoke vba macro subroutine with arguments from java code?

Thanks,
Varun Walia
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
Become a CompTIA Certified Healthcare IT Tech
LVL 13
Become a CompTIA Certified Healthcare IT Tech

This course will help prep you to earn the CompTIA Healthcare IT Technician certification showing that you have the knowledge and skills needed to succeed in installing, managing, and troubleshooting IT systems in medical and clinical settings.

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
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
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
Introduction to Web Design
LVL 13
Introduction to Web Design

Develop a strong foundation and understanding of web design by learning HTML, CSS, and additional tools to help you develop your own website.

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

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.