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

i want to introduce JPA to my project which is developed with spring mvc.
so i want to use  both JPA and Spring datasouce.. because older DAO files have been developed with spring data source with templets.

is it possible to use both JPA and datasource in same project with out any sideeffects or future problems?
any examples?
0
Monthly Recap
Monthly Recap

May was a big month for new releases from Linux Academy! Take a look at what our team built recently in our blog. You can access the newest releases from our blog.

i am using spring MVCframework for my project.

 <bean id="PurgeScheduler" class="org.springframework.scheduling.quartz.CronTriggerFactoryBean">
           <property name="jobDetail" ref="PurgeJob"/>  
           <property name="cronExpression" value="${schedule.Purge.cron}"/>          
    </bean>

I have configured my job as above.. it is working fine..


My problem is , to update  'cronExpression' value.. i need to open properties file and update.
i want to move the properties to Database..

how  to read and set the cron expression value from database while starting up jboss server.
0
I have my code like below
      response = orch.process(request);

when i mover on to process method and click control and left mouse click it supposed to go to process method implementation but it is not doing in eclipse mars.

it used to work earlier not sure suddenly what happened stops working.

i restarted my laptop still not working.

please advise
0
we have web application, it is currently supported IP4.it is developed with Spring mvc.
now i want to support IPV6.. how could be the changes.. and how it will effect.
0
hi,

in eclipse java project i have below stored procedure in a DAO class say LMN.java


abc_TerminalXYZ_Select

wen i search on it eclipise not finding.
how to find all the stored proc similar to above in all DAO classes?
what are best search strategies to find what i want in eclipise?
please advise
0
I have create Database in my Localhost in mysql Server by phpmyadmin. where i have define no any privileges for the database. when i made live this db on the Hostech Server provider phpmyadmin al tables where successfully imported and  in the Case of views it is showing  me the following error.
"#1227 - Access denied; you need (at least one of) the SUPER privilege(s) for this operation".

This is the example of the views query that i have to upload on my live DB server from my local server .
"CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `crqry_bomoils`  AS  select
`qry_bom`.`FormulaID` AS `FormulaID`,`qry_bom`.`Code` AS `Code`,`qry_bom`.`MaxOfRevision` AS `MaxOfRevision`,`qry_bom`.`Revision` AS
`Revision`,`qry_bom`.`FormulaName` AS `FormulaName`,`qry_bom`.`Group` AS `Group`,`qry_bom`.`FragranceID` AS
`FragranceID`,`qry_bom`.`Qty` AS `Qty`,`qry_bom`.`FragranceName` AS `FragranceName`,`qry_bom`.`Flag` AS `Flag`,`qry_bom`.`CAS1` AS
`CAS1` from `qry_bom` where (`qry_bom`.`Group` = 'ESSENTIAL OIL') order by `qry_bom`.`FragranceName` ".

1:Main Question is that how can i make live my database with my views that i have created on my Localhost server.??
2:How can i import my  database with views  from my localhost server that should be import on any other mysql server without any privileges errors ??

Thanks In Advance!
0
At what point should I be concerned with learning data structure and algorithm in Java. I have discovered that it's a very important strategy  to be good in writing codes in any computer language.
0
What is tunneling and JRMP and DMZhow they are related to firewall and ports and network. Why we use tunneling. please advise
0
How authentication and authorization different from data integrity and Confidentiality.

why we use key, tokens, certificates, rkm etc. please advise
0
I was reading about Resource Bundles

as below
internationalization feature of the JDK provides a mechanism for separating user interface (UI) elements and other locale-sensitive data from the application logic in a program.
I can relate with local sensitive data separation but not the UI elements like buttons etc why we need to separate?

pelase advise
0
Get 15 Days FREE Full-Featured Trial
LVL 1
Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Hi,

the create method is optional for Entity Beans. This is useful when you do not want to clients to be able to insert data into the database.

i am reading as above. I was not clear what is relation between create metnod and the insert data to the database.  please advise
0
i got below exception with AES256 algorithem encryption/decryption.
java.security.InvalidKeyException: Illegal key size exception

But i fixed issue by following below link Info. But i am not allowed to updated java policy files..
Is there any other approach to fix issue?

https://deveshsharma.info/2012/10/09/fixing-java-security-invalidkeyexception-illegal-key-size-exception/
0
i am using jboss7 application server for my web application.(spring MVC)
when i monitor HEAP Size, it is continuously growing when i am accessing web pages.
How to find root cause?
What could be reasons?
0
In my java web application,generating the policy pdf  .Java compiler used is jdk1.4 .Need to affix the digital signature to existing pdf .Here we are using pdf template and replace the specially values dynamically.Need to affix the digital signature to existing pdf.
0
import java.util.*;
import java.util.stream.*;
public class X {
	public static void main(String[] args) {
		List<String> list = Arrays.asList("xxax", "xbxbx", "xxcx", "zzz");
		System.out.println(noX(list));
	}
	public static List<String> noX(List<String> strings) {
		return strings.stream().map(s -> s.replaceAll("x","")).collect(Collectors.toList());
    }	
}

