rich:fileUpload stackoverflow error at AjaxOutputTracker.getAjaxOutputs - java

I am currently migrating to richfaces 4.5, JSF2.2 and also add primefaces-6.0 (for other feature that is not supported by richfaces)
I am using Tomcat 8 for the server.
At the xhtml file, I just put simple code below just to test this :
<rich:fileUpload id="upload"
fileUploadListener="#{cc.attrs.beanPage.uploadListener}"
maxFilesQuantity="1"
acceptedTypes=".ppt, .pptx, .doc, .docx, .txt, .xls, .xlsx, .zip, .pdf" />
and at the uploadListener I only put some thing just to debug
public void uploadListener(FileUploadEvent event) {
this.item = event.getUploadedFile();
String projectFileName = this.item.getName();
}
When I debug I see it reach the listener and end without error. But I am getting this error below after the listener finished:
java.lang.StackOverflowError
at javax.faces.component.UIComponentBase.findComponent(UIComponentBase.java:679)
at javax.faces.component.UIComponentBase.findComponent(UIComponentBase.java:643)
at org.richfaces.context.AjaxOutputTracker.getAjaxOutputs(AjaxOutputTracker.java:86)
at org.richfaces.context.AjaxOutputTracker.getAjaxOutputs(AjaxOutputTracker.java:91)
at org.richfaces.context.AjaxOutputTracker.getAjaxOutputs(AjaxOutputTracker.java:91).. keep repeating
Jul 15, 2016 4:09:36 PM org.primefaces.application.exceptionhandler.PrimeExceptionHandler logException
SEVERE: null
java.lang.StackOverflowError
at javax.faces.component.UIComponentBase.findComponent(UIComponentBase.java:679)
at javax.faces.component.UIComponentBase.findComponent(UIComponentBase.java:643)
at org.richfaces.context.AjaxOutputTracker.getAjaxOutputs(AjaxOutputTracker.java:86)
at org.richfaces.context.AjaxOutputTracker.getAjaxOutputs(AjaxOutputTracker.java:91)
at org.richfaces.context.AjaxOutputTracker.getAjaxOutputs(AjaxOutputTracker.java:91)... keep repeating
Jul 15, 2016 4:09:38 PM org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/PORTAL].[Faces Servlet] invoke
SEVERE: Servlet.service() for servlet [Faces Servlet] in context with path [/PORTAL] threw exception [Servlet execution threw an exception] with root cause
java.lang.StackOverflowError
at javax.faces.component.UIComponentBase.findComponent(UIComponentBase.java:679)
at javax.faces.component.UIComponentBase.findComponent(UIComponentBase.java:643)
at org.richfaces.context.AjaxOutputTracker.getAjaxOutputs(AjaxOutputTracker.java:86)
at org.richfaces.context.AjaxOutputTracker.getAjaxOutputs(AjaxOutputTracker.java:91)
at org.richfaces.context.AjaxOutputTracker.getAjaxOutputs(AjaxOutputTracker.java:91)..... and so on keep repeating
Previously its working in old version.. Any idea on what I am doing wrong? I suspect there is a configuration that I missed that cause this.

After some testing here and there, I actually manage to fix this. The fix is just put limitRender="true" and it fix this problem.
This might be a very simple problem, but I actually don't understand why is this necessary, since I don't put any render in this fileupload. I might miss something in the form.
Edit: After some check, I find there is ajaxRendered=true in the page, but I don't know why it giving recursive overflow issue, since its not render each other. I might be missing something.

Related

java.lang.StackOverflowError when java.lang.ClassLoader.loadClass(ClassLoader.java:569)

I have these filling up in the catalina log file causing disk space issues when javaagent is attached. I have no idea from where there are getting triggered. What could be the reason ?
java.lang.StackOverflowError
at java.base/java.util.concurrent.ConcurrentHashMap.putIfAbsent(ConcurrentHashMap.java:1541)
at java.base/java.lang.ClassLoader.getClassLoadingLock(ClassLoader.java:668)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:569)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:576)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:576)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:576)
...........

Kinesis worker error: Caught exception when initializing LeaseCoordinator

