System out of memory during deployment

Hello everybody,
I have a J2EE project and a respective EAR-project to deploy my application on the WebAS 6.40 (SP13).
Since yesterday I have the problem that when I add a new entity bean to my J2EE project I got the following error during deployment.
If I remove the entity bean there is no problem to deploy the project.
I tried a lot of things, e.g. changing the heap size of the developing workspace or of the sdm, but no results. Has someone an idea?
Is there probably a limit for beans in a J2EE project?
===========================================================================
Deployment started Wed Aug 17 11:58:00 CEST 2005
===========================================================================
Starting Deployment of HPMisEAR
Aborted: development component 'HPMisEAR'/'com.hp'/'localhost'/'2005.08.17.11.51.27':
Caught exception during application deployment from SAP J2EE Engine's deploy service:
java.rmi.RemoteException: Cannot deploy application com.hp/HPMisEAR.. Reason: Errors while compiling:
The system is out of resources.
Consult the following stack trace for details.
java.lang.OutOfMemoryError
; nested exception is:      com.sap.engine.services.ejb.exceptions.deployment.EJBFileGenerationException: Errors while compiling:
The system is out of resources.
Consult the following stack trace for details.
java.lang.OutOfMemoryError
(message ID: com.sap.sdm.serverext.servertype.inqmy.extern.EngineApplOnlineDeployerImpl.performAction(DeploymentActionTypes).REMEXC)
Deployment of HPMisEAR finished with Error (Duration 51252 ms)
Thanks for help,
Paulo
Message was edited by: Paulo Calado

Hi,
thank you very much, it works now.
Best regards,
Paulo

