Java EE

17K

Solutions

7

Articles & Videos

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 could i provide the security(Authentciation) in spring
0
A solution for Fortify Path Manipulation.
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
I am doing below challenge

http://codingbat.com/prob/p128270
public int[] front11(int[] a, int[] b) {
   //int[] z;
  if(a.length>0&&b.length>0){
 
 // z[0]=a[0];
 // z[1]=b[0];
 // return z;
   return new int[]{a[0],b[0]};
  }
   else if(a.length>=0&&b.length==0){
  // int[] z=new int[2];
  //z[0]=a[0];
  //z[1]=b[0];
  return new int[]{a[0]};
  }
  else if(a.length==0&&b.length>=0){
  // int[] z=new int[2];
 // z[0]=a[0];
 // z[0]=b[0];
 // return z;
   return new int[]{b[0]};
  }
  return new int[0];
  
}

Open in new window


i am failing one
how to improrve my code
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:14)      X      
front11([3], [1, 4, 1, 9]) → [3, 1]      [3, 1]      OK      
front11([1, 4, 1, 9], []) → [1]      [1]      OK      
other tests
OK      
please advise
0
Hi,

I was working on below challenge again

http://codingbat.com/prob/p151359
public String withoutX2(String str) {
  
  if(str.length()==1&&str.charAt(0)=='x'){
    return "";
  }
  if(str.length()>=2){
  if ( str.charAt(0)=='x' && str.charAt(1)=='x' ){
  return str.substring(2);
  }else if(str.charAt(0)=='x'){
      return str.substring(1);
  }else if(str.charAt(1)=='x'){
      return str.substring(0,1)+str.substring(2);
  }
  }
  return str;
}

Open in new window

below code passes all tests
Expected      Run            
withoutX2("xHi") → "Hi"      "Hi"      OK      
withoutX2("Hxi") → "Hi"      "Hi"      OK      
withoutX2("Hi") → "Hi"      "Hi"      OK      
withoutX2("xxHi") → "Hi"      "Hi"      OK      
withoutX2("Hix") → "Hix"      "Hix"      OK      
withoutX2("xaxb") → "axb"      "axb"      OK      
withoutX2("xx") → ""      ""      OK      
withoutX2("x") → ""      ""      OK      
withoutX2("") → ""      ""      OK      
withoutX2("Hello") → "Hello"      "Hello"      OK      
withoutX2("Hexllo") → "Hexllo"      "Hexllo"      OK      
withoutX2("xHxllo") → "Hxllo"      "Hxllo"      OK      
other tests
OK      

But if i have input say z what would be output and my code fails in that scenario right

withoutX2("z") → z
public class WithoutX2 {

	public static void main(String[] args) {
		
		// TODO Auto-generated method stub
		System.out.println("Value is"+withoutX2("z"));//should get true but getting false
	}
	
	public static String withoutX2(String str) {
		  
		  if(str.length()==1&&str.charAt(0)=='x'){
		    return "";
		  }
		  if(str.length()>=2){
		  if ( str.charAt(0)=='x' && str.charAt(1)=='x' ){
		  return str.substring(2);
		  }else if(str.charAt(0)=='x'){
		      return str.substring(1);
		  }else if(str.charAt(1)=='x'){
		      return str.substring(0,1)+str.substring(2);
		  }
		  }
		  return str;
		}


}

Open in new window

0
Hi,
I tried below challenge as
http://codingbat.com/prob/p167430
public class Has271 {

	public static void main(String[] args) {
		int[] arr={1, 2, 7, 1};
		// TODO Auto-generated method stub
		System.out.println("Value is"+has271(arr));//should get true but getting false
	}
	
	public static boolean has271(int[] nums) {
		 int val=nums[0];
		 
		 for(int i=0;i<nums.length-2;i++){
		   
		   if(  (nums[i+1]==val+5)
		   && (  (Math.abs(nums[i+2]-val)<=2) )  )
		   return true;
		   continue;
		 }
		 return false;
		}


}

Open in new window


what is wrong with my above code why i am getting false instead of true?
please advise
0
I am trying to call REST services deployed on Tomcat 8 from Angular 4. Since both these are running on separate domains, CORS issue is expected. So, in the tomcat/conf/web.xml, I have added the below filter
<filter>
  <filter-name>CorsFilter</filter-name>
  <filter-class>org.apache.catalina.filters.CorsFilter</filter-class>
  <init-param>
    <param-name>cors.allowed.origins</param-name>
    <param-value>*</param-value>
  </init-param>
  <init-param>
    <param-name>cors.allowed.methods</param-name>
    <param-value>GET,POST,HEAD,OPTIONS,PUT</param-value>
  </init-param>
  <init-param>
    <param-name>cors.allowed.headers</param-name>
    <param-value>Content-Type,X-Requested-With,accept,Origin,Access-Control-Request-Method,Authorization,Access-Control-Request-Headers</param-value>
  </init-param>
  <init-param>
    <param-name>cors.exposed.headers</param-name>
    <param-value>Access-Control-Allow-Origin,Access-Control-Allow-Credentials</param-value>
  </init-param>
