To the Tomcat classloader experts outthere !!

Hi,
I currently work on a Tomcat application and it's classloader is not destroyed when the application is reloaded using the manager. (or ant)
I profile my application, and each time it is reloaded, it creates an additionnal classloader. Which leads to out of memory errors.
I suspect that my Persistence Framework (Versant OpenAccess JDO) is causing this problem. The loaders are filled with instances of cache object, identity objects and other JDO stuff.
Is there from a web application to force the destruction of a class loader on context destroyed?
Thank you

you can't force destruction of a classlaoder just like that. the classloader will go away once all of classes it manages get gc'ed.
Now consider this:
<tomcat>/common/lib
versant_jdo.jar
<tomcat>/webapps/
YourApp/
So if you reload your app, but Versant still holds references to classes loaded by the old YourApp classloader, what should happen to those references if you obliterate the classes?

Similar Messages

  • Whenever I start the tomcat server, Im getting an error in netbeans?

    Whenever I start the tomcat server, Im getting an error in netbeans?
    Starting of Tomcat failed. '127.0.0.1' is not recognized as an internal or external command, operable program or batch file.
    Even I set the path & catalina_home in Environment variables. I start the startup.bat file and catalina.bat file also.
    I'm waiting for your quick response.

    Hi Ershad,
    I think this issue is more related to Apache Tomacat, I would suggest you ask in Apache Tomcat forum for a better support, it is appropriate and more experts will assist you.
    Best Regards,
    Jambor
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • JAXB 2.1 API loaded from the bootstrap classloader, but it needs 2.2 API

    I am trying to deploy a Java web service into a Tomcat 5.5.20 server. I have the web service packaged in a .war file in Tomcat's webapps directory, and I can see that the .war file gets extracted when I start Tomcat.
    However, I get the following error when I start Tomcat:
    Apr 22, 2012 5:16:31 AM com.sun.xml.ws.transport.http.servlet.WSServletContextLstener contextInitialized
    INFO: WSSERVLET12: JAX-WS context listener initializing
    Apr 22, 2012 5:16:31 AM com.sun.xml.ws.transport.http.servlet.WSServletContextLstener parseAdaptersAndCreateDelegate
    SEVERE: WSSERVLET11: failed to parse runtime descriptor: java.lang.LinkageError: JAXB 2.1 API is being loaded from the bootstrap classloader, but this RI (from jar:file:/home/username/WebNMS/apache/tomcat/webapps/WebServices/WEB-INF/lib/jaxb-impl.jar!/com/sun/xml/bind/v2/model/impl/ModelBuilder.class) needs 2.2 API. Use the endorsed directory mechanism to place jaxb-api.jar in the bootstrap classloader. (See http://java.sun.com/j2se/1.6.0/docs/guide/standards/)
    java.lang.LinkageError: JAXB 2.1 API is being loaded from the bootstrap classloader, but this RI (from jar:file:/home/username/WebNMS/apache/tomcat/webapps/WebServices/WEB-INF/lib/jaxb-impl.jar!/com/sun/xml/bind/v2/model/impl/ModelBuilder.class) needs 2.2 API. Use the endorsed directory mechanism to place jaxb-api.jar in the bootstrap classloader. (See http://java.sun.com/j2se/1.6.0/docs/guide/standards/)
    at com.sun.xml.bind.v2.model.impl.ModelBuilder.(ModelBuilder.java:178)
    In the /home/username/WebNMS/apache/tomcat/webapps/WebServices/WEB-INF/lib directory is where all the jar files from JAX-WS 2.2.6 are, including jaxb-api.jar.
    I already added "-Djava.endorsed.dirs=/home/username/WebNMS/apache/tomcat/webapps/WebServices/WEB-INF/lib" to the command that starts the WebNMS process that starts Tomcat, but that didn't help.
    Also, I tried adding a symbolic link called "endorsed" in the /home/username/WebNMS/jre/lib directory that points to /home/username/WebNMS/apache/tomcat/webapps/WebServices/WEB-INF/lib, and that didn't help either.
    One interesting thing is that when I do a "find /home/username/WebNMS -name jaxb-api.jar", it only finds the one jaxb-api.jar in the /home/username/WebNMS/apache/tomcat/webapps/WebServices/WEB-INF/lib directory. There are no other jaxb-api.jar files. So I don't know why the error is saying that the JAXB 2.1 API is being loaded, when there's only the JAXB 2.2.6 API jar file. Unless it's finding something outside the /home/username/WebNMS dir, but that shouldn't happen considering I tried 2 different ways to set up the endorsed dir.
    Edited by: sljava on Apr 26, 2012 4:10 PM

    This seems to be the answer: https://jaxb.dev.java.net/guide/Migrating_JAXB_2_0_applications_to_JavaSE_6.html#Using_JAXB_2_1_with_JavaSE_6
    Place the 2.1 jaxb-api.jar into $JRE_HOME/lib/endorsed. This essentially makes your JRE to "JRE 6 + JAXB 2.1". This won't affect any other applications that use this JRE, and it's easy. On the other hand, in various scenarios you may not be able to alter the JRE.

  • Stumped:  NPE being thrown in Tomcat Classloader

    All,
    This problem has been vexing me all morning. We have two identically set-up Unix boxes (well, probably not identically set-up as you will see). There is identical code running on both (this I can guarantee). Whenever, we view some JSP's on one box, we get the following exception:
    java.lang.NullPointerException at org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:179)
    org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:131)
    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:141
    Now, the same JSP works totally fine on the other box. Both JSP's compiled and produced identical class files. I did a lot of Google searching, and most of the pages refered to SecurityManager errors.
    Both machines are running Tomcat 4.1. I verified that java.policy and security.policy are identical on both machines. I also verified that catalina.policy and all the Tomcat startup scripts are the same. Finally, all environment variables match and the JDK versions are the same.
    I'm at the end of my sane reasoning process. At some point, I'll just start chucking servers that don't work off the second floor. Any one have any idea what might be causing this (and ideally how to fix it)?
    Many thanks in advance,
    Saish

    No ideas wht could cause this, but here are the
    standard troubleshooting ideas.
    Does this happen with all JSPs or just one in
    particular? - ie is it something in the code or
    something in the Tomcat setup?Happens to multiple JSP's, but not all JSP's. It happens to the same JSP's every time though.
    I would try just with a minimal "Hello World" JSP.
    If that works, start building up the JSP bit by bit
    until it breaks.
    I'm not sure, but we recently added weblogic-client.jar to our application's WEB-INF/lib directory. There were one or two posts mentioning that RMI clients that override or set SecurityManager may cause issues with Tomcat's class loader. (That's my leading theory). But if that were the case, why would the two boxes exhibit different behavior?
    Here is my current theory about the class loader. The class loader uses the native O/S to get a listing of JAR and CLASS files within WEB-INF. (Assumption). So, could the O/S return the files in different order? Meaning that for one application a given JAR is found before another JAR with the same method signature but on the other server, the reverse is true.
    What version(s) of Tomcat are you working with
    exactly?
    4.1.27. On a Solaris box.
    If you do end up chucking the server out the window,
    will you let us know how high it bounces? I always
    wanted to find out for myself ;-)I'm hoping it scatters more than it bounces. :^)
    - Saish

  • I want to write in a XML file which is located on the TOMCAT server

    hello all,
    can anybody tell me or give me code snippet for writing some data through my application i.e from client side on te file which is located on the TOMCAT server(especially XML file).
    tell me how can i do that?
    it is urgent
    cya
    sush

    Hello sush,,,,
    I am sending you some API / classes that will definetely help you for writing XML file through java.
    1) TransformerFactory.newInstance();
    2)Transformer serializer
    3)StreamResult
    4)serializer.transform(source,result);
    5)DOMSource
    From Vikas_khengare
    [ [email protected] ]

  • Troublesho​oting issues using the BlackBerry Virtual Expert

    Posted originally on the Inside BlackBerry Help Blog
    Does your BlackBerry need a health assessment? Are you considering a repair? If so, check out the BlackBerry Virtual Expert (BBVE), a simple, self-guided diagnostic app for BlackBerry smartphones.
    Depending on what type of smartphone you are using, you can run tests to help identify if an issue is occurring and get recommendations on how to solve the problem.
    To help you get started with BBVE, here’s a quick overview of how to use this app and what to do if a tests fails.
    How to use the BlackBerry Virtual Expert
    If you are using BlackBerry 10 OS version 10.2.1, BlackBerry Virtual Expert is built in and can be found by opening the Help app followed by tapping Testing along the bottom toolbar. Within this screen, tap Try this now to open BBVE.
    For smartphones running BlackBerry OS version 10.2 or earlier, or BlackBerry OS version 7.1 and earlier, to use BBVE you need to install it first.
    To do this, open BlackBerry World on your smartphone and search for “BlackBerry Virtual Expert,” or use the following steps to scan a barcode. After installation is complete, look for the BBVE icon that appears on your home screen.
    Open BlackBerry World.
    Complete one of the following:
    If your smartphone is running BlackBerry 10 OS, swipe down from the top of the screen and tapScan Barcode.
    If your smartphone is running BlackBerry OS version 7.1 or earlier, press the Menu key followed by Scan a Barcode.
    Scan the following barcode and tap Download.
    After opening the BBVE, the Health tab appears by default which allows you to identify basic details about your smartphone and quickly access specific settings.
    If you select Tests along the bottom toolbar, you can run all of the available tests at once or test a specific feature. To test everything at once, tap All Tests or select a specific feature or function you’d like to test.
    If you have concerns about your headphone jack for example, select Audio Test to run a variety of audio-related tests, or optionally select Choose A Test followed by tapping on the specific test you’d like to run.
    When you start testing a feature, follow the instructions displayed on your smartphone and complete the required actions followed by recording a result: Pass , Skip , or Fail . When all of the selected tests are completed you are shown your results indicating what passed, what tests were skipped, and of course, any tests that may have failed.
    One of the BBVE tests failed! Help!
    Should a test fail while using BBVE, after reviewing the suggestions on the Results tab, here are a few things you can do to help get an issue resolved efficiently.
    Step 1 – Summarize the issue
    Creating a summary of the issue you are encountering and recording what troubleshooting steps you have already taken is a great step that helps our support teams better assist you. In addition to creating a summary, obtain your BlackBerry smartphone details using the steps below.
    If you are using a BlackBerry 10 smartphone, to identify your OS version, tap Settings > About and in theCategory drop-down list, select OS. To identify your PIN, tap Settings > About and in the Category drop-down list, select Hardware.
    If you are using a BlackBerry OS smartphone, check out this post for help identifying this information.
    Step 2 – Back up your device
    When you contact support for a potential repair issue, they will guide you through this process, so doing this before you contact support can help speed things along.
    If you are using a BlackBerry 10 smartphone, download and install BlackBerry Link for PC or Mac so you can back up your smartphone. For help backing up and restoring your smartphone data, please review the BlackBerry Link User Guide for PC or Mac.
    If you are using a BlackBerry OS device, download BlackBerry Desktop Software to back up your smartphone. For help backing up and restoring your data, review the BlackBerry Desktop Software user guide (PC, Mac).
    Step 3 – Use self-service support options
    Join the BlackBerry Support Community Forums and create a new post about your issue. Be sure to include the summary you created in step 1 because this allows community members to suggest alternative steps that may help resolve the issue you are encountering.
    Review and search the BlackBerry Knowledge Base for a support article that may provide a solution to the issue you are encountering.
    Step 4 – Contact your service provider or visit a BlackBerry Expert Center
    If you are still unable to resolve the issue, consider contacting your service provider or BlackBerry Expert Center for additional assistance. As mentioned earlier, having your smartphone details and a summary of troubleshooting performed will help out whoever is assisting you with the issue.
    For help contacting your service provider, search using your favorite browser for your service provider’s support website.
    Depending on where you are located, you may have the option of visiting a BlackBerry Expert Center. For help finding a BlackBerry Expert Center near you, check out the following link: Find help at a BlackBerry Expert Center.
    Frequently asked questions
    Why does BlackBerry Virtual Expert need permission X, Y & Z?
    For BBVE to perform specific tests, select permissions must be enabled the first time you open BBVE. You can optionally disable some or all permissions but keep in mind any tests requiring disabled permissions will not work. If you run a test that requires a specific permission such as the ability to use the camera, you will receive a notification to update your permission settings.
    What tests does BBVE include?
    Depending on which type of BlackBerry model you are using, available tests include:
    Touch Screen
    Display
    USB Port
    Main Keypad
    Keyboard
    Side keys
    Slider
    Cameras
    Camera Flash
    Receiver Speaker
    Loudspeaker
    Stereo Loudspeaker
    Stereo Headset
    Microphone
    Vibrator Bluetooth
    Status LED
    Gyroscope
    Accelerometer
    Orientation Sensors
    HDMI Connector
    USB Connector
    SIM Card Connector
    SD Card Connector
    Wireless Charger
    GPS hardware
    Light Sensor
    Proximity Sensor
    Wi-Fi
    Where can I learn more about BlackBerry Virtual Expert?
    If you are using a BlackBerry 10 smartphone, check out our web-based training for an interactive overview of how to use this application or use the Help app on your smartphone and search for “BlackBerry Virtual Expert.”
    Did someone help you? Click Like! Did a post solve your issue? Click Accept as Solution!
    Follow me on Twitter or Google+ and subscribe to the Inside BlackBerry Help Blog

    this should be floated aka stickied
    Click here to Backup the data on your BlackBerry Device! It's important, and FREE!
    Click "Accept as Solution" if your problem is solved. To give thanks, click thumbs up
    Click to search the Knowledge Base at BTSC and click to Read The Fabulous Manuals
    BESAdmin's, please make a signature with your BES environment info.
    SIM Free BlackBerry Unlocking FAQ
    Follow me on Twitter @knottyrope
    Want to thank me? Buy my KnottyRope App here
    BES 12 and BES 5.0.4 with Exchange 2010 and SQL 2012 Hyper V

  • Sum of a sum when using Top N in the Group Sort Expert

    Hi All,
    I have a small problem I can't quite seem to work out.
    I have a report where each line is for a particular Product, and is a summation of the Sales for that Product over several Locations. When you click on the line, it shows the breakdown of Sales over each Location.
    I use the Group Sort Expert to display the Top N results, where the 'N" is set in a formula to a parameter passed in to the report, so the user can select the top 5,10,50 etc. Products across all Locations.
    At the bottom of the report, I want to have a sum of a column of Sales $. I need that sum to only be a sum of the Top N records selected.
    Since each line is a summation of the all the products for the Locations, what I need is a sum of that sum for the Top N, but Crystal will not let you add the sum of a sum, so I'm not sure how to accomplish this.
    If I just do a sum of the underlying values I get a total for all the Products, regardless of the Top N.
    Hope that makes some sense !
    Many Thanks
    Paul

    Hi Sastry,
    I tried your suggestion, thanks, but I don't think it's the answer. For a start Crystal will not let me do that, it pops up a message box when I try to run the report "A running total cannot refer to a print time formula. Details: Record Number". I also added the record number field next to the lines in the report to see what the result would be, and I don't think it would work anyway.
    Here is an example using Units sold:
    Product Name--LocationUnits Sold--Record Number
    Product A -<All Stores>----8
    Store A--1--
    1
    Store B--3--
    2
    Store C--4--
    3
    Product B--<All Stores>--3      
    Store A--2--
    4
    Store B--1--
    5
    Product C--<All Stores>--
    1
    Store A--1--
    6
    Note that only the bold lines are shown in the report,. If you click on the bold line, then the breakdown of the stores is shown. For the above example, I am showing the Top 2 units across all stores (so Product C is not shown at all), but there are actually 5 records, so if I used a formula where RecordNumber <=N, where in this case N=2, I would get a total units sold of 1 + 3 (records 1 and 2) which is incorrect.
    I will have more of a think on this and see if I can find a solution, in the mean time, any other suggestions ? Is there some wya of checking if the line is visible maybe ?
    Thanks for your time !
    Paul

  • Opening an attachment from outside the tomcat context

    I am creating a simple mail software. In my incoming message screen i'm showing all the Attachments as hyperlinks. I want that when the user clicks the hyperlink the Attachment should open in a new browser window.
    My problem is that the attachments are there in a folder outside the tomcat context i.e. in a folder outside the tomcat's folder on the server's c:/Attachments folder.
    If I put the attachments in the root folder of my application under webapps folder it is working properly. But I want to open it from the outside folder c:/Attachments, and also I can't hardcode this path in my code. It can be any path outside tomcat.
    Please help me, if u have any solution.

    Make that path a parameter in web.xml
         <context-param>     
              <param-name>beginyear</param-name>
              <param-value>2004</param-value>          
              <description>starting year of the application</description>
         </context-param>

  • Need the opinion of experts: N85 with Bluetooth pr...

    Really need the opinion of experts on this one.
    My N85 was swapped after the complaint that the Music Library Menu opened automatically after pairing with bluetooth of the car (permanent failure). Another complaint was that video recording was defective (intermittent failure). Also, Nokia detected great consumption of battery.
    My question is: the swap came back the same relating to the bluetooth problem.. Is this a case of bad repair or a case of low knowledge...? I'm wondering if the Music Library Menu is to open when pairing with car bluetooth (strangely)....

    The Dell Precision 380 has 3 PCIe slots: a x16 (for video cards), a x1,
    and a x4.  I'm sure there are other PCs on the market with
    multiple PCIe slots.
    Alternatively, the PCIe-8362 has TWO cabled PCI Express links.  So
    you only need one slot in your host PC.  This may not be the best
    solution, however, if bandwidth is your primary concern.  With one
    8362 connected to two chassis, the total maximum throughput is 160
    MB/s.  With two 8361s (each connected to a different chassis), the
    total maximum throughput is 220 MB/s (110 MB/s on each).
    Finally, keep in mind that the PXI chassis in your system are still
    running at PCI speeds (132 MB/s).  Plus, this bandwidth is shared
    across all devices in the system.  So the MXI Express connection
    to the chassis may not be the bottleneck in the system.
    Good luck!

  • Image will not change on the Browser...Saving on the Tomcat Problem...HELP

    Hi,
    I worte a Servlet project using JBuilder 7 and TOmcat 4. THis is basically what i am doing...
    I am getting an image from database and saving it to a folder in tomcat and then displaying it on a browser.
    This application is used by multiple users...
    I am saving the Image in Tom-cat...C:\JBuilder7\jakarta-tomcat-4.0.3\webapps\examples\Image1.jpeg
    I am also displaying the image from that folder. The problem is when i run the application,
    I am seeing the same Image on the screen..Its creating the different Image file, but the image is the same.
    If i do a refresh on the page then it displays the new saved Image...
    Also, If i save the image on my local and then display it from my local it changes the images as I
    click on a Image list...
    Following is how it works when i save it and display it from my local, but if i run my application from
    another computer i am not able to see any of the images....Because its on my local.
         fos = new FileOutputStream("C:/Image1.jpeg");
         <img src="file:///C|/Image1.jpeg" height="855" name="myimage" align="middle" style="position:absolute;">;
    And this is how i am doing when i am saving to the tomcat....I am able to display it on another computer
    but would not change the image...
    fos = new FileOutputStream("../webapps/examples/Image1.jpeg");
    <img src="../Image1.jpeg" height="855" name="myimage" align="middle" style="position:absolute;">;
    Can some one please tell me what could be the Problem....
    Any help will be greatly appreciated....Thanks...

    The browser caches images so that it doesn't have to always download the same image for different pages.
    You could:
    1: Save the new image with a different name and dynamically change the name in the html.
    2: Try setting the response headers to prevent the browser from caching the images.
    response.setHeader("Pragma", "no-cache");
    response.setHeader("Cache-Control", "no-cache");
    response.setDateHeader("Expires", 0);

  • How to use toplink in the tomcat server?

    Hi,
    I want to use Toplink in the tomcat server. I am connecting to oracle database using DataSource.
    Can any body help me, what are the setup required to use the toplink in the tomcat?
    Please help me if any body has idea on the same.

    Take a look at this other forum posting: Tomcat acquire dataSource [TOPLINK-7060]
    --Shaun                                                                                                                                                                                                                               

  • Which path is the localhost for the tomcat

    hi,
    if i type http://localhost:8080/
    then which path will it access
    i have the tomcat in the directory called
    d:\jakarta-tomcat-4.1.12\
    please help me
    from
    darshan soni

    if you can see the index.jsp page, you have the response else, look your user config file (/conf/tomcat-users.xml) :
    If you're seeing this page via a web browser, it means you've setup Tomcat successfully. Congratulations!
    As you may have guessed by now, this is the default Tomcat home page. It can be found on the local filesystem at:
    $CATALINA_HOME/webapps/ROOT/index.html
    where "$CATALINA_HOME" is the root of the Tomcat installation directory. If you're seeing this page, and you don't think you should be, then either you're either a user who has arrived at new installation of Tomcat, or you're an administrator who hasn't got his/her setup quite right. Providing the latter is the case, please refer to the Tomcat Documentation for more detailed setup and administration information than is found in the INSTALL file.
    NOTE: For security reasons, using the administration webapp is restricted to users with role "admin". The manager webapp is restricted to users with role "manager". Users are defined in $CATALINA_HOME/conf/tomcat-users.xml.
    Included with this release are a host of sample Servlets and JSPs (with associated source code), extensive documentation (including the Servlet 2.3 and JSP 1.2 API JavaDoc), and an introductory guide to developing web applications.
    Tomcat mailing lists are available at the Jakarta project web site:
    [email protected] for general questions related to configuring and using Tomcat
    [email protected] for developers working on Tomcat
    Thanks for using Tomcat!

  • How to redirect the tomcat to my project folder!

    instead of putting all the files inside of the <tomcat>/webapps/<myfolder>
    I try to move the <myfolder> to another directory.
    say, /home/<myname>/<myfolder>
    so that, i can work in my home directory by /<hostname>:<port>/<myfolder>
    what procedures i should take ?

    In the server.xml file:
    <!-- Tomcat myApp Context -->
    <Context path="/Kiosk" docBase="c:\myApp" reloadable="true" debug="0">
    </Context>
    Not sure about the format of the docBase string.

  • Is it possible to unload a class thru the standard Classloader

    is it possible to unload a class thru the standard Classloader,
    I mean during runtime..

    If you want do unload any class then create separate custom class loader and load it with it.
    When you don't need anymore that package you can simply set your custom class loader to null and the next time GC is invoked it may free the memory.
    If you want to free it right after you don't need that package anymore you should call System.gc() twice -
    this usually works.

  • [svn:bz-trunk] 20680: Tomcat 7 Login Module work, due to the Tomcat 7 Security framework change we need to work out the security integration piece for tomcat 7 .

    Revision: 20680
    Revision: 20680
    Author:   [email protected]
    Date:     2011-03-08 08:23:30 -0800 (Tue, 08 Mar 2011)
    Log Message:
    Tomcat 7 Login Module work, due to the Tomcat 7 Security framework change we need to work out the security integration piece for tomcat 7. So far the ValveBase and tomcat Realm had API changes which will impact on the Login integration with Tomcat 7
    Modified Paths:
        blazeds/trunk/modules/opt/build.xml
    Added Paths:
        blazeds/trunk/modules/opt/lib/catalina-708.jar
        blazeds/trunk/modules/opt/src/tomcat/flex/messaging/security/TomcatValve708.java

    Revision: 20680
    Revision: 20680
    Author:   [email protected]
    Date:     2011-03-08 08:23:30 -0800 (Tue, 08 Mar 2011)
    Log Message:
    Tomcat 7 Login Module work, due to the Tomcat 7 Security framework change we need to work out the security integration piece for tomcat 7. So far the ValveBase and tomcat Realm had API changes which will impact on the Login integration with Tomcat 7
    Modified Paths:
        blazeds/trunk/modules/opt/build.xml
    Added Paths:
        blazeds/trunk/modules/opt/lib/catalina-708.jar
        blazeds/trunk/modules/opt/src/tomcat/flex/messaging/security/TomcatValve708.java

Maybe you are looking for