ObjInpStrm.latestUserDefinedLoader() + custom Classloaders = ClassNtFoundEx

Hi Team,
i am developing one application it uses *"platonos plugin engine"*.
server
*|*
------  plugin 1
------  plugin 2
basically server accepts plugins, install them and manage their lifecycle.
plugin register their service classes to server
Note : service classes loaded by plugin class loader
server loaded by system default class loader
when any request come to server server identifies proper plugin class from registry and call method of plugin 
before calling it is doing
Thread.currentThread().setContextClassLoader(pluginClassLoader);
this works better for non custom objects. like standard JRE objects (Int, Long,String etc..)
now my one plugin have one custom serialized object
which visible in plugin class loader.
but when it used Java *ObjectInputStream to deserialize*
protected Class<?> resolveClass(ObjectStreamClass desc)
throws IOException, ClassNotFoundException
   return Class.forName(name, false, latestUserDefinedLoader());
latestUserDefinedLoader() return server class loader (IN DEBUG VIEW)
which causes class not found exception.
actually it should use plugin class loader
but this same scenario works properly in tomcat with different classloaders.
i am surprised how tomcat able to change behaviour of latestUserDefinedLoader()
do i need to change classloader for some security or permission or something else pls help ???
awaiting for ur reply !!!!

Similar Messages

  • How do i use classloaders to create singletons

    I have some code that correctly creates a singleton because the code runs within a clients vm , and there should only be instance of the class per user. But for testing purposes I would like to mimic two users, to do this they each require their own instance of the singleton. I have read that using custom classloaders there could be one instance of each singleton per classloader, but dont understand how to do this. Can someone give me an example

    As I understand it you are simulating what amounts to
    a number of instances running in separate JVMs
    (probably on different machines) by running multiple
    instances in the same JVM. The natural way to do this
    would be to start multiple threads, each representing
    the action of one of these clients. (To do it
    sequentially would be a very poor test, since you
    need to cope with multiple, simultaneous
    activities).Yes, correct
    >
    The use of ThreadLocal enables you to have a separate
    instance of the "singleton" class for each thread.
    Any calls to the getInstance() method in the class
    made within one of the threads will return the
    details of the user "logged in" on that thread.
    Ok,fine but Ive simplified the use case there are a number of singletons involved (most of which are not called directly by the test code but by each other) , all of these would have to be identified and modified.
    InheritableThreadLocal extends this by passing the
    same instance to any child threads formed in one of
    these threads after initially intanciating an
    instance in a Thread (quite possibly uneccessary).Not needed, (thanks for explaining it though)
    And you can, if you wish, leave this in in the
    production version providing you do the login in the
    root thread of the client JVM.
    We do not want to allow the client to do such things.
    This, I have to say, would be a vastly less messy
    solution (and a much milder distortion between test
    and production) than anything based on ClassLoaders
    could possibly provide. Using custom class loaders
    quickly gets very messy indeed.
    I was hoping that by having two threads, each defining their own instance of a classloader it would get round the singleton behaviour and this is the only problem I am trying to solve. Obviously this would not be desirable in production but if it solves my testing problem Ill be happy, whether or not this is possible I still cant ascertain.
    If you have existing code you aren't allowed to
    change, then the best solution is probabllly to run
    multiple JVMs, exactly as in the real live case.We are using junit and taking advantage of its reporting facilities,ant integration and so on. If I was to have two JVMs I would have to split my test into two coorporating tests that would have to run in parallel but as far as Junit was concerned were two seperate tests, I can see this causing problems with reporting and causing side effects on other tests if something failed. Im aware that I am not really writing 'unit' tests in the strict test but the Junit framework provides advantages over plain old java.

  • Jar files not in WEB-INF/lib (custom ClassLoader?)

    I need to use classes in my JSP that do not come from a JAR file in the standard location. Sounds like I "simply" need to extend the ClassLoader used by the app server for loading the JSP. Is there any way of doing that?
    Example: my.jsp
    <h1>Hi</h1>
    <%
    FOO x = new FOO(); // code from a non-standard place
    ClassLoader cl = getClass().getClassLoader();
    %>
    I cannot put FOO.class into WEB-INF/lib or any of the standard places. Ideally I'd like to give the ClassLoader (cl above) a different (custom) parent ClassLoader which would know how to resolve FOO.class.
    I've poured over docs and Google and WebSphere and the Tomcat source code. Is this request of mine really so outrageous? I'm about the give up. What good are custom classloaders if one can't use them?

    You are essentially making the argument "All that Java
    needs is a URLClassLoader, and no one has any need for
    any custom ClassLoaders". (After all, that's all that
    I seem to have in a JSP context, with a list of
    hard-coded URLs into that URLClassLoader ...)
    Do a Google search on "custom ClassLoader" and you
    will find lots of reasons why people want to have
    custom ClassLoaders, such as ones that don't use any
    JAR or .class files ... which would qualify as why I
    can't put them into a certain place ...To be fair to duffymo, that is not how I read his argument. I read it as:
    "Sometimes we try to do things the hard way. If we sit back and rethink the problem, an easier solution might come about."
    I think this is a good opportunity to explain why you can not use the normal class loader heirarchy. You have no JARs and no .class files? Then where are you getting the class definitions? If you explain enough so that we might understand the problem:
    1) we might be able to come up with a solution or
    2) you might see a different approach before you are even done explaining
    #2 has happened to me more times then I can count. I sit down formulating a question for the forums, make sure I include enough detail to explain my problem. And by the time I am done I have a new (usually simpler) approach to solving the problem.
    Or you could sit and defend your first approach without providing any context and accomplish nothing. So its up to you.

  • Importing classes into JSP page

    Hi There,
    I am new to this and here is my problem.
    I am doing a shopping cart tutorial and trying to get a JSP page to import two classes :
    <%@ page language="java" contentType="text/html"
    import="ShoppingBasket,Product"
    errorPage="errorpage.jsp" %>
    I get :
    C:\jakarta-tomcat-4.1.30\work\Standalone\localhost\_\shop_0002dbasket_jsp.java:7: '.' expected
    import ShoppingBasket;
    ^
    C:\jakarta-tomcat-4.1.30\work\Standalone\localhost\_\shop_0002dbasket_jsp.java:8: '.' expected
    import Product;
    ^
    C:\jakarta-tomcat-4.1.30\work\Standalone\localhost\_\shop_0002dbasket_jsp.java:50: cannot resolve symbol
    symbol : class ShoppingBasket
    location: class org.apache.jsp.shop_0002dbasket_jsp
    ShoppingBasket basket = null;
    The classes compile ok . I read that instead of comma seperating the classes it might be better to put them in a package but I do not know the correct syntax or where to put the package if this is correct.
    The tutorial is from this book and the shopping cart source code is here.
    http://www.ineasysteps.com/books/?1840781971
    Any help appreciated
    Jim Ascroft

    A little beginners explanation of classpaths and packages is in order here. A package works like an extension of the name to keep class names unique. For example, if you have a ShoppingBasket.class and you want to use my ShoppingBasket.class along with it the two class names must be unique or different from one another in some way. Yours could be in com.yourcompany package and mine could be in org.mycompany package. When you reference you Shopping backet in your code you would use com.yourcompany.ShoppingBasket and when you reference mine in the same code you would use or.mycompany..ShoppingBasket. Shorthand for the class can be used by adding an import at the top of the referencing java file. An import is like saying "hay compiler, whenever you see ShoppingBasket look for it in the com.mycompany package!" That brings us to the next point. The package name must always be reflected in the directory structure of the .class file location in order to be found. Your shopping basket must be stored under the directory com/yourcompany if it is in package com.yourcompany. That directory structure should extend off of a classpath entry in order to be made available to the JVM. Classpath entries point to folders, jar or zip files that contain packaged and unpackaged classes. So If you have a classpath entry that points to C:\jakarta-tomcat-4.1.30\webapps\ROOT\WEB-INF\classes then all unpackaged classes (classes compiled from a .java file without a package statement) will be pulled directly out of this folder. Also, packaged classes will be pulled out of they're packaging directory structure, which should be located in this folder. You can have as many classpath entries as you want but the classes will be pulled out of the first entry that they can be found under. Now with a web app you don't normally fuss with the setting of classpaths since they are already predefined and configured for you. You just need to know to put all of your class files under the WEB-INF/classes directory in the root of your web app. You do, however, still need to know how they work. You also should know that any jar files should be placed in the lib folder of your web app and not under the classes folder.
    Getting back to your immediate problem, why are you getting class not found errors? Well this stems from what was said above. To fix these kind of problems follow these steps:
    1st off, find out exactly which .java file the .class file was compiled from. (This can be a problem in some environments where multiple copies of source hang around.) This step may involve a recompile and paying close attention to the compiler arguments. In an IDE there should be a setting or dialog that lets you find out exactly where it's placing the .class files created from you source.
    Next, determine what package the .class file should be in by examining (and maybe changing) the package statement at the top. For example, if you intended to put ShoppingBasket in the com.bloodoo package make sure it has a package "com.bloodoo;" statement at the top.
    Next recompile the .java source and move the packaging directory structure into the classes folder of your app. (This would be WEB-INF/classes under the root of the web-app.) For example if ShoppingBasket.class was compiled into the com/bloodoo folder under C:\Program Files\YourIDE\projects\yourproject\output then copy the com folder out of the output folder and into the WEB-INF\classes folder.
    Next examine the calling code (JSP or servlet .java code) and make sure it references the problem class out of the right package. For example, yourpage.jsp should reference the class com.bloodoo.ShoppingBasket and not ShoppingBasket if the shopping basket is deployed in package com/bloodoo. This gets tricky with jsp usebean tags because the desire is to use shorthand but I'm not sure if that works with the use bean tag. Make any modifications and recompile if necessary.
    Lastly, as a rule of thumb avoid wild-card imports (eg. import com.package.*) because they are a common cause of confusion especially when refactoring package names and resolving these kind of issues.Those steps should allow you to resolve 85-90% of your class not found issues. The other 10-15% are rare cases involving the use of custom classloaders, the Java extension mechanism and/or classpath trickery. If you still have questions/problems post back.
    Cliff

  • Placing class files for servlets in j2ee

    i am new to java servlets. i recently installed j2ee v1.4 sdk. i have gotten my first file that imports packages to compile. i now need a path to place .class files and .jar files. everyone says web-inf/classes and web/lib. due to the directory structure paths are so long. can someone give me the right path in j2ee v1.4 (C:\Sun\Appserver) to place these .class files and .jar files. if there is anything else i need to do before i can run a servlet, please inform me. i just want to run this silly helloWorld servlet. any suggestions would be greatly appreciated.

    Hi rickjamesb_tch,
    What you have heard is correct - you need to place your class files in the WEB-INF's classes directory (or jar files in the lib directory).
    To give you a little background, J2EE servers use custom ClassLoaders (a set of Java Classes that actually load the class into the JVM). The top-level class loaders has classes that are accessible through the JVM (and are usually picked up from the classpath).
    The other class loaders load classes that are only accessible within a particular web (or enterprise) application. These classloaders pick classes from the WEB-INF directory. These classloaders also have the capability of dynamically re-loading classes (eg when you change your .jsp file). Finally, the classes loaded are only visible within the web-application so that they do not pollute the global namespace.
    Hope that helps.
    Of course, the J2EE specification goes into a lot of depth about class loading, but unless you are designing an application server, you need not understand those details and specifics - just understanding where to place your classes is enough.

  • Issue with java_g and -debug

    Is there an issue with the -debug option when running Weblogic 4.51 with
    the java_g command.
    Each time we include the -debug option we experience
    weblogic.common.LicenseCorruptException (s)
    The same error is experienced using java 1.1.7 on NT, Solaris(x86)2.7
    and Solaris (Sparc)2.7
    We are very keen to find out if there is a way of resolving this to
    allow us to do remote debugging.
    regards
    Duncan Alexander

    For some reason, using the custom classloaders in WLS causes unpredictable VM
    behavior in those VMs. For instance, you point out the LicenseCorruptError which
    occurs due to a io read error which doesn't occur when the same environment is
    run in non remote mode.
    There are some things you can do.
    First of all, use 1.2.2 instead of 1.1.7. That VM appears more stable.
    If you have to use 1.1.7 then:
    On NT, make sure you've updated to the 1.1.7_005.
    On Solaris 2.7, run the server in static mode. (You may also try 1.1.7_008, I
    haven't had a chance to check that version yet.)
    I don't know about Solaris x86.
    The VM problem occurs when using custom classloaders so run the server in static
    mode. You won't be able to hot deploy ejbs, but you will be able to remotely
    debug.
    Debuggers don't work well with custom classloaders anyway, especially on 1.1.7.
    Gets a little better on 1.2.2 but there's still holes in the JDI in this area.
    To run in static mode don't use weblogic.class.path, everything goes on the
    classpath. Make sure that /weblogic/classes/boot appears before
    /weblogic/classes.
    Also add -Dweblogic.system.disableWeblogicClassPath=true=true if you're using
    5.1.0.
    Dana Jeffries
    BEA Systems
    Duncan Alexander wrote:
    >
    Is there an issue with the -debug option when running Weblogic 4.51 with
    the java_g command.
    Each time we include the -debug option we experience
    weblogic.common.LicenseCorruptException (s)
    The same error is experienced using java 1.1.7 on NT, Solaris(x86)2.7
    and Solaris (Sparc)2.7
    We are very keen to find out if there is a way of resolving this to
    allow us to do remote debugging.
    regards
    Duncan Alexander

  • Issue with java_g and -debug (Response would be appreciated this time).

    Is there an issue with the -debug option when running Weblogic 4.51 with
    the java_g command.
    Each time we include the -debug option we experience
    weblogic.common.LicenseCorruptException (s)
    The same error is experienced using java 1.1.7 on NT, Solaris(x86)2.7
    and Solaris (Sparc)2.7
    We are very keen to find out if there is a way of resolving this to
    allow us to do remote debugging.
    regards
    Duncan Alexander

    For some reason, using the custom classloaders in WLS causes unpredictable VM
    behavior in those VMs. For instance, you point out the LicenseCorruptError which
    occurs due to a io read error which doesn't occur when the same environment is
    run in non remote mode.
    There are some things you can do.
    First of all, use 1.2.2 instead of 1.1.7. That VM appears more stable.
    If you have to use 1.1.7 then:
    On NT, make sure you've updated to the 1.1.7_005.
    On Solaris 2.7, run the server in static mode. (You may also try 1.1.7_008, I
    haven't had a chance to check that version yet.)
    I don't know about Solaris x86.
    The VM problem occurs when using custom classloaders so run the server in static
    mode. You won't be able to hot deploy ejbs, but you will be able to remotely
    debug.
    Debuggers don't work well with custom classloaders anyway, especially on 1.1.7.
    Gets a little better on 1.2.2 but there's still holes in the JDI in this area.
    To run in static mode don't use weblogic.class.path, everything goes on the
    classpath. Make sure that /weblogic/classes/boot appears before
    /weblogic/classes.
    Also add -Dweblogic.system.disableWeblogicClassPath=true=true if you're using
    5.1.0.
    Dana Jeffries
    BEA Systems
    Duncan Alexander wrote:
    >
    Is there an issue with the -debug option when running Weblogic 4.51 with
    the java_g command.
    Each time we include the -debug option we experience
    weblogic.common.LicenseCorruptException (s)
    The same error is experienced using java 1.1.7 on NT, Solaris(x86)2.7
    and Solaris (Sparc)2.7
    We are very keen to find out if there is a way of resolving this to
    allow us to do remote debugging.
    regards
    Duncan Alexander

  • How to diagnose increase in permanent generation?

    Hello,
    My team is observing the following problem which is important to us and that we
    did not yet manage to identify:
    We observe from the gc traces (see extracts below) that the permanent memory
    size keeps increasing slowly (to the point were an java.lang.OutOfMemoryError is
    thrown) but the -verbose:class traces do not show anymore class loading after
    the system "warmup" phase. This was observed using Sun's JDK version 1.4.1.01.04 on
    HPUX, with the following JVM options java -verbose:gc
    -Xverbosegc:file=/tmp/gc.log -XX:+PrintGCDetails -XX:+PrintGCTimeStamps
    -XX:+PrintHeapAtGC -Xms256M -Xmx256M -XX:NewSize=16M
    -XX:MaxNewSize=16M -XX:SurvivorRatio=2 -XX:+UseConcMarkSweepGC
    I would need help to answer the following questions:
    1- what other actions than class loading could possibly explain an increase of
    used space in the permanent generation? The GC FAQ says "The permanent
    generation is used to hold reflective of the VM itself such as class objects and
    method objects". Could use of JNI also affect this space?
    2- how can I configure or instrument the JVM 1.4.1 to track cause of increase of
    used space in the permanent generation? The program we are testing uses 500 MB
    RAM and we often lack physical space on the server to make use of standard
    profiler tools such as JProbe or -hprof standard JVM option: HPUX JVM complains
    about insufficient MAXDSIZE kernel parameters that is already set to 512 MB, and
    plenty swap space is available)
    3- In which version are the "-XX:+TraceClassloading and
    -XX:+TraceClassUnloading" options supported? I read from
    http://java.sun.com/docs/hotspot/gc1.4.2/faq.html that the options
    "-XX:+TraceClassloading and -XX:+TraceClassUnloading" should trace class
    loading, however they don't seem available under JDK 1.4.1 on Windows, and they
    are not either documented in the toolsdocs for JDK 1.4.2
    4- What does -verbose:class option really shows? The toolsdoc says
    "-verbose:class Display information about each class loaded.". Would this also
    display classes dynamically generated such as dynamic proxies (or classes
    loading from custom classloaders)? I suspect this only displays class loaded
    from the system classloader...
    Many thanks for your help,
    Regards,
    Guillaume Berche.
    19735.5: [DefNew: 10511K->2379K(12288K), 0.1241661 secs] 160415K->152624K(258048K) Heap after GC invocations=11590:
    Heap
    def new generation total 12288K, used 2379K [77c00000, 78c00000, 78c00000)
    eden space 8192K, 0% used [77c00000, 77c00000, 78400000)
    from space 4096K, 58% used [78400000, 78652e48, 78800000)
    to space 4096K, 0% used [78800000, 78800000, 78c00000)
    concurrent mark-sweep generation total 245760K, used 150245K [68c00000, 77c00000, 77c00000)
    CompactibleFreeListSpace space 245760K, 61% used [68c00000, 77c00000)
    concurrent-mark-sweep perm gen total 43772K, used 33105K [64c00000, 676bf000, 68c00000)
    CompactibleFreeListSpace space 43772K, 75% used [64c00000, 676bf000)
    } , 0.1262338 secs]
    19737: [GC  {Heap before GC invocations=11590:
    Heap
    def new generation   total 12288K, used 10571K [77c00000, 78c00000, 78c00000)
      eden space   8192K, 100% used [77c00000, 78400000, 78400000)
      from space   4096K,  58% used [78400000, 78652e48, 78800000)
      to   space   4096K,   0% used [78800000, 78800000, 78c00000)
    concurrent mark-sweep generation total 245760K, used 150245K [68c00000, 77c00000, 77c00000)
    CompactibleFreeListSpace space 245760K,  61% used [68c00000, 77c00000)
    concurrent-mark-sweep perm gen total 43772K, used 33106K [64c00000, 676bf000, 68c00000)
    CompactibleFreeListSpace space  43772K,  75% used [64c00000, 676bf000)
    } , 0.1262338 secs]

    I did check the JDK bug database, and you are right, String.intern() does indeed seem to increase size of permanent generation (argnn!)
    Have you experienced cases in which "internalised" String are prevented by the JVM 1.4.1 from being GCed?
    I saw an old bug on JDK 1.1 similar to that:
    http://developer.java.sun.com/developer/bugParade/bugs/4497186.html
    Thanks for your help,
    Guillaume.

  • Mckoi database driver & ClassLoader

    i believe i have a properly working custom classloader for the driver,
    but now i'm getting a problem with of this chunk of code.
    at the end, the sql exception gets thrown with the message being:
    "Unable to make a connection to the database.
    The reason: No suitable driver"
    i tested this application by running:
    java -cp ../../mckoidb.jar:. SimpleApplicationDemo and everything is working fine. the code i did chage has comments about it.
    any help will be greatly appreciated :>
    import java.sql.*;
    import java.net.*;
    public class SimpleApplicationDemo {
    * The demonstation 'main' method.
    public static void main(String[] args) {
    System.out.println();
    // Register the Mckoi JDBC Driver
    try {
    // ---------------- start modified code --------------------------
    URL[] urlsToLoadFrom = new URL[]{new URL("file:../../mckoidb.jar")};
    URLClassLoader loader = new URLClassLoader(urlsToLoadFrom);
    Class JDBCDriver = Class.forName("com.mckoi.JDBCDriver", true, loader);     
    // ---------------- end modified code --------------------------
    // below is the orginal code - when uncommented works with:
    // java -cp ../../mckoidb.jar:. SimpleApplicationDemo
    //Class.forName("com.mckoi.JDBCDriver").newInstance();
    catch (Exception e) {
    System.out.println(
    "Unable to register the JDBC Driver.\n" +
    "Make sure the classpath is correct.\n" +
    "For example on Win32; java -cp ../../mckoidb.jar;. SimpleApplicationDemo\n" +
    "On Unix; java -cp ../../mckoidb.jar:. SimpleApplicationDemo");
    return;
    // This URL specifies we are connecting with a local database. The
    // configuration file for the database is found at './ExampleDB.conf'
    String url = "jdbc:mckoi:local://ExampleDB.conf";
    // The username/password for the database. This is set when the database
    // is created (see SimpleDatabaseCreateDemo).
    String username = "user";
    String password = "pass1212";
    // Make a connection with the database.
    Connection connection;
    try {
    connection = DriverManager.getConnection(url, username, password);
    catch (SQLException e) {
    System.out.println(
    "Unable to make a connection to the database.\n" +
    "The reason: " + e.getMessage());
    return;
    }

    java.sql.ClassLoader won't recognize any JDBC drivers loaded by custom classloaders. Theres some more info here http://forum.java.sun.com/thread.jsp?forum=48&thread=249632
    Col

  • Wsgen task in stand-alone Ant

    Have anyone made a wsgen task in a build.xml file for use with an original Ant-distribution?
    (not using org.apache.tools.ant.Main located in weblogic.jar)
    I get a non-informing build error when running the wsgen-task. (The ejbc-task
    completes successfully).
    java.lang.NoSuchMethodError
    at weblogic.apache.xerces.jaxp.DocumentBuilderImpl.<init>(DocumentBuilderImpl.java:136)
    at weblogic.apache.xerces.jaxp.DocumentBuilderFactoryImpl.newDocumen...bla
    bla...
    (Project.java:510)
    at org.apache.tools.ant.Main.runBuild(Main.java:421)
    at org.apache.tools.ant.Main.main(Main.java:149)
    If anyone could tell me what to do - that would really make my day(!)
    Regards,
    Henning Storhaug

    There is a little bit of situation using taskdef and a classpath from inside
    a build.xml. The problem is that ant creates a custom classloader (which
    loads classes the same way ant finds files, ie. replacing /->\, :->;, using
    the correct basedir, etc. etc.). Ant uses this classloader to load the class
    implementing the task.
    Mainly this creates two problems:
    - This classloader does not 100% implement the correct protocol of a
    classloader, especially when it comes to finding resources. (no disrespect
    intended, ant is a great tool!)
    - Many classes in Weblogic is not really used to being loaded from a
    classloader and doesn't behave very well. (for example: using the
    system-classloader directly, assuming that they are located at the
    java.system.classpath etc. etc)
    This makes it almost impossible to use any weblogic-tasks without loading
    weblogic-classes from the system-classpath. And that is why the "trick of
    the external build.xml" works, because antcall starts the new ant with a
    system-classpath including weblogic.jar.
    Don't really now what the best solution to this is. I think that BEA has to
    be better writing code that behaves nicer to custom classloaders, and I
    think the ant team needs to fix their class-loader a little better.
    (especially in respect to resources)
    In the meantime use the "external build.xml"-trick or use the ant included
    with weblogic.
    "Chris" <[email protected]> wrote in message
    news:[email protected]...
    >
    We are actually using Ant 1.4 with Weblogic 6.1 and the wsgen tasksuccessfully..
    although I haven't tested myself , I was told that there might be problemsif
    the wsgen task is run from the same build.xml file (which might be thereason
    for your problem as well)... so what I have done is created a second buildxml
    file that includes the wsgen task (and some staging tasks) and I call itfrom
    my main build.xml (using antcall).
    A couple of things to note is that you have to make sure that you put antin front
    of the weblogic.jar in the classpath.. Additionally (and you were rightabout
    this) you have to use the taskdef to define the wsgen task as ant will notfind
    it by itself..
    Here is a sample of the wsgen task I use.
    <wsgendestpath="${dir.dsn-build}/webservices_staging/${module.name.Report}WS.ear"
    >
    context="/${module.name.Report}"
    host="localhost"
    port="8081"
    protocol="http"
    webapp="${module.name.Report}-web-services.war">
    <rpcservices path="${dir.ear_staging}/ReportEntryEJB.jar">
    <rpcservice bean="ReportEntry" uri="/${module.name.Report}uri"/>
    </rpcservices>
    </wsgen>
    "Simon Spruzen" <[email protected]> wrote:
    I tried this, and defined a taskdef to allow standalone ant to locate
    the WLS ant
    wsgen task:
    <!-- wsgen - build web services -->
    <taskdef name="wsgen" classname="weblogic.ant.taskdefs.ejb.WSGen">
    <classpath refid="bea.class.path"/>
    </taskdef>
    bea.class.path was defined to ensure that weblogic.jar came first.
    However, I got a curious error when running wsgen target - can't
    remember,
    and
    don't have, the full details - but it involved a message along the lines
    of something
    "...violating loader constraints...".
    So I just gave up and used the version of Ant that ships with WLS 6.1,
    and it
    works and I am happy and content.
    (But you're stuffed if you want to move to ant 1.4)
    "Henning Storhaug" <[email protected]> wrote:
    To be a bit more specific:
    The wsgen ant-task runs when using the ant-distribution within
    weblogic.jar,
    but
    not using the jakarta-ant-1.3 distribution. I've checked the versions,
    and they
    are the same.
    If you need more info, please ask.

  • Enhancement possibilities of Java Developments

    Hi, all!
    Does SAP provide an enhancement concept for it' s Java application within NWDI side similar to its ABAP development? Something like BADIs, customer exits on screens, customer includes for data structures a.s.o.? Something that would enable a customer to enhance either a SAP Java app or a ISV app without modification?
    Regards,
    Thomas

    Hi,
    This is a though question, and I think many share your concern (including me to some extent) regarding the TCO for Java applications.
    SAP has provided little help in this area, in fact the primary tool is a visual diff extension in NWDS, allowing you to compare new version with the old. This is especially difficult with NWDI, since the diff tool has no concept of modelling differences which may impact multiple files. I believe this diff tool also has some auto-merge possibilities
    There are some Java EE applications which are delivered for NWDI and are structured well into different DCs (CRM comes to mind). Here there are clearly defined guidelines on when to create new classes, and generally your changes are better separated from the core SAP provided code (still not 100%).
    With regards with the classloading stuff, this is handled better and better, as there is a system of custom classloaders which can clear out loaded classes as needed. Doesn't always work, but most of the time.
    Cheers
    Dagfinn

  • Class Enhancement without a .jdo file

    Is it possible to do a byte code enhancement using the KODO APIs passing in
    a data structure containing the .jdo metadata file information without
    having to explicitly create a .jdo file?
    I'm looking at using the enhance() method of JDOEnhancer class and it looks
    like I have to have a .jdo file on disk. Is there any way to avoid it?
    In my enviornment I read information from a master metadata file, use that
    to generate Java code, invoke the compiler on it and now I'd like to invoke
    the enhancer on the class files - i'd like to do all this one shot. Since I
    have all the information needed in memory, I don't want to create a .jdo
    file and have the enhancer read that file.
    Thanks
    Vijay

    Vijay-
    You do always need the .jdo metadata file for your classes; the JDO
    specification requires it. Note, though, that you could just have a
    single top-level package.jdo file that holds the metadata for all your
    classes, so that you would only need to create a single file.
    Technically, I suppose you could use a custom ClassLoader that overrides
    getResourceAsStream() (since this is the way we locate .jdo metadata
    files for classes), and return a textual stream of the contents of the
    ..jdo metadata. It might work, but we advise against it, since using
    custom ClassLoaders can introduce very tricky problems that are
    difficult to debug.
    In article <bju9ua$ops$[email protected]>, Vijay Ganesan wrote:
    >
    Is it possible to do a byte code enhancement using the KODO APIs passing in
    a data structure containing the .jdo metadata file information without
    having to explicitly create a .jdo file?
    I'm looking at using the enhance() method of JDOEnhancer class and it looks
    like I have to have a .jdo file on disk. Is there any way to avoid it?
    In my enviornment I read information from a master metadata file, use that
    to generate Java code, invoke the compiler on it and now I'd like to invoke
    the enhancer on the class files - i'd like to do all this one shot. Since I
    have all the information needed in memory, I don't want to create a .jdo
    file and have the enhancer read that file.
    Thanks
    Vijay--
    Marc Prud'hommeaux [email protected]
    SolarMetric Inc. http://www.solarmetric.com

  • Jars dependent on different versions of the another jar

    I have two vendor supplied jars that are both dependent on different releases of another jar. So, in the usage instructions for the first jar, it says to make sure that x_1_2_1.jar is my classpath. Likewise, in the usage instructions for my other jar, it says to make sure that x_2_0_1.jar is in my classpath. The installers for each one of these jar puts their version of the dependent x jar in a subdirectory under their installation.
    This causes all sorts of headaches because neither jar ever gets completely what it is looking for. Code in the jar that depends on x_1 fails if x_2 is in the classpath first, while code in the jar that depends on x_2 fails if x_1 is the classpath first.
    (Since, I'm sure to encounter this mismatched versioning problem with other "utility" jars in future, I'm intentionally withholding the actually names of the jars involved. I'm looking for the general solution to this class of problem, not specific tips related to a particular utilities jar.)
    I was thinking that maybe the manifest Class-Path of each jar might be used to force where each jar looks for it's dependent jars, but the documentation I read about Manifests indicated that each jars Class-Path is simply concatenated into the overall Classpath that the ClassLoader uses.
    If it matters, all this is in a Java 1.3.1 environment.
    It seems like I can't be the first person to come up against this, but I haven't really seen any traffic on the forums about this kind of problem. (Am I missing something obvious?)

    May be custom ClassLoaders may help you, but I am not sure. It depends on whether you are allowed to explicitly load several equally named classes from different sources.
    Probably it is allowed. The following is cited from the Java Language Specification, 2nd edition (chapter 7.7, Unique Package Names, packages.doc.html):
    "If unique package names are not used, then package name conflicts may arise far from the point of creation of either of the conflicting packages. This may create a situation that is difficult or impossible for the user or programmer to resolve. The class ClassLoader can be used to isolate packages with the same name from each other in those cases where the packages will have constrained interactions, but not in a way that is transparent to a na�ve program. "

  • EDesigner: deploy to Sun AS 8.1

    Hi,
    Has anyone deployed from edesigner to external AppServer?
    I've tried but result is warning message:
    "Error while loading application server plug-in jar:
    Manifest does not specify any deployment factory implementations, must specify atleast one"

    Hello,
    Documented in \repository\server\webapps\eGate_Sys_Admin_Guide.pdf
    P.44,
    4.1 Prerequisites
    Before you start the deployment process, perform the following steps:
    1 Install Sun Java System Application Server Enterprise Edition 8.1 from the Sun Java
    Enterprise System 4 installer.
    2 Apply the appropriate patch to Sun Java System Application Server. The patch that
    you need depends on the operating system. You can obtain the patch from SunSolve
    Online.
    The patch IDs for the package-based patches are:
    &#1048716; Sun Solaris (SPARC): 119166-15
    Chapter 4 Section 4.1
    Deploying Applications to Sun Java� System Application Server Prerequisites
    eGate Integrator System Administration Guide 45 Sun Microsystems, Inc.
    &#1048716; Sun Solaris (Intel x86): 119167-15
    &#1048716; Linux: 119168-15
    &#1048716; Windows: 122848-01
    The patch IDs for the file-based patches are:
    &#1048716; Sun Solaris (SPARC): 119169-07
    &#1048716; Sun Solaris (Intel x86): 119170-07
    &#1048716; Linux: 119171-07
    &#1048716; Windows: 119172-07
    3 Open the server.policy file in the
    Sun_JES_install_dir\ApplicationServer\domains\domain_name\config
    directory and add the following permissions to the end:
    grant {
    // Java CAPS needs access to the class loader
    permission java.lang.RuntimePermission "getClassLoader";
    // Java CAPS needs custom classloaders in some cases
    permission java.lang.RuntimePermission "createClassLoader";
    // Java CAPS policy requirement
    permission java.security.SecurityPermission "setPolicy";
    permission java.security.SecurityPermission "getPolicy";
    permission java.security.SecurityPermission "getProperty.policy.url.*";
    permission java.security.SecurityPermission "setProperty.policy.url.*";
    // Java CAPS for the SAP eway
    permission java.lang.RuntimePermission "setContextClassLoader";
    // Java CAPS uses the MBeanServer
    permission javax.management.MBeanServerPermission "*";
    permission javax.management.MBeanPermission "*", "*";
    permission javax.management.MBeanTrustPermission "register";
    // Java CAPS Log4J support (obsolete) (log4j file roll-over needs delete)
    permission java.io.FilePermission "<<ALL FILES>>", "delete";
    // Java CAPS Odette eWay support requires execute permission
    permission java.io.FilePermission "<<ALL FILES>>", "execute";
    // Java CAPS HTTP eWay
    permission java.lang.RuntimePermission "setFactory";
    // Java CAPS tcpip inbound eway added "accept,resolve" to SocketPermission
    // Java CAPS BPEL debugger added "listen" to SocketPermission
    permission java.net.SocketPermission "*", "connect,listen,accept,resolve";
    // Java CAPS needs these permissions so the Bouncy Castle provider can be used
    permission java.security.SecurityPermission "insertProvider.BC";
    permission java.security.SecurityPermission "removeProvider.BC";
    permission java.security.SecurityPermission "putProviderProperty.BC";
    // Java CAPS needs this permission so the JMX remote connector can be used
    permission javax.security.auth.AuthPermission "getSubject";
    // Java CAPS: Hessian connector for JMX4J for EM; also for BPEL debugger
    permission java.lang.reflect.ReflectPermission "suppressAccessChecks";
    // Java CAPS: for BPEL debugger
    permission java.io.SerializablePermission "enableSubstitution";
    Chapter 4 Section 4.1
    Deploying Applications to Sun Java� System Application Server Prerequisites
    eGate Integrator System Administration Guide 46 Sun Microsystems, Inc.
    // Java CAPS: for EM to use SSL
    permission javax.net.ssl.SSLPermission "setHostnameVerifier";
    permission javax.net.ssl.SSLPermission "getSSLSessionContext";
    4.1.1 Prerequisites for Enterprise Designer
    If you want to use Sun SeeBeyond Enterprise Designer for deployment, then perform
    the following steps:
    1 Copy the following from the Sun_JES_install_dir\ApplicationServer\lib
    directory to the Sun_JavaCAPS_install_dir\edesigner\plugins\SunoneServer
    directory:
    &#1048714; appserv-admin.jar
    &#1048714; appserv-rt.jar
    &#1048714; jmxremote.jar
    &#1048714; jmxremote_optional.jar
    &#1048714; deployment folder (which contains the sun-as-jsr88-dm.jar file)
    2 Go to the
    Sun_JES_install_dir\ApplicationServer\domains\domain_name\config
    directory and open the domain.xml file.
    3 Set the security-enabled attribute for the appropriate HTTP listener to false. This
    action is performed depending on the HTTP port you are going to use for
    deployment. In the following example, the user is using HTTP port 4850 for
    deployment, and therefore has to enable the security attribute to the related port.
    <http-listener
    acceptor-threads="1"
    address="0.0.0.0"
    blocking-enabled="false"
    default-virtual-server="__asadmin"
    enabled="true"
    family="inet"
    id="admin-listener"
    port="4850"
    security-enabled="false"
    server-name=""
    xpowered-by="true">
    </http-listener>

  • One Jar distribution

    It somewhat confusing me that distributing a number of jars as one is still not something that is supported well. As many others do, I use the approach of unpacking all related jars and then repackaging the whole. This works fine for most jars, but mail.jar, preweaved EclipseLink business models jars, imageio_1.1.jar won't all that; they need to be included in the classpath. This is starting to annoy me, as more and more jars fall into this category.
    Basically all I look for is a very simple approach:
    1. pack all jars are pack into one single jar and some startup information is added (VM arguments like "javaagent").
    2. when started, the jar is unpacked in a temporar location
    3. the classpath and system path is set based on what was unpacked, and the main jar is called as if it were a normal java start (with the provided VM arguments).
    Now I found OneJar, JarClassloader and a number of other approaches, some creating an EXE out of the JAR, but all seem very complex for the task at hand (custom classloaders and stuff).
    I'll give some of these a spin, but does anyone have any experience with such tools, especially concerning arguments like "javaagent"?
    Otherwise I have to implement my own distributor.

    You are right and naturally restructuring the build process is required in order to create a single-jar deliverable. But only the packaging phase.
    Do keep in mind that this is an 8 year old Swing application started on Java 1.2. Initially it only had a relation with some free and open source util and component jars. The quickest way to create a deliverable back then was repacking. During the years more jars were added, but the approach held. The troubles began with the mail and activation jars... They have data in the META-INF that do no allow repacking, so they are made available separately (copied). This worked ok, since they hardly ever change. But more recently I started to move the core of the application into separate business model jar using Eclipselink (it was about time that JDBC code was upgraded, especially since the duplication of JDBC logic is also increasing with the various ex- and importer applications) and the number of these "exception" jars is getting higher.
    So the pivot point is reached to restructure the deliverable back into one single jar.

Maybe you are looking for

  • SUN Java System Web Server 7.0U1 How to install certificate chain

    I am trying to install a certificate chain using the SUN Java Web Server 7.0U1 HTTPS User interface. What I have tried so far: 1. Created a single file using vi editor containing the four certificates in the chain by cutting an pasting each certifica

  • Powerbook didn't ship with SVideo to compiosite adapter wire

    Hello everyone, sorry if off-topic, but I recieved my Powerbook over 3 months ago, and it shipped without the S Video to composite adapter plug. Will Applecare take action to mail me another one if I state that it was not in the box, and will they sh

  • Unable to mount Time Machine volume w/o Time Machine

    I am happily using Lion Server to support network backup for a MacBook. It works very nicely, and does both backups and restores well. However, I wanted to look at some files in an old archive, so, on the server itself, I went to the relevant volume:

  • [SOLVED]Incorrect thunar folder icons

    Hello I've been using the Area Blue icon theme for a few days but after a reboot yesterday the folder icons are GNOME icons. All the other icons are unaffected. I've tried deleting and re-downloading the icons but the folder icons just won't work. An

  • I bought a iTunes card from 7-11 like 5 days ago

    I bought a I tunes card 5 days ago. My card wasn't activated right and the so called surport team has done nothing to help me and this is not the first time I had to deal with this problem. Now I'm getting emails from iTunes telling me to send a pict