I am trying to execute the sample producer and consumer code on the Kinesis Streams website: http://docs.aws.amazon.com/streams/latest/dev/learning-kinesis-module-one-download.html
I've downloaded the source, and I am using Eclipse to run it. I've included the necessary jar files, so I would think that everything would be setup to run.
When I run the processor code that consumes the records from Kinesis, however, I get this error:
Aug 02, 2016 8:35:14 PM com.amazonaws.services.kinesis.clientlibrary.lib.worker.Worker initialize SEVERE: Caught exception when initializing LeaseCoordinator
Does anyone think they could tell me what is causing this error?
EDIT: Here is the full stack trace from the error on Eclipse:
Aug 02, 2016 9:02:27 PM com.amazonaws.services.kinesis.clientlibrary.lib.worker.Worker initialize
SEVERE: Caught exception when initializing LeaseCoordinator
com.amazonaws.services.kinesis.leases.exceptions.DependencyException: com.amazonaws.services.dynamodbv2.model.AmazonDynamoDBException: User: arn:aws:sts::500238854089:assumed-role/NORD-NONPROD-a0121-Team/AEXM is not authorized to perform: dynamodb:CreateTable on resource: arn:aws:dynamodb:us-west-2:500238854089:table/amazon-kinesis-learning (Service: AmazonDynamoDBv2; Status Code: 400; Error Code: AccessDeniedException; Request ID: BGME094FRUAEK2KFCPQIAM5U8VVV4KQNSO5AEMVJF66Q9ASUAAJG)
at com.amazonaws.services.kinesis.leases.impl.LeaseManager.createLeaseTableIfNotExists(LeaseManager.java:124)
at com.amazonaws.services.kinesis.clientlibrary.lib.worker.KinesisClientLibLeaseCoordinator.initialize(KinesisClientLibLeaseCoordinator.java:172)
at com.amazonaws.services.kinesis.clientlibrary.lib.worker.Worker.initialize(Worker.java:380)
at com.amazonaws.services.kinesis.clientlibrary.lib.worker.Worker.run(Worker.java:324)
at com.amazonaws.services.kinesis.samples.stocktrades.processor.StockTradesProcessor.main(StockTradesProcessor.java:96)
Caused by: com.amazonaws.services.dynamodbv2.model.AmazonDynamoDBException: User: arn:aws:sts::500238854089:assumed-role/NORD-NONPROD-a0121-Team/AEXM is not authorized to perform: dynamodb:CreateTable on resource: arn:aws:dynamodb:us-west-2:500238854089:table/amazon-kinesis-learning (Service: AmazonDynamoDBv2; Status Code: 400; Error Code: AccessDeniedException; Request ID: BGME094FRUAEK2KFCPQIAM5U8VVV4KQNSO5AEMVJF66Q9ASUAAJG)
at com.amazonaws.http.AmazonHttpClient.handleErrorResponse(AmazonHttpClient.java:1401)
at com.amazonaws.http.AmazonHttpClient.executeOneRequest(AmazonHttpClient.java:945)
at com.amazonaws.http.AmazonHttpClient.executeHelper(AmazonHttpClient.java:723)
at com.amazonaws.http.AmazonHttpClient.doExecute(AmazonHttpClient.java:475)
at com.amazonaws.http.AmazonHttpClient.executeWithTimer(AmazonHttpClient.java:437)
at com.amazonaws.http.AmazonHttpClient.execute(AmazonHttpClient.java:386)
at com.amazonaws.services.dynamodbv2.AmazonDynamoDBClient.doInvoke(AmazonDynamoDBClient.java:2074)
at com.amazonaws.services.dynamodbv2.AmazonDynamoDBClient.invoke(AmazonDynamoDBClient.java:2044)
at com.amazonaws.services.dynamodbv2.AmazonDynamoDBClient.createTable(AmazonDynamoDBClient.java:899)
at com.amazonaws.services.kinesis.leases.impl.LeaseManager.createLeaseTableIfNotExists(LeaseManager.java:117)
... 4 more
Your stack trace is telling you exactly what the problem is:
User: arn:aws:sts::500238854089:assumed-role/NORD-NONPROD-a0121-Team/AEXM is not authorized to perform: dynamodb:CreateTable on resource: arn:aws:dynamodb:us-west-2:500238854089:table/amazon-kinesis-learning
Make sure you've provided credentials to the DynamoDBClient that has CreateTable permissions - LeaseCoordinator attempts to create the leasing table in Dynamo.
It is actually possible to configure logging for Scala Kinesis Enrich by running the jar file like this:
java -jar -Dorg.slf4j.simpleLogger.defaultLogLevel=debug snowplow-kinesis-enrich-0.5.0 --config enrich.conf --resolver resolver.json
This should print all debug messages from the Kinesis Client Library. (Watch out because the output will become very verbose.) Could you try rerunning with this change to logging? Hopefully that will provide more clues about what's going wrong.

Active Directory Query - Java