</filter>
<filter-mapping>
  <filter-name>CorsFilter</filter-name>
  <url-pattern>/*</url-pattern>
</filter-mapping> 

Open in new window


This is how I am sending the GET request from Angular
var basicOptions:RequestOptionsArgs = {
  url: 'http://server3:7000/myrest/info',
  method: RequestMethod.Get,
  search: null,
  headers: new Headers(
    {'Authorization': 'Basic AG1hZG1pbjpkZW1vLmRlbW8=' },
    ),
  body: null
};

basicOptions.headers.append('Content-Type', 'application/json');

var reqOptions = new RequestOptions(basicOptions);
var req = new Request(reqOptions);
return this.http.request( req );

Open in new window


Since, I am sending the Authorization header, it is also added in the 'cors.allowed.headers' param in Tomcat.

When I call the REST service from Chrome, it always gives me a 'Invalid CORS request' error (Network tab -> Preview). Below is the error in browser console
XMLHttpRequest cannot load http://server3:7000/myrest/info. Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:4200' is therefore not allowed access. The response had HTTP status code 403.

Open in new window

Is there something else that I need to do to make it work?
0
The Ultimate Checklist to Optimize Your Website
LVL 1
The Ultimate Checklist to Optimize Your Website

Websites are getting bigger and complicated by the day. Video, images, custom fonts are all great for showcasing your product/service. But the price to pay in terms of reduced page load times and ultimately, decreased sales, can lead to some difficult decisions about what to cut.

When I run Java dynamic Web  Project. I got an error  :Publishing J2EE preview at localhost..has encountered a problem.
Could you please tell the alternative of this problem.
0
I am getting the above exception while running the spring batch application in eclipse without maven
0
Hi

Please help me with the following.

When isnatlling ICDL Kplace Test Centre, I recived an error DBMS init Failed.

Please explan and help
0
hi does anyone know how to implement   marquee element in oracle java adf
0
Difference Between Path Parameter and query parameter in web service
0
Could you please provide the JDBC transaction with Example
0
Could you please provide the Spring Transaction with Example
0
Could you please provide Hibernate Transaction With Example and understand
0
Hello Sirs,

I have CSRF protection enabled, and CSRF parameters added to my login JSP view.
My question is the following: Should add CSRF parameters to the rest of my JSP view that involve form submission?

I am looking forward to hearing from you.
0
What Is Transaction Monitoring and who needs it?
LVL 1
What Is Transaction Monitoring and who needs it?

Synthetic Transaction Monitoring that you need for the day to day, which ensures your business website keeps running optimally, and that there is no downtime to impact your customer experience.

Hi,

What is the use of below command from eclipse project by right clicking and run as "maven build.."

what is meaning of shade why we need to give in the goal?

please advise
0
How to visualize call hierarchy in java using a pencil and paper all the way from beginning till end from UI to say model to controllers to dao to db calls etc including which object go in method and where the values changing etc in the new project

Please advise
0
Hi,
I am looking for String Format Method example using various date formats
https://www.javatpoint.com/java-string-format.

I found above link but no example there using the date format though like MMDDYYYY or YYYYMMDD etc to represent date?
please advise
0
HI,
If i have a class anotated with say @Component or @Service annotation...
And i autowire this in two other classes will the class hold the same object  or does spring creates a new instance of class everytime we do autowire ?

Thanks
0
Hi,
I have a class in which i am Autowiring a controller object like this :

@Component
public class Test {

@Autowired
XController xController;


public String method() {
    return xController.method();
}

Are there any issues with this approach as generally i dont see any controller object autowired anywhere..
Thanks
0
Hi,

When i right click on junit test(say ProductWeightTest.java) and run as Junit test from eclipse i keep getting popup with error

error could not create the java virtual machine error a fatal exception has occurred. program will exit



when i run individual test (checkWeightLessthan10Lb) in above test ProductWeightTest.java  i keep getting initialization error in eclipse console.

i tried changing eclise .ini entries but still getting same error. please advise
0

Java EE

17K

Solutions

7

Articles & Videos

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