Custom ClassLoader - trying to use different version of SNMP library than WebLogic Server 8.1 uses

Problem: my J2EE ear file uses the AdventNet third-party library to do
SNMP work. WebLogic Server 8.1 also uses this AdventNet third-party
library to do its own SNMP work. The problem is the version used by
WebLogic 8.1 is older than the version I use, so my code tries to run
and finds the wrong version of the library that WebLogic 8.1 has supplied.
Possible solution: I plan to have a custom classloader (derived from
java.lang.ClassLoader) that gets hooked in to my threads using
Thread.setContextClassLoader(). This custom classloader would look for
the AdventNet library jars in a spot I specify so it would find the
correct ones. Since I want to change the usual classloader behavior of
"look in parent classloaders first, then child classloader" to "look in
child classloader first, then in parent classloaders" I can't just
override ClassLoader.findClass(). I, at a minimum, have to override
ClassLoader.loadClass() to look in my classloader first. I have
questions about this:
1. What other methods do I have to override? For example, which of the
resource-related methods do I need to override so that resources are
searched for first in my classloader then in parent classloaders?
2. I was thinking of using a URLClassLoader as a helper to my
classloader, invoking its method(s) from my custom classloader's
method(s) to actually load the classes from URLs that are not on the
standard classpath. I was planning to set it up with a custom parent
classloader that can't find anything, so that the helper URLClassLoader
would only ever find classes/resources in the URLs I provide to it. Does
this approach make sense? Have you seen anything like this done before?
3. Is there any way around this problem besides a custom ClassLoader? A
buggy custom ClassLoader would have problems which AFAIK would be
difficult to track down as ClassLoader problems.
Thanks in advance for any help you can provide.

Alvin wrote:
Hi,
I am experiencing the same problme and
even I tried to put the AdventNet jar files
before weblogic.jar I still cannot get it
to work
Would you help me out here.
Thanks,
-AlvinI finally figured out a way to do it using a custom classloader that
looked in the directory where I kept the version of AdventNet I wanted
before looking in the normal places classloaders look.
How it works is I hook two classloaders at the bottom of the chain of
classloaders. My custom BlockingClassLoader is hooked as a child of the
normal chain of classloaders, then a URLClassLoader is hooked under
that. The BlockingClassLoader's findClass method checks if the class
starts with a package prefix I want to control (like "com.adventnet.").
If it does, then it acts like it can't find the class. This makes its
child, the URLClassLoader, try to find the class. The URLClassLoader
is given the URL of places to look for classes that match the directory
I keep the version of AdventNet I want in. When I load a class, I
directly tell the URLClassLoader to load it so that it is loaded as I want.
There's more to it than this. I had to override some other methods in
my BlockingClassLoader and do some other stuff. I'm not sure if I can
share the source code, as it was developed on company time and thus is
owned by the company. Feel free to ask questions though.
I haven't tried this solution very long (basically just unit tested it)
but it looks promising.