I have followed this example: http://myjeeva.com/querying-active-directory-using-java.html
my domain is mycompanyname.com.au
I added this to avoid authentaction: properties.put(Context.SECURITY_AUTHENTICATION,"none");
I am searching for a username. However, I got this exception:
Apr 13, 2015 9:57:26 AM ldap.ActiveDirectory <init>
SEVERE: mycompany.com.au:port no
Exception in thread "main" java.lang.NullPointerException
at ldap.ActiveDirectory.searchUser(ActiveDirectory.java:108)
at ldap.N.main(N.java:65)
I am looking for a specific group of users which are in CN=XXXX,OU=Security IT,OU=IT,DC=mycomapny,DC=com,DC=au
There is space in OU=Security IT. Is it an issue?
The exception is thrown by
return this.dirContext.search(base, filter, this.searchCtls);
I found this solution which works perfectly.

Error using htmlunit

I'm using gargoylesoftware htmlunit in java to get webpages after their javascript has been run (as you can't do this with the inbuilt java libraries). I'm using this in a webscraper, so this code is being run many many times over without issue, however quite randomly I get this error every hour or so after running the program:
Jan 13, 2015 8:03:52 AM com.gargoylesoftware.htmlunit.WebConsole info
INFO: ThreadStats: couldn't get the catalog (undefined)
Jan 13, 2015 8:03:52 AM com.gargoylesoftware.htmlunit.WebConsole info
INFO: ThreadStats: couldn't get the catalog ()
The code this error is appearing on is:
final HtmlPage page = webClient.getPage(URIget.getSearchURL(ToSearch, board));
I'm pretty sure the error doesn't originate from my URI.getSearchURL method, as it doesn't do anything fancy, only stick a few strings together
Try putting these after creating a WebClient and it should prevent the message from showing
webClient.setCssErrorHandler(new SilentCssErrorHandler());
LogFactory.getFactory().setAttribute("org.apache.commons.logging.Log", "org.apache.commons.logging.impl.NoOpLog");
java.util.logging.Logger.getLogger("com.gargoylesoftware.htmlunit").setLevel(Level.OFF);
java.util.logging.Logger.getLogger("org.apache.commons.httpclient").setLevel(Level.OFF);
java.util.logging.Logger.getLogger("com.gargoylesoftware.htmlunit.javascript.StrictErrorReporter").setLevel(Level.OFF);
java.util.logging.Logger.getLogger("com.gargoylesoftware.htmlunit.javascript.host.ActiveXObject").setLevel(Level.OFF);
java.util.logging.Logger.getLogger("com.gargoylesoftware.htmlunit.javascript.host.html.HTMLDocument").setLevel(Level.OFF);
java.util.logging.Logger.getLogger("com.gargoylesoftware.htmlunit.html.HtmlScript").setLevel(Level.OFF);
java.util.logging.Logger.getLogger("com.gargoylesoftware.htmlunit.javascript.host.WindowProxy").setLevel(Level.OFF);
java.util.logging.Logger.getLogger("com.gargoylesoftware").setLevel(Level.OFF);
java.util.logging.Logger.getLogger("org.apache").setLevel(Level.OFF);

Weblogic Error The error is weblogic.descriptor.DescriptorException: VALIDATION PROBLEMS WERE FOUND

