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
Enroll in June's Course of the Month
LVL 9
Enroll in June's Course of the Month

June’s Course of the Month is now available! Experts Exchange’s Premium Members, Team Accounts, and Qualified Experts have access to a complimentary course each month as part of their membership—an extra way to sharpen your skills and increase training.

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
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
Get Actionable Data from Your Monitoring Solution
Get Actionable Data from Your Monitoring Solution

Your communication platform is only as good as the relevance of the information you send. Ensure your alerts get to the right people every time with actionable responses. Create escalation rules that ensure everyone follows the process and nothing is left to chance.

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
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
I was trying to implement Multiple datasources using Spring Batch, Mongo DB to read the data and Teradata to write the data

Implemenatation Strategy that i was following,

Using MongoItemRepository to read the data and performing business logic in processor.

for writing data to Teradata, i was using JdbcBatchItemWriter setting the datasource using jdbcTemplate, but still getting an error message saying, Caused by: java.lang.IllegalArgumentException: DatabaseType not found for product name: [Teradata]

Please let me know where i am doing wrong...

thanks in advance

I am providing complete log as well,


org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jpaBatchConfigurer': Invocation of init method failed; nested exception is java.lang.IllegalStateException: Unable to initialize Spring Batch
      at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessBeforeInitialization(InitDestroyAnnotationBeanPostProcessor.java:137) ~[spring-beans-4.3.8.RELEASE.jar:4.3.8.RELEASE]
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:409) ~[spring-beans-4.3.8.RELEASE.jar:4.3.8.RELEASE]
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1620) ~[spring-beans-4.3.8.RELEASE.jar:4.3.8.RELEASE]
      at …
0
Hi,
I am reading as below

https://www.tutorialspoint.com/ejb/ejb_message_driven_beans.htm

A message driven bean is a type of enterprise bean which is invoked by EJB container when it receives a message from queue or topic. Message driven bean is a stateless bean and is used to do task asynchronously.
when message comes to queue EJB container invokes MDB right. Then what does MDB do next when it is notified. It does some CRUD operations on database?

please advise.
I am not gtting end to end picture here.
0
Hello everyone,
I wanted to know if using MVC is (in anyway) incompatible with the use of UP?
Thank you
0
hello,
i'm trying to get the selected row ids from the datatable , the rowselect methode fires normaly , but i can't display what is in the selectedValues in the backing bean and  when i click  a button where it should dispaly it in the out put (console).. the says of it is 0
0
Turn Insights Into Action
Turn Insights Into Action

You’ve already invested in ITSM tools, chat applications, automation utilities, and more. Fortify these solutions with intelligent communications so you can drive business processes forward.

With xMatters, you'll never miss a beat.

Hello,
I want to edit my adobe muse website's code on Netbeans and J2EE. I want to convert the HTML code of my site into a JSP I exported the HTML code of my site but don't know what to do next. Please help me
0
Hi Experts

May you please assist. We have an application that must be restarted after deployment so that it can access a JMS queue. How do we resolve this iss?

Thank you
0
Hello.
I am trying to re-use Java code inside a C# project. In order to achieve this I convert Java libs to Windows DLLs using the IKVM compiler. This basically is working, however not for Java code calling JAXB functionality.
On Java side, JAXB is working fine, just on C# side, I get the following runtime error:
"Provider com.sun.xml.internal.bind.v2.ContextFactory could not be instantiated: javax.xml.bind.JAXBException: "<mynamespace.a.b.c>" doesnt contain ObjectFactory.class or jaxb.index"
Some more details:
On Java side, the Java lib (.jar) holding the binding classes does not need a jaxb.index file. The whole code has been implemented using Netbeans IDE, and there is an ObjectFactory class inside the lib.
I cannot find helpful information on the web, so I would appreciate any helpful hints very much.
Thanks a lot,
Johann
0
Hi Experts

I am getting the following error when I try to deploy a Spring application on webogic. The deployment fails with the below message:

org.springframework.beans.factory.BeanDefinitionStoreException: Invalid bean definition with name 'beanName' defined in class path resource [op/ka/veritx/news/base/real/appcontext/emailContext.xml]: Could not resolve placeholder 'mail.server'

We externalised the application properties file and placed them in the AppFileOverrides, but somehow this is not picked up by weblogic application server in the classpath.  Please take note, this works on other environments except for production.
0
Hi,

I am using quartz scheduler clustering in a clustered jboss 6 eap. I tried a different approach yesterday and now i have different issue.
I have packaged the quartz libraries inside an ear and its deployed in clustered jboss. Now i have the ejb bean class (its singleton and initialized at start-up) that i am using to start, stop and schedule the quartz. This i have packaged as a ejb jar.

Now I have app1.ear and app2.ear. The packaging in my app1.ear is
app1.ear --> ejb jar
                 --> myapp1.war ( this has a dependency on the ejb jar and has a job1 class)

The packaging in my app2.ear is
app2.ear --> ejb jar
                 --> myapp2.war ( this has a dependency on the ejb jar and has its own job2 class)

when i deploy app1.ear and app2.ear, job1 and job2 are persisted and trigger are fired for couple of seconds for both the jobs. Then i get a classnotfoundexception where the quartz is looking for job1 class in app2.ear and job2 class in app1.ear

Please help how to resolve this classloading issue.


Quartz properties
#============================================================================
# Configure Main Scheduler Properties
#============================================================================

org.quartz.scheduler.instanceName = killer123
org.quartz.scheduler.instanceId = AUTO

org.quartz.plugin.shutdownHook.class=org.quartz.plugins.management.ShutdownHookPlugin
org.quartz.plugin.shutdownHook.cleanShutdown = true…
0
Hi,

when i import project as existing maven project i am getting below error

please advise

INFO: Loading XML bean definitions from class path resource [src/main/resources/applicationContext.xml]
Exception in thread "main" org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from class path resource [src/main/resources/applicationContext.xml]; nested exception is java.io.FileNotFoundException: class path resource [src/main/resources/applicationContext.xml] cannot be opened because it does not exist
      at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:344)
      at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:304)
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