Similar Messages

  • Different versions of a library on the server

    Hi,
    is it possible to have different versions of the same library on the server?
    The reason for this is that we have some utility classes which should be deployed on the server as a library (because they are used by many projects). But the different versions of the utility classes are not necessarily compatible, which means that some projects still need to reference the old versions of the utility classes.
    Or is the only solution in this case to inculde a jar-file with the utility classes in every project and thus not referencing a library at all?
    Kind regards.
    Achim

    Hi Achim,
    No, it's not possible to have different versions of the same library (or any other type of component) on the server. You can also have a look at Two versions of a JAR library.
    Best regards,
    Vladimir

  • Installing different versions of Oracle on the same server

    We have a client that is currently on Oracle version 9.2.0.3. There is a project beginning that will have them upgrading to either 10g or 11g(still tbd). The project will have this happening in different steps. Therefore, we will need to continue to have the 9.2.03 db up and available while certain accounts are being migrated to the newer version.
    Question is - can you install 2 versions of Oracle on the same server without any issues?
    Or would we be better off purchasing a separate server to install 10g or 11g.

    Depending on the OS certification you should be able to run both. You'll probably have to patch up the OS though. One of my servers has 3 different Oracle homes (9.2.0.5 - 10.2.0.2).
    You can check the certification by clicking on the certify tab in metalink.

  • BUG: Entering a "version" when deploying to a WebLogic server doesn't work

    By default when deploying to a weblogic server the "Version" is set to v2.0. If you change that to something like v2.1 when the application is deployed, the deployment logs still show the Version=2.0. What needs to be done to get the Version in deployment to accept the changes on the deployment form?

    Sorry, I wasn't clear. This is a Portal application deployed using MDS. So it doesn't have the file referenced in that blog post. The Version field I'm referring to is on the form that pops up to set the MDS repository. For reasons unknown it will always come up v2.0 even during the first deployment. Regardless of what I change it to the Version always equals 2.0 in the deployment logs.

  • Custom classloader fails when using Java Web Start

    Hope you can help me with a problem that is driving me nuts. I have implemented my own classloader to support plugins. This classloader works as follows:
    1. The classloader is configured to access a plugin components jar file downloaded by jws.
    2. The plugin components jar file contains other jar files which contains the actual plugin code to be loaded using my own classloader.
    3. Upon initialization - my classloader extracts all jar files contained in the plugin components jar file into temporary files.
    4. These temporary files are used by my classloader when defining plugin classes.
    The classloader works fine when not using java web start. Then I launch the application using java web start with security policy in .jnlp file set to:
    <security>
    <all-permissions/>
    </security>
    After a while (it was able to load some of the classes) it fails with the following stack-trace:
    Regards,
    Terje
    java.security.AccessControlException: access denied (java.io.FilePermission C:\DOCUME~1\TEOES\LOCALS~1\Temp\activity61102.jar read)
         at java.security.AccessControlContext.checkPermission(Unknown Source)
         at java.security.AccessController.checkPermission(Unknown Source)
         at java.lang.SecurityManager.checkPermission(Unknown Source)
         at java.lang.SecurityManager.checkRead(Unknown Source)
         at java.util.zip.ZipFile.<init>(Unknown Source)
         at java.util.jar.JarFile.<init>(Unknown Source)
         at java.util.jar.JarFile.<init>(Unknown Source)
         at my.plugin.ActivityClassLoader.getJarFileEntry(ActivityClassLoader.java:258)
         at my.plugin.ActivityClassLoader.search(ActivityClassLoader.java:244)
         at my.plugin.ActivityClassLoader.loadClass(ActivityClassLoader.java:99)
         at java.lang.ClassLoader.loadClass(Unknown Source)
         at java.lang.ClassLoader.loadClassInternal(Unknown Source)
    Does anyone have source code for implementing a simple class loader that can be used with Java Web Start (preferrably with all jar files to be used by the classloader wrapped into a jar file)

    If you implement your own classloader, and then still run with a SecurityManager installed, then your ClossLoader is responsible for asigning the permissions to the code it loads.
    You need your ClassLoader to extend SecureClassLoader, and implement the method :
    SecureClassLoader.getPermissions(CodeSource cs) to return the PermissionCollection you want.
    /Andy

  • Is it possible to run 2 programs that need different versions of a library?

    Hi,
    I have the following situation.
    Tomcat 5.0 Server.
    Program A is running on server, and needs axis 1.1 as a library.
    Program B is running on the same server, and needs axis 1.4 as a library.
    Axis 1.1 and 1.4 are not backwards compatible... if I just put 1.1 on it.. program B won't work.. If I just put 1.4 on it, program A won't work.
    Tomncat doesn't seem to like having the same jar loaded in twice.
    How do I make this all work? I really don't want to have to try to manually convert a large application from using 1.1 to 1.4 or vice versa, want to try to make them both work...
    Edited by: TunaBoo on Jan 10, 2008 10:00 PM

    No.

  • How to setup a different user/group  menu language than the server?

    Hi,
    I want to keep my server environment (menus) in English. The users use Spanish and French. Is it possible to do in Work group manager?
    thanks

    Self answered....
    User Language when first log in = Default installation Language of the workstation

  • Trying to update iTunes, the installer keeps freezing at 'Running iTunes Installer Scripts'.  i've tried several different versions of iTunes and can't install any of them.  I'm stuck with Version 4!!  Help!

    I'm trying to update iTunes on my mac (Power Mac G5 running tiger), but it always freezes at 'Running itunes installer script'.  I have tried a few different versions of iTunes, but I have the same problem with all of them.  I'm stuck on version 4 (which came with my os discs)!  Help?! 

    Ok, First this link should solve the windows scripting host error. I used "Download windows script host" in a google search and it was the first hyperlink.
    http://www.microsoft.com/downloads/details.aspx?FamilyId=C717D943-7E4B-4622-86EB -95A22B832CAA&displaylang=en
    I'm assuming you are trying to run the installer from apple. What I would suggest is you download the installer manually to your desktop then launch the installer. If try to run the installer over the intertubes you may run into a problem like you did.
    Then I would uninstall itunes 8 and any software associated with it like the apple update software, quicktime, apple mobile device support. However uninstalling itunes should remove any additional software it installs. Then clean out your temp folder:
    6. Clean out your temp folders,
    a. C:\windows\temp (if one exists)
    b. C:\Documents and Settings\{username}\Local Settings\Temp
    Sometimes installers will pick up old files or won’t delete their temporary files.
    Then with a newly download installer on your desktop try launching it. Let me know if that helps.
    Here is an apple doc that help.
    http://support.apple.com/kb/TS1331
    Message was edited by: CoJeff

  • Gantt chart- How to change the color of time bars of different versions

    Hi All,
    My Client wants to see all changes in planning schedule. I made different versions of these changes but he also want to see all these changes in gantt chart and in different colors. I tried to change the color in planning board assistant but in this screen (CJ27/ CJ2B). we cannot view all versions together. And if I use CN41, there I cannot change the colors of time bars.
    Secondly, we can change colors of times bars of basic dates, forecast dates and actual dates but there is no provision to change the colors of schedule bars of different project versions. Kindly reply-
    1. How to see all project versions in CJ27 or How to customise bar chart in cn41 or if we change in SPRO, then how to change graphic profile in project info profile
    2. How to change colors of different time bars of different versions.
    3. How to mention these legends (meaning of each color in chart) at footer of gantt chart (in print outs)
    Please Help.
    Thanks & Regards
    Dinesh Chauhan

    Thanks,
    actually I've created new project planning board profile where planning board assistant is customized but unable to use this profile in CN41. we can change PS info profile in CN41 and that;s why I thought that planning board profile may be assigned somewhere in PS info profile so that changes in planning board assistant will be applied in CN41 through PS info profile. Graphic profile is too complex to understand and not sure if it will help to get colored time bars of projct versions in gantt chart. Still not clear.
    Secondly not able to see all versions (snap shots) in gantt chart with different colors of time bars.
    I mean planning board screen can be customized but we cannt see different versions here which are possible in CN41, but we cannt customize the gantt chart (time bars) in CN41. Pls help.
    Thx & Regards
    Dinesh Chauhan

  • Converting All Files to Different Version

    Is there a much quicker and happier way to convert my entire project to a different version of LabVIEW other than opening every single one of the 2000+ files?  I've considered perhaps creating a VI to do this.  Use VI Server to just open each .VI, save it, then close it.  This would then hopefully include every single .ctl, yes?  Thoughts, suggestions?
    Remember, code does exactly what you tell it.

    It is not entirely clear what you want. To convert to the current version, try masscompiling.
    To convert to an earlier version, the "save for previous" menu entry is available in the project window. No need to open any VIs.
    LabVIEW Champion . Do more with less code and in less time .

  • Symbol pollution between two versions of a library

    I am having problems with a library that is calling a function defined within itself from a different version of the library.
    My company has a core library (let's call it libcore) that handles abstracting across platforms a number of common, low-level functions. At some point in our history, we decided to start supporting Unicode for a toolkit used by third party developers. To accomplish this, we took our old library, redefined uses of char * to a custom string type and conditionally compiled the library to create a version that took in char *'s and a version that took in wchar_t *'s.
    So, we have libcoreA.so and libcoreU.so. Our third party app loads the Unicode version of our library which dynamically loads a list of file format libraries which all depend on the Ascii version of our library. In this process, the file format libraries call a string copy function from libcoreA which is supposed to call a string length function from libcoreA.
    However, in the call stack for a crash, we see:
    [1] custom_strlen (from libcoreU) <-- Bad symbol! No biscuit!
    [2] custom_strdup (from libcoreA)
    [3] file_format_lib_setup (from file format library)
    [4] init_format_list (from libcoreU)
    [5] get_list_of_formats (from application)
    All of these libraries are compiled with "-Bgroup -z defs" to avoid confusion. Usually, when we leave this out, it doesn't even run or it makes a mistake during a call from one library into another, but I've never seen this happen before with the Ascii lib trying to call a function within itself.
    The top level application isn't compiled with "-Bgroup -z defs" because it can't be. (It's a MainWin compiled COM app and is always going to be missing mainwin_init. I don't even want to go there.) However, in the past, this has never caused a problem. The application links with libcoreU and then later dynamically loads and initializes libcoreA on its own. The obvious question is, "What have you changed?" Unfortunately, I don't know what has changed that could cause this.
    Any suggestions? This problem is driving me mad because I can't figure out a way to debug it. Applications that load either the Ascii OR the Unicode libs don't have problems. Applications that load both suddenly do with this release.

    You know, I think it sometimes takes making a fool of yourself publicly to finally catch your errors. I have a problem in my make file that was making the Ascii version of the library compile without "-Bgroup -z defs".
    Ignore this thread.

  • Weblogic Server Advantage version

    Hi All,
    I am planning to upgrade weblogic server (Base) Advantage version 6.1 SP4 to Weblogic Server Advantage 8.1 non production.
    I tried logging the upgrade through the support site.
    The site provided us upgrade option as
    Lic, WLS Base v8.1
    I would like to know if there is a difference between
    WLS Base v8.1
    and
    Weblogic Server Advantage 8.1 non production.
    Thanks for your support.

    Hi Deena
    1. Always go with the latest version of Weblogic Portal which is currently 10.3.2.
    2. There may be many internal bug fixes from older versions that got fixed in 10.3.2. If you download or user older versions, you may need to apply all Patches for exsiting bugs. So go with latest.
    3. One major difference is, latest WLP 10.3.2 uses full fledged 100% Eclipse IDE. So you are now using more standard/universal IDE. Earlier versions had BEA Customized eclipse kind of IDE we usually call Workshop. But latest uses full Eclipse IDE. Since it is Eclipse, you can add any 3rd party reusable plugins for this IDE like db explorer etc.
    4. One other thing is older version of WLP used default Embedded LDAP for all security roles, policies stuff. But latest WLP 10.3.2, used RDBMS database to store all this stuff.
    Bottom line, go with the latest version of WLP and you can avoid any upgrades also for some time.
    Thanks
    Ravi Jegga

  • How can I distribute an application using Reprot generation Toolkit for MS Office for different versions of MS Office?

    I want to create an application which uses the Report Generation Toolkit for Microsoft Office. The office version of the target machine depends on what my customer has installed.
    From several discussions I have seen that the installer detects which version I have on my development machine. I'm not able to hold three or four machines with different versions (97,2000,2002,XP).
    I decided to do the following software architecture:
    I create a LLB MakeReport.llb with a VI called MakeReport.vi. With VI server I will start MakeReport.vi in MakeReport.llb. Over a named queue I will send a command from my application to MakeReport.vi. Then the report will be
    printed.
    I will create this LLB by saving MakeReport.vi with File>>Save with options...>>Application distribution. All neccessary VIs will be in the LLB.
    I will hold different directories for each version. I can create different version of the LLB. During installation of my application the LLB for the right version will be copied from the CD to the application folder.
    I know I will be restricted in testing my report in only one version and hoping it will be good in the other versions.
    I think that the difference lays only in the word and excel related llbs.
    1. Will my software architecture work or is it obviously wrong?
    2. How will I get all versions from the toolkit CD?
    3. Which is the registry key I must read to get the right version (a minor question, if somebody knows I do not need to search for myself).
    Waldemar
    Waldemar
    Using 7.1.1, 8.5.1, 8.6.1, 2009 on XP and RT
    Don't forget to give Kudos to good answers and/or questions

    Lookout saves the files in .csv form which can be opened in Excel. I did make some progress by using the "append table to report" vi which allowed me to put values into an array and then those values were entered into my template on my report vi.
    Where I am stuck now is I want to be able to put values into my template from a .csv file, not from an array I have to manually put numbers in.
    Once those values are in my template I want to pull summed values from the template and place them into a final excel file for printing.
    I have attached examples of the files I am working with to help you better understand what I am trying to do.
    I hope that makes sense.
    Jason Phillips
    Attachments:
    HourlyTotalsTemplate.xls ‏120 KB
    eb_rain_gauge_ss.csv ‏23 KB
    EastBankHourlyRainReport.xls ‏28 KB

  • How to use two different versions of the same jar within one project

    Hi everybody!
    I have a big problem while integrating different web service clients within one bigger java project. Both implemetations need some jar files to work but demand different version. So, i would like to know if there is any way to tell which implementation should use which version! Anyhow i add those jars to the classpath makes working only one or the other webservice working but never both! Any ideas somebody?
    Best regrads,
    Stefan G�tz

    Of course do have the jar files different names but the classes inside of them are the same ... means that the standard system classloader can distinguish them. When you add a jar to a classpath the name actually dosent matter.... any other ideas, please?
    PD.: i tryed to add a manifest file to the one jar which makes use of one of the dublicated jars to specify which jar to take direcly but it makes no difference since once classes loaded they cant be distinguish ....see:
    http://java.sun.com/docs/books/tutorial/ext/basics/load.html

  • Can cells set to custom format appear differently on different versions of MS OFFICE?

    I'm currently involved in a data enrichment project where we convert some financial data for our clients in excel. We've been facing a problem with date formats in the reports sent to us by the client. 
    We're supposed to enter 4 different dates in separate columns with 3 different formats. For example in one column the date format should appear in the dd/mm/yyyy format and in another as dd-mm-yyyy. What we've done is set all these cells to CUSTOM format
    and in the TYPE dialog in the Custom Tab typed "dd\/mm\/yyyy" where we need the date to appear as dd/mm/yyyy and "dd-mm-yyyy" where we need the date to appear as dd-mm-yyyy. 
    However, the client says that when he downloads the file on his computer he sees the date formats set to DATE and not CUSTOM. Is this possible?
    Can a cell set to CUSTOM FORMAT appear differently on a different version of MS OFFICE?
    Does the Operating System also have a role to play in this?
    For example if we've typed our data in OFFICE 2007 on a system with XP as the OS, will it not open as CUSTOM when we open it in OFFICE 2010 with Windows 7 as the OS?
    We need serious help on this as this confusion has put our project in jeopardy. 

    Thanks for the help Jim. Just to make it clearer we haven't used quotation marks in the date formats. Further, we were told to use back slash by the client cause according to them this would help in keeping the date formats as fixed to custom format on any
    computer that the file is opened on.
    What I'm trying to figure out is that if a cell is set to a custom format, can it appear differently when opened on a different computer?
    We've sent the file using Sendspace.com to our clients and when we download the file and open it on any version of MS Office we still see the custom formats in the date fileds. However, the client insists that it appears differently on their computers. 
    Is it possible for a cell set to a custom format to not appear as custom on a different computer?
    Just to remind you again that we've downloaded the file on almost every version of Office and have noticed no change in the formats set by our team. How then is it possible that the dates doesn't appear as custom formats on their system?
    I would really appreciate if you could help me solve this situation.

Maybe you are looking for

  • Best set up for Keynote with host projectors.

    I'm a presenter that's made the switch from PowerPoint /PC to Keynote. Heading out on the road for the first time with my MacBook / Keynote presentation and facing 8 different host projectors. I don't expect to find many DVI projectors. But I'm bring

  • Record not updating into table helpme

    in the following functionmodule record is not commiting into table is there any wrong please hep me. FUNCTION Z_MZPR_DETAILS. ""Local Interface: *"  IMPORTING *"     VALUE(ZPRHEADER) TYPE  BAPIMEREQHEADER OPTIONAL *"     VALUE(ZPRHEADERX) TYPE  BAPIM

  • Windows 7 Screenshots while in Bootcamp...

    How can you take a screenshot of your desktop while booted in Windows 7? There's no print screen button in my Macbook Pro keyboard.

  • Integrate UltraSearch in HTMLDB page

    I would like to use the Ultra Search query form within a page in HTMLDB, but I am not sure how to do this. I imagine creating a page with a text box and a button like in the demo query application and call a function (getResult?) in the wksys schema,

  • Why do I get "Service Unavailable" when trying to access web sites?

    I get "Service Unavailable" with any site I try to access