Open in new window

in above program what are Collectors , stream, collect methods. And why map is used in this lamda functional examples
0
http://codingbat.com/prob/p128270
public int[] front11(int[] a, int[] b) {
 
  if (a.length==0) return new int[]{b[0]};
  if (b.length==0) return new int[]{a[0]};
   if ((a.length==0) && (b.length==0)) return new int[]{};
  return new int[]{a[0],b[0]};
}





public int[] front11(int[] a, int[] b) {
    if ((a.length==0) && (b.length==0)) return new int[]{};
  if (a.length==0) return new int[]{b[0]};
  if (b.length==0) return new int[]{a[0]};

  return new int[]{a[0],b[0]};
}




why first one fails below test with ArrayIndexOutOfBoundsException
Expected	Run		
front11([1, 2, 3], [7, 9, 8]) → [1, 7]	[1, 7]	OK	
front11([1], [2]) → [1, 2]	[1, 2]	OK	
front11([1, 7], []) → [1]	[1]	OK	
front11([], [2, 8]) → [2]	[2]	OK	
front11([], []) → []	ArrayIndexOutOfBoundsException: 0 (line:3)	X	
front11([3], [1, 4, 1, 9]) → [3, 1]	[3, 1]	OK	
front11([1, 4, 1, 9], []) → [1]	[1]	OK	
other tests
OK	
Correct for more than half the tests

Your progress graph for this problem

Open in new window


please advise
0
A solution for Fortify Path Manipulation.
0
Hi,

http://codingbat.com/prob/p105967

I wrote my code as below and failing some tests
public List<String> noX(List<String> strings) {
   strings.replaceAll(x -> "");
  return strings;
}

Open in new window



Expected	Run		
noX(["ax", "bb", "cx"]) → ["a", "bb", "c"]	["", "", ""]	X	
noX(["xxax", "xbxbx", "xxcx"]) → ["a", "bb", "c"]	["", "", ""]	X	
noX(["x"]) → [""]	[""]	OK	
noX([""]) → [""]	[""]	OK	
noX([]) → []	[]	OK	
noX(["the", "taxi"]) → ["the", "tai"]	["", ""]	X	
noX(["the", "xxtxaxixxx"]) → ["the", "tai"]	["", ""]	X	
noX(["this", "is", "the", "x"]) → ["this", "is", "the", ""]	["", "", "", ""]	X	
other tests
		X	

Open in new window


how to fix and improve my code, please advise
0
Hi,

I am trying to double list numbers using functionala lamda programming


http://codingbat.com/prob/p117665
Given a list of integers, return a list where each integer is multiplied by 2.

doubling([1, 2, 3]) → [2, 4, 6]
doubling([6, 8, 6, 8, -1]) → [12, 16, 12, 16, -2]
doubling([]) → []

Open in new window


Solution:

public List<Integer> doubling(List<Integer> nums) {
  nums.replaceAll(n -> n * 2);
  return nums;
  
  // OR the equivalent java streams solution:
  // return nums.stream()
  //  .map(n -> n * 2)
  //  .collect(Collectors.toList());
}

Open in new window

i am trying to write a java a program to execute it in exclipse to see result in eclipise consoel

import java.util.List;

public class FuncProgDouble {
	public static void main(String[] args) {
		List<Integer> li=[1, 2, 3];
		System.out.println(doubling(li));
	}

	
	public static List<Integer> doubling(List<Integer> nums) {
	  nums.replaceAll(n -> n * 2);
	  return nums;
}

	
}

Open in new window


i am getting below compilation error.