I am using web logic server 10.3.6 and trying to deploy and run the existing project.
i got error like
problem: cvc-complex-type.2.4c: Expected element 'module#http://java.sun.com/xml/ns/javaee' before the end of the content in element application#http://java.sun.com/xml/ns/javaee:<null>
at weblogic.descriptor.internal.MarshallerFactory$1.evaluateResults(MarshallerFactory.java:234)
at weblogic.descriptor.internal.MarshallerFactory$1.evaluateResults(MarshallerFactory.java:221)
at weblogic.descriptor.internal.MarshallerFactory$1.createDescriptor(MarshallerFactory.java:146)
at weblogic.descriptor.BasicDescriptorManager.createDescriptor(BasicDescriptorManager.java:306)
at weblogic.application.descriptor.AbstractDescriptorLoader2.getDescriptorBeanFromReader(AbstractDescriptorLoader2.java:788)
at weblogic.application.descriptor.AbstractDescriptorLoader2.createDescriptorBean(AbstractDescriptorLoader2.java:409)
at weblogic.application.descriptor.AbstractDescriptorLoader2.loadDescriptorBeanWithoutPlan(AbstractDescriptorLoader2.java:759)
at weblogic.application.descriptor.AbstractDescriptorLoader2.loadDescriptorBean(AbstractDescriptorLoader2.java:768)
at weblogic.application.ApplicationDescriptor.getApplicationDescriptor(ApplicationDescriptor.java:311)
at weblogic.application.internal.EarDeploymentFactory.findOrCreateComponentMBeans(EarDeploymentFactory.java:174)
at weblogic.application.internal.MBeanFactoryImpl.findOrCreateComponentMBeans(MBeanFactoryImpl.java:48)
at weblogic.application.internal.MBeanFactoryImpl.createComponentMBeans(MBeanFactoryImpl.java:110)
at weblogic.application.internal.MBeanFactoryImpl.initializeMBeans(MBeanFactoryImpl.java:76)
at weblogic.management.deploy.internal.MBeanConverter.createApplicationMBean(MBeanConverter.java:88)
at weblogic.management.deploy.internal.MBeanConverter.createApplicationForAppDeployment(MBeanConverter.java:66)
at weblogic.management.deploy.internal.MBeanConverter.setupNew81MBean(MBeanConverter.java:314)
at weblogic.deploy.internal.targetserver.AppDeployment.prepare(AppDeployment.java:110)
at weblogic.management.deploy.internal.DeploymentAdapter$1.doPrepare(DeploymentAdapter.java:39)
at weblogic.management.deploy.internal.DeploymentAdapter.prepare(DeploymentAdapter.java:187)
at weblogic.management.deploy.internal.AppTransition$1.transitionApp(AppTransition.java:21)
at weblogic.management.deploy.internal.ConfiguredDeployments.transitionApps(ConfiguredDeployments.java:233)
at weblogic.management.deploy.internal.ConfiguredDeployments.prepare(ConfiguredDeployments.java:165)
at weblogic.management.deploy.internal.ConfiguredDeployments.deploy(ConfiguredDeployments.java:122)
at weblogic.management.deploy.internal.DeploymentServerService.resume(DeploymentServerService.java:173)
at weblogic.management.deploy.internal.DeploymentServerService.start(DeploymentServerService.java:89)
at weblogic.t3.srvr.SubsystemRequest.run(SubsystemRequest.java:64)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
<13 Nov, 2013 5:22:53 PM IST> <Error> <Deployer> <BEA-149605> <Failed to create App/Comp mbeans for AppDeploymentMBean _auto_generated_ear_. Error - weblogic.management.DeploymentException: VALIDATION PROBLEMS WERE FOUND
problem: cvc-complex-type.2.4c: Expected element 'module#http://java.sun.com/xml/ns/javaee' before the end of the content in element application#http://java.sun.com/xml/ns/javaee:<null>.
weblogic.management.DeploymentException: VALIDATION PROBLEMS WERE FOUND
problem: cvc-complex-type.2.4c: Expected element 'module#http://java.sun.com/xml/ns/javaee' before the end of the content in element application#http://java.sun.com/xml/ns/javaee:<null>
at weblogic.application.internal.EarDeploymentFactory.findOrCreateComponentMBeans(EarDeploymentFactory.java:189)
at weblogic.application.internal.MBeanFactoryImpl.findOrCreateComponentMBeans(MBeanFactoryImpl.java:48)
at weblogic.application.internal.MBeanFactoryImpl.createComponentMBeans(MBeanFactoryImpl.java:110)
at weblogic.application.internal.MBeanFactoryImpl.initializeMBeans(MBeanFactoryImpl.java:76)
at weblogic.management.deploy.internal.MBeanConverter.createApplicationMBean(MBeanConverter.java:88)
Truncated. see log file for complete stacktrace
weblogic.descriptor.DescriptorException: VALIDATION PROBLEMS WERE FOUND
problem: cvc-complex-type.2.4c: Expected element 'module#http://java.sun.com/xml/ns/javaee' before the end of the content in element application#http://java.sun.com/xml/ns/javaee:<null>
at weblogic.descriptor.internal.MarshallerFactory$1.evaluateResults(MarshallerFactory.java:234)
at weblogic.descriptor.internal.MarshallerFactory$1.evaluateResults(MarshallerFactory.java:221)
at weblogic.descriptor.internal.MarshallerFactory$1.createDescriptor(MarshallerFactory.java:146)
at weblogic.descriptor.BasicDescriptorManager.createDescriptor(BasicDescriptorManager.java:306)
at weblogic.application.descriptor.AbstractDescriptorLoader2.getDescriptorBeanFromReader(AbstractDescriptorLoader2.java:788)
Truncated. see log file for complete stacktrace
Try changing it to:
<sec:user-lockout-manager>
<sec:lockout-enabled>true</sec:lockout-enabled>
<sec:lockout-threshold>5</sec:lockout-threshold>
<sec:lockout-duration>30</sec:lockout-duration>
<sec:lockout-reset-duration>5</sec:lockout-reset-duration>
<sec:lockout-cache-size>5</sec:lockout-cache-size>
<sec:lockout-gc-threshold>400</sec:lockout-gc-threshold>
<sec:name>some_name</sec:name>
</sec:user-lockout-manager>
according to the link
http://docs.oracle.com/cd/E13222_01/wls/docs91/schemaref/security/http.www.bea.com.ns.weblogic.90.security/types/realmtype.user-lockout-manager.html
there is an name component thought it is supposed to be optional.

Categories