Similar Messages

  • BPC 5.0.502  BPC Web Error Message: Exxception of Type System out of memory

    In the process of updating a web page in the content library, page crashed received an error message of "Exception of type System out of memory.  Exception was throw".  What does this mean?  We are now unable to open this sheet without receiving the prior message.  Any remadies would be appreciated.

    Hello,
        Did you receive this specific error message only managing that web page or for all pages?
        Did you try to stop all COM+ components on the application servers(on each if you are using more). It looks to be related to some memory problems.
        If the problem is related to a specific web page, the problem can be related to the content of that web page.
    Best regards,
    Mihaela

  • System.out of memory exception

    I am running a TestStand sequence, using the .NET adaptor I am creating a class, and calling methods of a Class Library I created in VB.NET. I tested my class library in VB.NET and everything works in that environment. The sequence I call is pretty simple,
    create an instance of my class, then
    call a method that setups and initializes a camera
    call a method that runs through the tests of a test sequence
    The first pass of the sequence, it runs, the second pass of the sequence, whether in a For loop or the entire TestStand Sequence started again, it initializes the camera, but the second sequence, TestStand reports a system.out of memory exception in an underlying assembly/dll of my dll. But, when I call my dll from a .exe I made to test my dll, it works fine.
    Thanks

    Thanks for you reply.
    I am calling the setup and initialization of the camera once; it is the calling the method that runs a sequence of tests that I am repeating calls to and subsequently failing on the second call. The interesting thing is if I close out of TestStand completely after the first run. Then run my TestStand sequence again, it reportsd the same error. It seems something is not being released, or cleared, or something. Keep in mind, I am only getting this with TestStand, I do not get it when I run a test .exe that calls my dll. I since have tested calling my .exe in TestStand that calls my DLL and that works. The problem is clearly in using TestStand to create the class and call the methods.
    Thanks

  • System out of memory when exporting/migrating Solution Manager

    Dear all,
    since we decided to migrate our Solution Manager (win2003/sql server 2005) system to a more appropriate server, we started an export using the NW70sr2 installation master CD, the one we used to install this solution manager instance.
    Everything went ok up to the Java export phase, here we caught an out of memory issue, here's the relevant part of the sapinst.dev.log file:
    May 24, 2008 1:49:46 PM com.sap.inst.jload.Jload dbExport
    SEVERE: DB Error during export of BC_SLD_CHANGELOG
    May 24, 2008 1:49:46 PM com.sap.inst.jload.Jload printSQLException
    SEVERE: Message: The system is out of memory. Use server side cursors for large result sets:null. Result set size:262,182,182. JVM total memory size:518,979,584.
    May 24, 2008 1:49:46 PM com.sap.inst.jload.Jload printSQLException
    SEVERE: SQLState: null
    May 24, 2008 1:49:46 PM com.sap.inst.jload.Jload printSQLException
    SEVERE: ErrorCode: 0
    May 24, 2008 1:49:46 PM com.sap.inst.jload.db.DBConnection disconnect
    INFO: disconnected
    TRACE      [iaxxejsexp.cpp:199]
               EJS_Installer::writeTraceToLogBook()
    2008-05-24 13:49:49.755 JavaApplication execution finished
    TRACE      [iaxxejsexp.cpp:199]
               EJS_Installer::writeTraceToLogBook()
    2008-05-24 13:49:49.755 NWDB._callJLoad(export) done: throwing
    TRACE      [iaxxejsexp.cpp:199]
               EJS_Installer::writeTraceToLogBook()
    NWException thrown: nw.syscopy.jloadRunFailed:
    <html>Execution of JLoad tool 'C:\j2sdk1.4.2_14-x64\bin\java.exe -classpath F:\usr\sap\SMD\SYS\global\sltools\sharedlib\launcher.jar -showversion -Xmx512m com.sap.engine.offline.OfflineToolStart com.sap.inst.jload.Jload
    SMDCA/sapmnt/SMD/SYS/global/security/lib/tools/iaik_jce.jar;
    SMDCA/sapmnt/SMD/SYS/global/security/lib/tools/iaik_jsse.jar;
    SMDCA/sapmnt/SMD/SYS/global/security/lib/tools/iaik_smime.jar;
    SMDCA/sapmnt/SMD/SYS/global/security/lib/tools/iaik_ssl.jar;
    SMDCA/sapmnt/SMD/SYS/global/security/lib/tools/w3c_http.jar;F:/usr/sap/SMD/SYS/global/sltools/sharedlib/jload.jar;F:/usr/sap/SMD/SYS/global/sltools/sharedlib/antlr.jar;F:/usr/sap/SMD/SYS/global/sltools/sharedlib/exception.jar;F:/usr/sap/SMD/SYS/global/sltools/sharedlib/jddi.jar;F:/usr/sap/SMD/SYS/global/sltools/sharedlib/logging.jar;F:/usr/sap/SMD/SYS/global/sltools/sharedlib/offlineconfiguration.jar;F:/usr/sap/SMD/SYS/global/sltools/sharedlib/opensqlsta.jar;F:/usr/sap/SMD/SYS/global/sltools/sharedlib/tc_sec_secstorefs.jar;F:\usr\sap\SMD\DVEBMGS00\exe\mssjdbc\sqljdbc.jar -sec SMD,jdbc/pool/SMD,
    SMDCA/sapmnt/SMD/SYS/global/security/data/SecStore.properties,
    SMDCA/sapmnt/SMD/SYS/global/security/data/SecStore.key -dataDir E:/EXPORT/JAVA/JDMP -remove_trailing_blanks "C:/Documents and Settings/administrator.ATRSAP/removeTrailingBlanks.txt" -convert_empty_LOBs "C:/Documents and Settings/administrator.ATRSAP/convertEmptyLobs.txt" -convert_empty_strings "C:/Documents and Settings/administrator.ATRSAP/convertEmptyStrings.txt" -convert_empty_binary "C:/Documents and Settings/administrator.ATRSAP/convertEmptyBinary.txt"' aborts with return code 1.<br>SOLUTION: Check 'jload.log' and 'C:/Documents and Settings/administrator.ATRSAP/jload.java.log' for more information.</html>
    Actually we used a workaroud to complete the phase, ie we menually re-issued the command and changed the heap value from -Xmx512m to -Xmx1024m
    Is there a way to defalut the sapinst to pass to the java export command an higher java heap value, ie -Xmx1024m ?
    Thanks in advance and cheers.
    Franco.

    It sounds like you may have a corrupt render file in your 7th episode.  You can set in and out points in 5 minute increments and export those segments to narrow down which clip is the offending clip. Then re-render the offending clip.
    I hope this helps.

  • Cannot Upload Resources to P6 v7 - System out of Memory

    Hello,
    When I import resource assignments to P6 v7, I get an the following error message:
    "Your system is out of memory. Please close other running applications and try this operation again."
    I also noticed that the PM.exe file in Task Manager was consuming a huge amount of system memory, over 1 GB.
    After this error message, when I go back to my P6 schedule, I find that several activity durations have been zeroed out. I've never experienced this with earlier versions of P6. Has anyone encountered any of this before?
    Here's some more info about the schedule - It has 8600 activities, and 7000+ resource assignments.
    Thanks for your help!

    Ashish777 wrote:
    Jason,
    Thanks for your reply. I would have thought that 2GB of memory would me more than sufficient. Would increasing the memory to say 3GB or 4GB help? Incidentally, I did break down the spreadsheet into 7 "chunks" of about 1000 entries, and was able to successfully import the spreadsheet that way.
    Also what do you mean by API?
    Thanks again!It certainly won't hurt, but I doubt that 3/4gb even is going to allow you to import that many assignments in one shot with the method you are using; since P6 is a 32bit application, it cannot address that much memory.
    The api is the programmers interface. It would require knowledge of Java programming, however, if you are going to be doing this sort of thing a lot, it would pay for itself many times over in speed, ease of use, and avoiding any potential issues.

  • Named running out of memory during internet sharing

    From the logs on the system providing the connection;
    Nov 5 12:03:03 Macintosh named[59]: internal_send: 192.168.2.6#49197: Cannot allocate memory
    Nov 5 12:03:03 Macintosh named[59]: client 192.168.2.6#49197: error sending response: out of memory
    Nov 5 12:03:08 Macintosh natd[76]: failed to write packet back (Network is unreachable)
    Nov 5 12:03:18: --- last message repeated 1 time ---
    Nov 5 12:03:18 Macintosh named[59]: /SourceCache/bind9/bind9-24/bind9/lib/isc/unix/socket.c:1173: unexpected error:
    Nov 5 12:03:18 Macintosh named[59]: internal_send: 192.168.2.6#49197: Cannot allocate memory
    Nov 5 12:03:18 Macintosh named[59]: client 192.168.2.6#49197: error sending response: out of memory
    Nov 5 12:03:23 Macintosh natd[76]: failed to write packet back (Network is unreachable)
    This is a Leopard Macbook sharing it's Airport connection to a G5 desktop plugged in via ethernet running 10.4.10. This arrangement worked just fine before upgrading the laptop to Leopard. All updates have been run on both systems. Needless to say, the desktop is unable to connect. No errors on the 10.4.10 side.

    Still happens after upgrading the desktop to Leopard.

  • Decompressing LZMA .zip files always gives "System out of Memory" on AIR.

    AIR is supposed to support LZMA compression in addition to Deflate, but it has an error every time I try to use it. ZIPs using the Deflate method decompress just fine.
    aByteArray.uncompress("lzma");
    Should decompress the LZMA compressed data, but always just has a #1000 System is Out of Memory error.
    I have tried skipping the standard header in the zip that should be 2 bytes version info, extra properties length (n) and a filed of the length of n;
    Even when I do that, the same thing happens. I have tried deducting the LZMA header length from the general compressed data size in the ZIP header as well and that makes no difference. I am also above AIR 3.3 so that should not be the issue. I also tried setting a small 'library size' when compressing. LZMA is supposed to be "suited for embedded applications" so mobile devices should surly be able to handle it.
    The header with the 13 byte header i believe is only for certain stand alone LZMA formats, so that should not apply.
    What am I doing wrong? How do I make it work?

    No. I try and avoid cluttering my apps with extra libraries if at all possible. It may have a sizeable footprint when I only need a few things, and it might contain encryption stuff if it supports the whole zip specification, which makes your app banned from export to some countries apparently.
    I already have my app doing what I need it to do with the most common deflate method, but it simply would be a shame to not have LZMA support when it is built right into AIR. I would like to know what I'm doing wrong when I call uncompress with "lzma".

  • OUT OF MEMORY - during loading images (JPEG's)

    Hallo,
    We use the OHJ (version 4.1.12) inside a Java/Swing application with JDK 1.3.1.
    Our online help contains a lot of larger JPEG images. When the user navigates through the online help - an out of memory occurs while loading the images.
    I tried to split the help pages in a lot of small HTML pages, but this doesn't help. It seems that the OHJ does not clear the memory
    when loading the next HTML page.
    Can the OHJ deal with larger images ?
    Any other possibilities ?
    Thanks
    Markus Pohle

    >
    It seems that the OHJ does not clear the memory when loading the next HTML page.
    Can the OHJ deal with larger images ?
    We have never seen such a problem with large images and OHJ. Could you send us a ZIP containing your help content by e-mail to [email protected] so that we can try to reproduce it?
    Thanks,
    -brian

  • Error: out of memory during render

    Hi,
    I am attempting to write a non-self contained quicktime movie from a sequence in FCP 6.03. The sequence was originally edited in AIC 720p, then onlined to 8 bit uncompressed via the .m2v files.
    When rendering I receive an "error: out of memory" message.
    I am wondering what might have caused this, as I have not experienced it before. I have done a search within mac forums, but none of the threads I found seemed to address my specific issue.
    Any thoughts??
    Thanks,
    -Tom

    Onlined to 8 bit uncompressed SD? or HD?
    You likely have a corrupted media file involved. It's usually the same percentage in from the head of the sequence, as the failure is reported... i.e, the failure is reported after 50% complete? then look half way into your sequence, and re create or re capture that area of the sequence.
    Jerry

  • Out of Memory during recon

    I am running a initial recon on a DB (oracle 10g) which has over 150000 users, the server is going out of memory, so how do I solve this problem?
    Thanks

    Hi ,
    Running job in batch is really good idea ,but you need to evaluate if your resource/connector allow any kind of filter and if not then customization you want to do.
    If you have large memory and can;t use above option then you should use below option.(btw specifying 1gb of memory is not sufficient seeing no. of records.As one recon event invokes a series of calls ,your memory grow and gc will try to collect memory based on your algorithm ,but as you reach a point <1.2 gb> JVM fails ).
    You can check when your recon failed for memory usage and set your initial size to some higher value i.e. 1.5x and max to 2.1x.
    -Ankit

  • How to overcome a "System out of memory exception"?

    Hi,
    As i am running my program , I get (sometimes) an out of memory exception.
    I don't know exactly why because I am always doing the same thing so if I get this exception once It should always be so... (of course, as I am trying , no other program is running on my computer! ).
    anyway.
    I have 3 questions:
    1) Do you know how to eliminate this error ?
    (I don't mind if the time of execution is longer)
    2) I have Win XP, do you think that using a software to build ".exe" files can change the problem ? If so, have you heard about a simple 'one' (I downloaded JET Excelsior, but it seems rather complicated to parametrize)
    3) (last but not least) Can someone explain to me WHY there is this type of exception ( I would have thought that when "memory is full", then there is a swap, and the program doesn't stop !
    I know there is a lot of questions in one ! ( altough I tried to be short)
    Thanks

    In answer to your third question, the error occurs when
    the JVM runs out of memory, not the OS. Since the OS
    controls swapping the fact that the memory space
    assigned to the JVM is running low won't cause
    swapping to take place. The solution is either a) use
    less space by reducing what you have loaded at any
    given time or b) increase the amount of memory
    available to the JVM. You can user the -Xms, -Xmx and
    -Xss switches to increase the amount of memory
    available.
    Mark

  • Xi runing out of memory during Mapping runtime..

    Hi I have a a scenario where the a certian field in the source can result in multiple line items in the target... I saw that when the the line items increases to over 50,000 lines in the target I get thsi mapping exception -
    During the application mapping com/sap/xi/tf/_MM_Map1_2_ a com.sap.aii.utilxi.misc.api.BaseRuntimeException was thrown: RuntimeException in Message-Mapping transformatio~
    When I reduce the number of potential line items that can be generated then the mapping runs fine... this mapping has a lot of queue java functions. This leads me to believe that that the issue is related to a memory issue...
    How can i overcome this? Are there parameters that can be set to provide more system resources during mapping runtime.

    Hi Aravind,
    your input file is too large thats why you are getting that error.
    Asks your BASIS team to increase the java heap memory.
    Check this link
    Start java engine failure: how to increase space for object heap
    Regards
    Ramesh

  • System out of memory load ing large project

    Folks:
    I am opening a large solution in SSDT.  (Visual Studio 2013 - with Update 4 - 12.0.41025.0.)  The project contains a rather large OLTP solution.  In addition - we run focused data marts off of this common solution.  So - the solution
    contains 148 projects.
    When I attempt to open the solution - I get the below.  When I close the dialog, Visual Studio crashes.  I can never do anything productive.
    In Task manager - I see less the 50% memory used.  I have 16GB installed, < 8GB is being used when Visual Studio crashes.  So there must be an artificial limit some where.
    How do I get around this?
    Microsoft.Data.Tools.Schema.Sql.Build.SqlPackageException
    Exception of type 'System.OutOfMemoryException' was thrown.
       at Microsoft.Data.Tools.Schema.Sql.Build.SqlPackageContent.GetStream()
       at Microsoft.Data.Tools.Schema.SchemaModel.DataSchemaModel.ReadDataSchemaModelHeaderFromPackage(SqlPackage package, Boolean readCustomData)
       at Microsoft.VisualStudio.Data.Tools.Package.Internal.DatabaseProjectOrSqlSchemaFileReferenceNodeExtender.ReadHeaderData()
       at Microsoft.VisualStudio.Data.Tools.Package.Internal.DatabaseProjectOrSqlSchemaFileReferenceNodeExtender.TryReadHeaderData(Exception& ex)
       at Microsoft.VisualStudio.Data.Tools.Package.Project.Features.ProjectReferenceController.IsValidReferenceVerifySqlServerVersions(IDatabaseReferenceNode refNode, Boolean& canShowDefault, String& reason)
       at Microsoft.VisualStudio.Data.Tools.Package.Project.Features.ProjectReferenceController.IsValidReference(IDatabaseFileReferenceNode refNode, Boolean& canShowDefault, String& reason)
       at Microsoft.VisualStudio.Data.Tools.Package.Project.Features.ProjectReferenceController.IsValidReference(IDatabaseReferenceNode refNode, String& reason)
       at Microsoft.VisualStudio.Data.Tools.Package.Project.Features.ProjectReferenceController.GetReferenceData(IDatabaseReferenceNode referenceNode, CustomSchemaData& schemaData)
       at Microsoft.VisualStudio.Data.Tools.Package.Project.Features.FileManagerFeature.ProcessReferencesInQueue()
       at Microsoft.VisualStudio.Data.Tools.Package.Project.Features.FileManagerFeature.OnIdle()
       at Microsoft.VisualStudio.Data.Tools.Package.Project.DatabaseProjectNode.OnIdle()
       at Microsoft.VisualStudio.Data.Tools.Package.Project.SqlProjectIdleProcessingComponent.FDoIdle(UInt32 grfidlef)
    John

    Visual Studio is a 32 bit process so the most it could possibly use is 2GB.
    Honestly I have used visual studio for a while (since VB6/VC6 to VS .Net 2002 all the way to 2015) and it is a memory hog as it is, I really can't imagine what it is like to have 148 projects in the solution - it must be really slow. I guess you are using
    build configs to limit what you build each time or your build times alone will be painful!
    I really would look at splitting the solution down into smaller parts, I don't think you will have much luck until you do that.

  • System Out Of Memory

    I was able to create my virtual application but when I go to use the zenworks option to create a bundle in ZCM I get an error "An error occored while publishing the bundle: Exception of type 'System.OUtOfMemoryException' was thrown." I restarted the ZCM server but it did not fix the issue. Anyone else have this problem.

    Ok here is the mess I got out of zcc.log. The app I am trying to make is 1.07 G. It only seems to happen on applications that are large.
    Mar 2009 13:28:47 FrameworkAuthentica..64 :------------Index.java : session attributes removed---------
    16 Mar 2009 13:28:47 UploadedFileManage..509 :UploadedFileManager: Deleting file [/opt/novell/zenworks/share/tomcat/webapps/zenworks/images/appIcons/31694_795740433dff4bdc699391d98724ee78.png]
    16 Mar 2009 13:28:47 UploadedFileManage..509 :UploadedFileManager: Deleting file [/opt/novell/zenworks/share/tomcat/webapps/zenworks/images/appIcons/97731_81d558599eb33007ecfb12cf2f5b97cd.png]
    16 Mar 2009 13:28:47 UploadedFileManage..509 :UploadedFileManager: Deleting file [/opt/novell/zenworks/share/tomcat/webapps/zenworks/images/appIcons/12269_3f98d873571678b642ff3b79f7cdd2f0.png]
    16 Mar 2009 13:28:47 UploadedFileManage..509 :UploadedFileManager: Deleting file [/opt/novell/zenworks/share/tomcat/webapps/zenworks/images/appIcons/64471_8b54de4cbcaab169fef8e92fdcd3cdc6.png]
    16 Mar 2009 13:51:44 MessageUtil..........99 :Note: Make sure that you increment the version of this bundle in the Summary page or in the common tasks to ensure its delivery to assigned devices that already have this bundle.
    16 Mar 2009 13:52:23 MessageUtil..........99 :Note: Make sure that you increment the version of this bundle in the Summary page or in the common tasks to ensure its delivery to assigned devices that already have this bundle.
    16 Mar 2009 14:22:55 FrameworkAuthentica..59 :>>> Cleaning up session
    16 Mar 2009 14:22:55 FrameworkAuthentica..64 :------------Index.java : session attributes removed---------
    16 Mar 2009 14:22:55 UploadedFileManage..509 :UploadedFileManager: Deleting file [/opt/novell/zenworks/share/tomcat/webapps/zenworks/images/appIcons/41406_.png]
    16 Mar 2009 14:22:55 UploadedFileManage..509 :UploadedFileManager: Deleting file [/opt/novell/zenworks/share/tomcat/webapps/zenworks/images/appIcons/84836_e3d764a886a1e3c9faf4986a55cc24f6.png]
    16 Mar 2009 14:22:55 UploadedFileManage..509 :UploadedFileManager: Deleting file [/opt/novell/zenworks/share/tomcat/webapps/zenworks/images/appIcons/4bd85f93eb18f0e44f5fa603bed74d44.ico]
    16 Mar 2009 14:22:55 UploadedFileManage..509 :UploadedFileManager: Deleting file [/opt/novell/zenworks/share/tomcat/webapps/zenworks/images/appIcons/48914_046aaee55dd8be24d2388fed2c5075d0.png]
    16 Mar 2009 14:22:55 UploadedFileManage..509 :UploadedFileManager: Deleting file [/opt/novell/zenworks/share/tomcat/webapps/zenworks/images/appIcons/41406_.ico]
    16 Mar 2009 14:22:55 UploadedFileManage..503 :UploadedFileManager: Deleting directory [/var/tmp/0ffaa180f70341d4a7d9d83e68341f70]
    16 Mar 2009 14:22:55 UploadedFileManage..509 :UploadedFileManager: Deleting file [/opt/novell/zenworks/share/tomcat/webapps/zenworks/images/appIcons/50695_046aaee55dd8be24d2388fed2c5075d0.png]
    16 Mar 2009 14:22:55 UploadedFileManage..509 :UploadedFileManager: Deleting file [/opt/novell/zenworks/share/tomcat/webapps/zenworks/images/appIcons/43127_046aaee55dd8be24d2388fed2c5075d0.png]
    16 Mar 2009 14:22:55 FrameworkAuthentica..59 :>>> Cleaning up session
    16 Mar 2009 14:22:55 FrameworkAuthentica..64 :------------Index.java : session attributes removed---------
    16 Mar 2009 14:22:55 UploadedFileManage..509 :UploadedFileManager: Deleting file [/opt/novell/zenworks/share/tomcat/webapps/zenworks/images/appIcons/03251_730c0676e359b664457536741fbef398.png]
    16 Mar 2009 14:22:55 UploadedFileManage..509 :UploadedFileManager: Deleting file [/opt/novell/zenworks/share/tomcat/webapps/zenworks/images/appIcons/58781_81d558599eb33007ecfb12cf2f5b97cd.png]
    16 Mar 2009 14:22:55 UploadedFileManage..509 :UploadedFileManager: Deleting file [/opt/novell/zenworks/share/tomcat/webapps/zenworks/images/appIcons/04795_e3d764a886a1e3c9faf4986a55cc24f6.png]
    16 Mar 2009 14:22:55 UploadedFileManage..509 :UploadedFileManager: Deleting file [/opt/novell/zenworks/share/tomcat/webapps/zenworks/images/appIcons/11242_8b54de4cbcaab169fef8e92fdcd3cdc6.png]
    16 Mar 2009 14:22:55 UploadedFileManage..509 :UploadedFileManager: Deleting file [/opt/novell/zenworks/share/tomcat/webapps/zenworks/images/appIcons/77281_736005f4ba6c0a02f78510bde7dcdad4.png]
    16 Mar 2009 14:22:55 UploadedFileManage..509 :UploadedFileManager: Deleting file [/opt/novell/zenworks/share/tomcat/webapps/zenworks/images/appIcons/23962_730c0676e359b664457536741fbef398.png]
    16 Mar 2009 14:22:55 UploadedFileManage..509 :UploadedFileManager: Deleting file [/opt/novell/zenworks/share/tomcat/webapps/zenworks/images/appIcons/13694_f30c24bd81f4a05cad65a3797b2b84d9.png]
    16 Mar 2009 14:22:55 UploadedFileManage..509 :UploadedFileManager: Deleting file [/opt/novell/zenworks/share/tomcat/webapps/zenworks/images/appIcons/69431_0d7e165fdadd122d5fefa71a93945e74.png]
    16 Mar 2009 14:22:55 UploadedFileManage..509 :UploadedFileManager: Deleting file [/opt/novell/zenworks/share/tomcat/webapps/zenworks/images/appIcons/60539_736005f4ba6c0a02f78510bde7dcdad4.png]
    16 Mar 2009 14:22:55 UploadedFileManage..509 :UploadedFileManager: Deleting file [/opt/novell/zenworks/share/tomcat/webapps/zenworks/images/appIcons/73857_3f98d873571678b642ff3b79f7cdd2f0.png]
    16 Mar 2009 14:24:55 FrameworkAuthentica..59 :>>> Cleaning up session
    16 Mar 2009 14:24:55 FrameworkAuthentica..64 :------------Index.java : session attributes removed---------
    16 Mar 2009 14:49:32 RemoteControlDialo..982 :Entered the function addDropdownListElements
    16 Mar 2009 14:49:32 RemoteControlDialo..338 :initialize controls called
    16 Mar 2009 14:49:36 RemoteControlDialo..446 :Entered RightsValidator
    16 Mar 2009 14:49:36 RemoteControlDialo..472 :Rights authentication allowed
    16 Mar 2009 14:49:36 RemoteMgmtExtensio..343 :Inside rmPopup_close
    16 Mar 2009 14:49:36 Vncobject...........312 :VNCDEBUG : render method on zenvnc object invoked
    16 Mar 2009 14:49:36 Vncobject...........329 :VNCDEBUG : renderContents CALLED op:1
    16 Mar 2009 14:49:36 Vncobject...........353 :VNCDEBUG: Browser user agent :Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 2.0.50727; InfoPath.2)
    16 Mar 2009 14:49:36 Vncobject...........362 :VNCDEBUG: Browser is a supported browser
    16 Mar 2009 14:49:37 Vncobject...........658 :Locale of the zenworks system is English
    16 Mar 2009 14:49:37 Vncobject...........553 :VNCOBJECT:: cmd is : -pipe -zenrights -locale English -enabledbo -enablecaching
    16 Mar 2009 14:49:37 Vncobject...........564 :VNCOBJECT:: completeCMDLine = <PARAM NAME="cmdline" VALUE=' -pipe -zenrights -locale English -enabledbo -enablecaching 172.20.147.102~~5950
    16 Mar 2009 15:12:02 FrameworkAuthentica..59 :>>> Cleaning up session
    16 Mar 2009 15:12:02 FrameworkAuthentica..64 :------------Index.java : session attributes removed---------

  • Uploading large files from applet to servlet throws out of memory error

    I have a java applet that needs to upload files from a client machine
    to a web server using a servlet. the problem i am having is that in
    the current scheme, files larger than 17-20MB throw an out of memory
    error. is there any way we can get around this problem? i will post
    the client and server side code for reference.
    Client Side Code:
    import java.io.*;
    import java.net.*;
    // this class is a client that enables transfer of files from client
    // to server. This client connects to a servlet running on the server
    // and transmits the file.
    public class fileTransferClient
    private static final String FILENAME_HEADER = "fileName";
    private static final String FILELASTMOD_HEADER = "fileLastMod";
    // this method transfers the prescribed file to the server.
    // if the destination directory is "", it transfers the file to
    "d:\\".
    //11-21-02 Changes : This method now has a new parameter that
    references the item
    //that is being transferred in the import list.
    public static String transferFile(String srcFileName, String
    destFileName,
    String destDir, int itemID)
    if (destDir.equals(""))
    destDir = "E:\\FTP\\incoming\\";
    // get the fully qualified filename and the mere filename.
    String fqfn = srcFileName;
    String fname =
    fqfn.substring(fqfn.lastIndexOf(File.separator)+1);
    try
    //importTable importer = jbInit.getImportTable();
    // create the file to be uploaded and a connection to
    servlet.
    File fileToUpload = new File(fqfn);
    long fileSize = fileToUpload.length();
    // get last mod of this file.
    // The last mod is sent to the servlet as a header.
    long lastMod = fileToUpload.lastModified();
    String strLastMod = String.valueOf(lastMod);
    URL serverURL = new URL(webadminApplet.strServletURL);
    URLConnection serverCon = serverURL.openConnection();
    // a bunch of connection setup related things.
    serverCon.setDoInput(true);
    serverCon.setDoOutput(true);
    // Don't use a cached version of URL connection.
    serverCon.setUseCaches (false);
    serverCon.setDefaultUseCaches (false);
    // set headers and their values.
    serverCon.setRequestProperty("Content-Type",
    "application/octet-stream");
    serverCon.setRequestProperty("Content-Length",
    Long.toString(fileToUpload.length()));
    serverCon.setRequestProperty(FILENAME_HEADER, destDir +
    destFileName);
    serverCon.setRequestProperty(FILELASTMOD_HEADER, strLastMod);
    if (webadminApplet.DEBUG) System.out.println("Connection with
    FTP server established");
    // create file stream and write stream to write file data.
    FileInputStream fis = new FileInputStream(fileToUpload);
    OutputStream os = serverCon.getOutputStream();
    try
    // transfer the file in 4K chunks.
    byte[] buffer = new byte[4096];
    long byteCnt = 0;
    //long percent = 0;
    int newPercent = 0;
    int oldPercent = 0;
    while (true)
    int bytes = fis.read(buffer);
    byteCnt += bytes;
    //11-21-02 :
    //If itemID is greater than -1 this is an import file
    transfer
    //otherwise this is a header graphic file transfer.
    if (itemID > -1)
    newPercent = (int) ((double) byteCnt/ (double)
    fileSize * 100.0);
    int diff = newPercent - oldPercent;
    if (newPercent == 0 || diff >= 20)
    oldPercent = newPercent;
    jbInit.getImportTable().displayFileTransferStatus
    (itemID,
    newPercent);
    if (bytes < 0) break;
    os.write(buffer, 0, bytes);
    os.flush();
    if (webadminApplet.DEBUG) System.out.println("No of bytes
    sent: " + byteCnt);
    finally
    // close related streams.
    os.close();
    fis.close();
    if (webadminApplet.DEBUG) System.out.println("File
    Transmission complete");
    // find out what the servlet has got to say in response.
    BufferedReader reader = new BufferedReader(
    new
    InputStreamReader(serverCon.getInputStream()));
    try
    String line;
    while ((line = reader.readLine()) != null)
    if (webadminApplet.DEBUG) System.out.println(line);
    finally
    // close the reader stream from servlet.
    reader.close();
    } // end of the big try block.
    catch (Exception e)
    System.out.println("Exception during file transfer:\n" + e);
    e.printStackTrace();
    return("FTP failed. See Java Console for Errors.");
    } // end of catch block.
    return("File: " + fname + " successfully transferred.");
    } // end of method transferFile().
    } // end of class fileTransferClient
    Server side code:
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.util.*;
    import java.net.*;
    // This servlet class acts as an FTP server to enable transfer of
    files
    // from client side.
    public class FtpServerServlet extends HttpServlet
    String ftpDir = "D:\\pub\\FTP\\";
    private static final String FILENAME_HEADER = "fileName";
    private static final String FILELASTMOD_HEADER = "fileLastMod";
    public void doGet(HttpServletRequest req, HttpServletResponse resp)
    throws ServletException,
    IOException
    doPost(req, resp);
    public void doPost(HttpServletRequest req, HttpServletResponse
    resp)
    throws ServletException,
    IOException
    // ### for now enable overwrite by default.
    boolean overwrite = true;
    // get the fileName for this transmission.
    String fileName = req.getHeader(FILENAME_HEADER);
    // also get the last mod of this file.
    String strLastMod = req.getHeader(FILELASTMOD_HEADER);
    String message = "Filename: " + fileName + " saved
    successfully.";
    int status = HttpServletResponse.SC_OK;
    System.out.println("fileName from client: " + fileName);
    // if filename is not specified, complain.
    if (fileName == null)
    message = "Filename not specified";
    status = HttpServletResponse.SC_INTERNAL_SERVER_ERROR;
    else
    // open the file stream for the file about to be transferred.
    File uploadedFile = new File(fileName);
    // check if file already exists - and overwrite if necessary.
    if (uploadedFile.exists())
    if (overwrite)
    // delete the file.
    uploadedFile.delete();
    // ensure the directory is writable - and a new file may be
    created.
    if (!uploadedFile.createNewFile())
    message = "Unable to create file on server. FTP failed.";
    status = HttpServletResponse.SC_INTERNAL_SERVER_ERROR;
    else
    // get the necessary streams for file creation.
    FileOutputStream fos = new FileOutputStream(uploadedFile);
    InputStream is = req.getInputStream();
    try
    // create a buffer. 4K!
    byte[] buffer = new byte[4096];
    // read from input stream and write to file stream.
    int byteCnt = 0;
    while (true)
    int bytes = is.read(buffer);
    if (bytes < 0) break;
    byteCnt += bytes;
    // System.out.println(buffer);
    fos.write(buffer, 0, bytes);
    // flush the stream.
    fos.flush();
    } // end of try block.
    finally
    is.close();
    fos.close();
    // set last mod date for this file.
    uploadedFile.setLastModified((new
    Long(strLastMod)).longValue());
    } // end of finally block.
    } // end - the new file may be created on server.
    } // end - we have a valid filename.
    // set response headers.
    resp.setContentType("text/plain");
    resp.setStatus(status);
    if (status != HttpServletResponse.SC_OK)
    getServletContext().log("ERROR: " + message);
    // get output stream.
    PrintWriter out = resp.getWriter();
    out.println(message);
    } // end of doPost().
    } // end of class FtpServerServlet

    OK - the problem you describe is definitely what's giving you grief.
    The workaround is to use a socket connection and send your own request headers, with the content length filled in. You may have to multi-part mime encode the stream on its way out as well (I'm not about that...).
    You can use the following:
    http://porsche.cis.udel.edu:8080/cis479/lectures/slides-04/slide-02.html
    on your server to get a feel for the format that the request headers need to take.
    - Kevin
    I get the out of Memory Error on the client side. I
    was told that this might be a bug in the URLConnection
    class implementation that basically it wont know the
    content length until all the data has been written to
    the output stream, so it uses an in memory buffer to
    store the data which basically causes memory issues..
    do you think there might be a workaround of any kind..
    or maybe a way that the buffer might be flushed after
    a certain size of file has been uploaded.. ?? do you
    have any ideas?

Maybe you are looking for