Multiple markers at this line
      - Syntax error on token "]", } expected
      - Type mismatch: cannot convert from int[] to
       List<Integer>
      - Syntax error on token "[", { expected

canont i add primitives as below to Integer list


import java.util.ArrayList;
import java.util.List;

public class FuncProgDouble {
      public static void main(String[] args) {
            
            
            ArrayList<Integer> al=new ArrayList<Integer>();  
            al.add("1");  
            al.addAll("3");  
            al.addAll("8");  
            //al.add(1,"Sachin");
            
            //List<Integer> li=[1, 2, 3];
            System.out.println(doubling(al));
      }

      
      public static List<Integer> doubling(List<Integer> nums) {
        nums.replaceAll(n -> n * 2);
        return nums;
}

      
}

please advise
0
On Demand Webinar: Networking for the Cloud Era
LVL 9
On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

hi,

http://codingbat.com/prob/p136950

for above challenge
Map-1 > mapAB4
prev  |  next  |  chance

Modify and return the given map as follows: if the keys "a" and "b" have values that have different lengths, then set "c" to have the longer value. If the values exist and have the same length, change them both to the empty string in the map.

mapAB4({"a": "aaa", "b": "bb", "c": "cake"}) → {"a": "aaa", "b": "bb", "c": "aaa"}
mapAB4({"a": "aa", "b": "bbb", "c": "cake"}) → {"a": "aa", "b": "bbb", "c": "bbb"}
mapAB4({"a": "aa", "b": "bbb"}) → {"a": "aa", "b": "bbb", "c": "bbb"}

what are input parameters for the method.

what is the return for it?


"a": "aaa", "b": "bb", "c": "cake"//is these are bunch of string values pretending to be key and value for a map??

please advise on how to understand and approach this challenge
0
How could i provide the security(Authentciation) in spring
0
padserver/padErr.txt

==> /usr/local/pad/padserver/padOut.txt <==

---- java.library.path   ../lib/dll;/usr/local/pad\lib\dll\sys32

---- java.ext.dirs   /usr/java/jdk1.7.0_79/jre/lib/ext:/usr/local/pad/lib/ext



 checkFileInPath jspWin.dll   exists false

 checkFileInPath x25lyra.dll   exists false




==> /usr/local/pad/padserver/padErr.txt <==

java.lang.OutOfMemoryError: Java heap space

java.lang.OutOfMemoryError: Java heap space

java.lang.OutOfMemoryError: Java heap space

java.lang.OutOfMemoryError: Java heap space

java.lang.OutOfMemoryError: Java heap space

java.lang.OutOfMemoryError: Java heap space

java.lang.OutOfMemoryError: Java heap space

java.lang.OutOfMemoryError: Java heap space

java.lang.OutOfMemoryError: Java heap space

java.lang.OutOfMemoryError: Java heap space


Hi Experts

we get above Java heap space error on our servers due to this we face other issues on server. kindly help.
0
adding child class in virtual document getting ucf session wait timeout.
errors are
java.lang.IllegalStateException: ucf session wait timeout:
at com.documentum.web.contentxfer.ucf.UcfSessionManager.newSession(UcfSessionManager.java:391)
at com.documentum.web.contentxfer.ucf.UcfSessionManager.getSession(UcfSessionManager.java:137)
at com.documentum.web.contentxfer.ucf.UcfContentTransport.getUcfSession(UcfContentTransport.java:195)
at com.documentum.web.contentxfer.ucf.UcfContentTransport.<init>(UcfContentTransport.java:68)
at sun.reflect.GeneratedConstructorAccessor208.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
at java.lang.Class.newInstance0(Class.java:374)
at java.lang.Class.newInstance(Class.java:327)
at com.documentum.webcomponent.library.contenttransfer.ContentTransferServiceContainer.createTransport(ContentTransferServiceContainer.java:731)
at com.documentum.webcomponent.library.contenttransfer.checkout.CheckoutContainer.createTransport(CheckoutContainer.java:325)
at com.documentum.webcomponent.library.contenttransfer.edit.EditContainer.createTransport(EditContainer.java:63)
at com.documentum.webcomponent.library.contenttransfer.ContentTransferServiceContainer.invokeService(ContentTransferServiceContainer.java:320)
at …
0
i am new to qrtz.
My project is based on spring mvc. spring version is 4.3.3.
we need to write some qrtz schedulers in spring.
please provide examples.

we will have one common database and multipul server instances. If scheduler is running in one server instance, It should not run in other instance in same time.  (it is like HA setup)
0
if ((option != null) && option.equals("PDFFILE")) {
                  String fileName = req.getParameter("fileName");
                        //Added By Ambrish on 20170207 - Fortify Fix: Path Manipulation
                        if(fileName != null){
                              if(NBSFilterOutput.validateFileName(fileName)){
                                    String pathFileName = DataDict.getFileProperty("reportpath", "reminder_property_path") +"/"+fileName;
                                    //added following if by Raghavendra on 20170609 to fix issue: Path Manipulation
                                    if(pathFileName != null){
                                          try{
                                                File file = new File(pathFileName);
                                                downloadFile(file, req, res);
                                          }catch(IOException ioe){
                                                logger.debug("IOException in ReminderEnquiryServlet for File, directory " + pathFileName + " may not exist" + ioe);
                                          }
                                    }
                              }
                        }
Hi please suggest how to resolve path manipulation issue.on line-
File file = new File(pathFileName);
0

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.