I want to transfer up to 16MB large files through websockets. When I try to send a file greater than 3MB it gives me the following error:
Warning: Unexpected error, closing connection.
java.lang.IllegalArgumentException: Buffer overflow.
at org.glassfish.tyrus.core.Utils.appendBuffers(Utils.java:346)
at org.glassfish.tyrus.core.TyrusWebSocketEngine$TyrusReadHandler.handle(TyrusWebSocketEngine.java:523)
I have read that buffer size can be changed inside glassfish-web.xml file by adding:
<param-name>org.glassfish.tyrus.servlet.incoming-buffer-size</param-name>
<param-value>17000000</param-value>
into:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE glassfish-web-app PUBLIC "-//GlassFish.org//DTD GlassFish Application Server 3.1 Servlet 3.0//EN" "http://glassfish.org/dtds/glassfish-web-app_3_0-1.dtd">
<glassfish-web-app>
<context-root>/PROJECT</context-root>
</glassfish-web-app>
but it didn't work out for me. Is there any other option or am I doing something wrong.
Related
my application is sending below request to print a document which has special characters
*<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<udp tag="crypto"><luid url="https://w3.servername.com/ocp/<FnQ+xwAAAYXgbc3dgA4=>.kuid" uid="Rm5RK3h3QUFBWVhnYmMzZGdBND0="/></udp>*
From my application, request goes to OCP client for document printing. OCP client is running on a remote machine and we see below error on OCP client side
2023-01-25 08:42:43,013 ERROR [upd-Dispatcher] - Problem with JAXB
javax.xml.bind.UnmarshalException: Premature end of file.
- with linked exception:
[org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 1; Premature end of file.]
Same setup/flow works fine with Jboss 6.4 server. I added below properties in standalone file in jboss 7.3 but nothing works out. Any idea how this can be addressed in Jboss 7.3?
<property name="org.wildfly.undertow.ALLOW_UNESCAPED_CHARACTERS_IN_URL" value="true"/>
<property name="tomcat.util.http.parser.HttpParser.requestTargetAllow" value="!"#$%&'()*+,-./:;<=>?#[]^_`{|}~"/>
I tried adding below properties to escape the special characters and I was expecting it to work like it works in jboss 6.4 and print the document.
?#[]^_`{|}~"/>
I'm trying to upload a 6MB file to my JHipster app server. However, I get the following error. Where can I find the related configuration?
io.undertow.server.RequestTooBigException: UT000020: Connection terminated as request was larger than 10485760
at io.undertow.conduits.FixedLengthStreamSourceConduit.checkMaxSize(FixedLengthStreamSourceConduit.java:168)
at io.undertow.conduits.FixedLengthStreamSourceConduit.read(FixedLengthStreamSourceConduit.java:229)
at org.xnio.conduits.ConduitStreamSourceChannel.read(ConduitStreamSourceChannel.java:127)
at io.undertow.channels.DetachableStreamSourceChannel.read(DetachableStreamSourceChannel.java:209)
at io.undertow.server.HttpServerExchange$ReadDispatchChannel.read(HttpServerExchange.java:2332)
at org.xnio.channels.Channels.readBlocking(Channels.java:294)
at io.undertow.servlet.spec.ServletInputStreamImpl.readIntoBuffer(ServletInputStreamImpl.java:192)
at io.undertow.servlet.spec.ServletInputStreamImpl.read(ServletInputStreamImpl.java:168)
at io.undertow.server.handlers.form.MultiPartParserDefinition$MultiPartUploadHandler.parseBlocking(MultiPartParserDefinition.java:213)
at io.undertow.servlet.spec.HttpServletRequestImpl.parseFormData(HttpServletRequestImpl.java:792)
Spring Boot has the following default properties
spring.servlet.multipart.max-file-size=1MB # Max file size. Values can use the suffixes "MB" or "KB" to indicate megabytes or kilobytes, respectively.
spring.servlet.multipart.max-request-size=10MB # Max request size. Values can use the suffixes "MB" or "KB" to indicate megabytes or kilobytes, respectively.
10485760 = 10MB
See the file upload Spring Boot guide :
For Spring Boot 1.5.13.RELEASE try this properties:
spring.http.multipart.max-request-size=100MB
spring.http.multipart.max-file-size=100MB
At container level, there is the property maxPostSize which can be specified directly on the connector.
From docs:
The maximum size in bytes of the POST which will be handled by the container FORM URL parameter parsing. The limit can be disabled by setting this attribute to a value less than or equal to 0. If not specified, this attribute is set to 2097152 (2 megabytes).
In addition to maslbl4 answer, for those who uses " .yml " configuration file like me, use the following code :
spring:
servlet:
multipart:
max-file-size: 100MB
max-request-size: 100MB
It worked fine for me .
open standalone-full.xml file and write {max-post-size="50000000"} here i give the file size 50mb. and my project is running sucessfully.
<server name="default-server">
<http-listener name="default" max-post-size="50000000" socket-binding="http" redirect-socket="https" enable-http2="true"/>
<https-listener name="https" socket-binding="https" security-realm="ApplicationRealm" enable-http2="true"/>
<host name="default-host" alias="localhost">
<location name="/" handler="welcome-content"/>
<http-invoker security-realm="ApplicationRealm"/>
</host>
</se
Using Spring Version :2.3.12
You can use the below properties.
spring.servlet.multipart.max-file-size=35MB
spring.servlet.multipart.max-request-size=35MB
Note :http is depricated
I deploy an ear with a unique war inside with servlet 2.5 version.
When I try to start the application, the log shows this message and the server tries to start the application infinitely. It ends after 20 minutes throwing a java HeapException.
[11/18/13 11:12:24:235 CET] 00000044 FfdcProvider W com.ibm.ws.ffdc.impl.FfdcProvider logIncident FFDC1003I: FFDC Incident emitted on /opt/was/WebSphere/AppServer/profiles/AppSrv01/logs/ffdc/server1_a74ac991_13.11.18_11.12.24.2348371791741532456941.txt com.ibm.ws.classloader.ClassLoaderUtils.addDependents 238
[11/18/13 11:12:26:007 CET] 00000044 webapp I com.ibm.ws.webcontainer.webapp.WebGroupImpl WebGroup SRVE0169I: Loading Web Module: ISicres 8.2 GISS Servlet 2.5.
[11/18/13 11:12:26:490 CET] 00000044 WASSessionCor I SessionContextRegistry getSessionContext SESN0176I: Will create a new session context for application key default_host/ISicres
If I deploy the same ear but with servlet 2.4 version, when I start the application, it starts in a few seconds.
The servlet 2.4 definition is the following:
<web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
The servlet 2.5 definition is the following:
<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
At the startup it shows the following exception in the log /opt/was/WebSphere/AppServer/profiles/AppSrv01/logs/ffdc/server1_a74ac991_13.11.18_11.12.24.2348371791741532456941.txt:
[11/18/13 11:12:24:234 CET] FFDC Exception:java.util.zip.ZipException SourceId:com.ibm.ws.classloader.ClassLoaderUtils.addDependents ProbeId:238 Reporter:java.lang.Class#e9e29e43
java.util.zip.ZipException: error in opening zip file
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.<init>(ZipFile.java:150)
at java.util.jar.JarFile.<init>(JarFile.java:149)
at java.util.jar.JarFile.<init>(JarFile.java:113)
at com.ibm.ws.classloader.ClassLoaderUtils.addDependents(ClassLoaderUtils.java:147)
at com.ibm.ws.classloader.ClassLoaderUtils.addDependents(ClassLoaderUtils.java:195)
at com.ibm.ws.classloader.ClassLoaderUtils.addDependentJars(ClassLoaderUtils.java:113)
at com.ibm.ws.classloader.ClassGraph.<init>(ClassGraph.java:117)
at com.ibm.ws.classloader.ClassLoaderManager.initialize(ClassLoaderManager.java:202)
at com.ibm.ws.classloader.ClassLoaderManager.<init>(ClassLoaderManager.java:166)
at com.ibm.ws.runtime.component.DeployedApplicationImpl.start(DeployedApplicationImpl.java:923)
at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(ApplicationMgrImpl.java:769)
at com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:2172)
at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.start(CompositionUnitMgrImpl.java:445)
at com.ibm.ws.runtime.component.CompositionUnitImpl.start(CompositionUnitImpl.java:123)
at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.start(CompositionUnitMgrImpl.java:388)
at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.access$500(CompositionUnitMgrImpl.java:116)
at com.ibm.ws.runtime.component.CompositionUnitMgrImpl$CUInitializer.run(CompositionUnitMgrImpl.java:994)
at com.ibm.wsspi.runtime.component.WsComponentImpl$_AsynchInitializer.run(WsComponentImpl.java:349)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1783)
At the end, the server writes some headdump files. This is the content of the file 'javacore.20131118.103120.6704.0005.txt' written:
0SECTION TITLE subcomponent dump routine
NULL ===============================
1TICHARSET UTF-8
1TISIGINFO Dump Event "systhrow" (00040000) Detail "java/lang/OutOfMemoryError" "Java heap space" received
1TIDATETIME Date: 2013/11/18 at 10:34:30
1TIFILENAME Javacore filename: /opt/was/WebSphere/AppServer/profiles/AppSrv01/javacore.20131118.103120.6704.0005.txt
1TIREQFLAGS Request Flags: 0x81 (exclusive+preempt)
1TIPREPSTATE Prep State: 0x104 (exclusive_vm_access+trace_disabled)
NULL ------------------------------------------------------------------------
0SECTION GPINFO subcomponent dump routine
NULL ================================
2XHOSLEVEL OS Level : Linux 2.6.32.12-0.7-default
2XHCPUS Processors -
3XHCPUARCH Architecture : amd64
3XHNUMCPUS How Many : 1
3XHNUMASUP NUMA is either not supported or has been disabled by user
NULL
1XHERROR2 Register dump section only produced for SIGSEGV, SIGILL or SIGFPE.
NULL
NULL ------------------------------------------------------------------------
0SECTION ENVINFO subcomponent dump routine
NULL =================================
1CIJAVAVERSION JRE 1.6.0 Linux amd64-64 build 20120322_106210 (pxa6460_26sr2ifix-20120419_02(SR2+IV19661))
1CIVMVERSION VM build R26_Java626_SR2_20120322_1722_B106210
1CIJITVERSION r11_20120322_22976
1CIGCVERSION GC - R26_Java626_SR2_20120322_1722_B106210_CMPRSS
1CIJITMODES JIT enabled, AOT enabled, FSD disabled, HCR disabled
1CIRUNNINGAS Running as a standalone JVM
1CICMDLINE /opt/was/WebSphere/AppServer/java/bin/java -Declipse.security -Dwas.status.socket=44247
What could be the problem with WAS 8.5 and servlets 2.5 spec?
Without knowledge of the contents of your application I can only assume that extensive classpath scanning is going on (a lot of annotations were introduced in Java EE 6/Servlet 2.5). You should check with Reducing annotation searches during application deployment for possible solutions.
I managed to set up a Mule project to download a file from a FTP, and save it on a local disk. However after transferring the file, Mule keeps trying to delete the remote file on the FTP.
Is there a way to tell Mule not to delete the original file and just leave it as it is?
Here's my project XML:
<?xml version="1.0" encoding="UTF-8"?>
<mule ...>
<flow name="copy-remote-fileFlow1" doc:name="copy-remote-fileFlow1">
<ftp:inbound-endpoint host="ftp.secureftp-test.com" port="21" path="subdir1" user="test" password="test" pollingFrequency="60000" responseTimeout="10000" doc:name="FTP">
<file:filename-wildcard-filter pattern="box.ico" />
</ftp:inbound-endpoint>
<file:outbound-endpoint path="I:\test\" outputPattern="fromMule.ico" responseTimeout="10000"
doc:name="File" /> </flow>
</mule>
And in my case, I don't have the rights to delete the file so I get an exception:
ERROR 2013-05-24 17:35:47,286 [[copy-remote-file].connector.ftp.mule.default.receiver.02] org.mule.exception.DefaultSystemExceptionStrategy: Caught exception in Exception Strategy: Failed to delete file box.ico. Ftp error: 550
java.io.IOException: Failed to delete file box.ico. Ftp error: 550
at org.mule.transport.ftp.FtpMessageReceiver.postProcess(FtpMessageReceiver.java:202)
at com.mulesoft.mule.transport.ftp.EEFtpMessageReceiver.postProcess(EEFtpMessageReceiver.java:71)
at org.mule.transport.ftp.FtpMessageReceiver$FtpWork.run(FtpMessageReceiver.java:316)
at org.mule.work.WorkerContext.run(WorkerContext.java:311)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Your only option consists in extending org.mule.transport.ftp.FtpMessageReceiver in order to override the postProcess method, which is the one that takes care of deleting the file on the FTP server.
To register your custom FtpMessageReceiver use the service-overrides configuration element on your FTP connector:
<ftp:connector name="nonDeletingFtpConnector">
<service-overrides messageReceiver="com.amce.NonDeletingFtpMessageReceiver" />
</ftp:connector>
Adding few things to what David already mentioned. The NonDeletingFtpMessageReceiver class constructor should look like this :
public NonDeletingFtpMessageReceiver(EEFtpConnector connector,
Flow flowConstruct, DefaultInboundEndpoint endpoint,
long frequency, String value1, String value2, long value3)
throws CreateException {
super(connector, flowConstruct, endpoint, frequency);
}
Another solution is to set streaming="true" on the FTP connector which would disable the file deletion.
I get the following exception when deploying a JSR 286 portlet into Oracle WebLogic Server 11g (to deploy it later in Oracle WebCenter 11g):
<19-ene-2010 13H32' CET> <Error> <oracle.portlet.server.containerimpl.PortletApplicationImpl> <BEA-000000> <Error al procesar el archivo "/WEB-INF/portlet.xml" en la lÝnea 6 columna 68.
org.xml.sax.SAXParseException: cvc-elt.1: Cannot find the declaration of element 'portlet-app'
The error message is in spanish. It means:
"Error processing the file "/WEB-INF/portlet.xml at line 6 column 68"
The portlet.xml of my portlet seems to be correct and I've deployed it in other portal servers. So I don't understand the error message.
This is the portlet.xml of my portlet (eclipse XML validator said it was a valid XML)
<?xml version="1.0" encoding="UTF-8"?>
<portlet-app version="2.0"
xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd
http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
xmlns:dnd="http://www.denodo.com/widget/portlet/portletjsr286">
<portlet>
<description>Test Inter Portlet Communication (JSR286)</description>
<portlet-name>Test IPC</portlet-name>
<display-name>Test IPC</display-name>
<portlet-class>com.denodo.ipc.TestIPCPortlet</portlet-class>
<supports>
<mime-type>text/html</mime-type>
<portlet-mode>VIEW</portlet-mode>
</supports>
<supported-locale>en</supported-locale>
<resource-bundle>PortletMessages</resource-bundle>
<portlet-info>
<title>Test IPC</title>
<short-title>Test IPC</short-title>
<keywords>Test IPC,Denodo</keywords>
</portlet-info>
</portlet>
</portlet-app>
How do I deploy my portlet
I convert my portlet into to a WSRP portlet by executing
java -jar wsrp-predeploy.jar source EAR target EAR
as explained in http://download.oracle.com/docs/cd/E12839_01/webcenter.1111/e12405/wcadm_portlet_prod.htm#CHDECJHI)
I try to deploy it into WebLogic with the WebLogic Console and I get this exception.
My Environment
WebCenter Suite (11.1.1.2.0) + WebLogic Server (10.3.2) downloaded from the oracle.com. Default configuration
S.O: Windows XP SP3
Thanks in advance for your time.
Have you tried using the openPortal portlet-container? The doc says it will install onto weblogic: https://portlet-container.dev.java.net/public/Download.html
Update: I just installed the portlet-container into the weblogic container and successfully deployed one of the sample portlets from this page: \http://portlet-container.dev.java.net/public/Samples.html