Problem in loading a class from server

hello,
Please help me ,i m using this code to load a class from server and this code load this successfully but i don't how to make object of class that is just loaded.
i want to load the class and use its method in my program please help me i m in very critical position.
pelase help me give me hint
import java.sql.*;
import java.net.*;
import java.io.*;
public class MyLoader
public static void main (String argv[]) throws Exception
URLClassLoader loader = new URLClassLoader(new URL[] { new URL("url") });
// Load class from class loader. argv[0] is the name of the class to be loaded
String str = "FinalMyConnection";
     Class c = loader.loadClass (str);
System.out.println(c.getClass().getName());
// Create an instance of the class just loaded
Object o = c.newInstance();
     System.out.println(o.getClass());
     FinalMyConnection mycon = new FinalMyConnection();
     String query1 = " select * from game_master order by game_id;";
     mycon.connect();
          ResultSet rs1=mycon.executequery(query1);
          while (rs1.next())
          String s1=rs1.getString(1);
               String s2=rs1.getString(2);
               System.out.println("game_id"+s1);
               System.out.println("game_name"+s2);
}

also load all required parser and sax classes into oracle,i.e.,
you can load the '.jar' file containg all the parser and sax classes and then load you ContentHandler class.

Similar Messages

  • Problem loading modified classes from CLASSPATH using system class loader

    Hi,
    I am facing problem to load the modified classes from CLASSPATH.
    I have set my CLASSPATH to a directory whose classes will be modified frequently. After the server(web/app) is started, the system class loader, using which am trying to load the classes from the directory where the CLASSPATH is set, am not able to load the modified files without the server restart.
    Do I need to have a custom class loader to fix this.
    Please help me.
    Thanks,
    Sureddy

    Do I need to have a custom class loader to fix this.Yes.

  • Can't load any classes from infobus.jar (WL 6.0 SP1)

    Hi,
    I am deploying an .ear file, which has one .war file in it. The war file, has
    infobus.jar, inside it under \WEB-INF\lib. Whenever in my servlet code I try to
    load a class from infobus.jar, I get the following exception :
    About to load class javax.infobus.InfoBusDataConsumer<<<<<<<<<<java.lang.ClassNotFoundException: InfoBusDataConsumer
    at weblogic.utils.classloaders.GenericClassLoader.findClass(GenericClassLoader.java:178)
    at weblogic.utils.classloaders.ChangeAwareClassLoader.findClass(ChangeAwareClassLoader.java:45)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:297)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:253)
    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:313)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:120)
    at XDILoginForm.init(XDILoginForm.java:99)
    at weblogic.servlet.internal.ServletStubImpl.createServlet(ServletStubImpl.java:638)
    at weblogic.servlet.internal.ServletStubImpl.createInstances(ServletStubImpl.java:581)
    at weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubImpl.java:526)
    at weblogic.servlet.internal.WebAppServletContext.preloadServlet(WebAppServletContext.java:1078)
    at weblogic.servlet.internal.WebAppServletContext.preloadServlets(WebAppServletContext.java:1022)
    at weblogic.servlet.internal.HttpServer.loadWARContext(HttpServer.java:499)
    at weblogic.servlet.internal.HttpServer.loadWebApp(HttpServer.java:421)
    at weblogic.j2ee.WebAppComponent.deploy(WebAppComponent.java:74)
    at weblogic.j2ee.Application.deploy(Application.java:175)
    at weblogic.j2ee.J2EEService.deployApplication(J2EEService.java:173)
    at weblogic.management.mbeans.custom.Application.setLocalDeployed(Application.java:217)
    at weblogic.management.mbeans.custom.Application.setDeployed(Application.java:187)
    at java.lang.reflect.Method.invoke(Native Method)
    at weblogic.management.internal.DynamicMBeanImpl.invokeSetter(DynamicMBeanImpl.java:1136)
    at weblogic.management.internal.DynamicMBeanImpl.setAttribute(DynamicMBeanImpl.java:773)
    at weblogic.management.internal.DynamicMBeanImpl.setAttribute(DynamicMBeanImpl.java:750)
    at weblogic.management.internal.ConfigurationMBeanImpl.setAttribute(ConfigurationMBeanImpl.java:256)
    at com.sun.management.jmx.MBeanServerImpl.setAttribute(MBeanServerImpl.java:1356)
    at com.sun.management.jmx.MBeanServerImpl.setAttribute(MBeanServerImpl.java:1331)
    at weblogic.management.internal.ConfigurationMBeanImpl.updateConfigMBeans(ConfigurationMBeanImpl.java:318)
    at weblogic.management.internal.ConfigurationMBeanImpl.setAttribute(ConfigurationMBeanImpl.java:259)
    at com.sun.management.jmx.MBeanServerImpl.setAttribute(MBeanServerImpl.java:1356)
    at com.sun.management.jmx.MBeanServerImpl.setAttribute(MBeanServerImpl.java:1331)
    at weblogic.management.internal.MBeanProxy.setAttribute(MBeanProxy.java:291)
    at weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:173)
    at $Proxy7.setDeployed(Unknown Source)
    at weblogic.management.console.pages._panels._mbean._application._jspService(_application.java:303)
    at weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:213)
    at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:1265)
    at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:1622)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:137)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
    But if I put the infobus.jar on system classpath , everything works out fine.
    Can somebody tell me, what is going on

    Gseel is right: you try to instantiate an EJB with the BDK.
    Enterprise Java Beans are totally different from graphical/GUI beans. EJBs are thought for dealing with business logic like accessing a database, ldap directory and so on. They run on a application server (simply speaking - a java enabled webserver) and do some processing to handle user requests. Enterprise Java Beans usually don't interact directly with the user, they only do the work in the background and forward their results, which are then rendered for the user. Typically they are employed for handling web requests (a user with a browser), but they can also be used for awt/swing applications. Though - let me repeat - they don't appear visually on the screen.
    The only similarities between those two bean types are the following: they have getter/setter methods for their properties, they implement Serializeable (or a sub-interface like Externalizable, Remote) and they have a default no-argument constructor.
    If you want to run your been you need an application server (your bean is pre-packaged for the Bea Weblogic app-server). If you want to do something graphical, you'll need to search for GUI beans.
    dani3l

  • "Unable to load workflow actions from server. Please contact your server."

    I get the following error message when I want to create or open a workflow in SharePoint Designer 2007
    "unable to load workflow actions from server. Please contact your server
    administrator."
    I don't receive this error as a site collection administrator, but one of my contributors gets the error.

    What Chris mentioned is kind of abnormal situation described in
    http://office.microsoft.com/en-us/sharepointdesigner/HA102379121033.aspx#20.
    However, normally, you won’t be able to create SPD workflow if you only have Contribute permission level. I give the user Design permission level then he can
    create SPD workflow.
    There are other factors affecting permission to create SPD workflow:
    1.     
    According to
    http://office.microsoft.com/en-us/sharepointdesigner/HA101005871033.aspx#4
    , the SPD workflows are stored in a site-level hidden document library called Workflows. You should make sure that user have permission in this document library so that the created workflow can be saved successfully.
     http://blogs.msdn.com/sharepointdesigner/archive/2008/11/25/locking-down-sharepoint-designer.aspx
    describe the method to manage permission for this hidden Workflows document library: open the site in SharePoint Designer >> right-click the Workflows library >> click Properties >> click the Security tab >> click the link “Manage
    permissions using the browser”
    2.     
    SharePoint Designer contributor setting (http://office.microsoft.com/en-us/sharepointdesigner/HA101174691033.aspx
    ) can also block the user from being able to create workflows.

  • Problem in loading transactional data from to 0MKT_DSO1(ods) to 0MKTG_C01

    Hi,
    I am trying to load lead transaction data to the standard Crm lead management cube from ODS.There is a problem while loading transaction data from 0MKT_DSO1(ods) to the infocube 0MKTG_C01 as the field 0STATECSYS2(CRM STATUS)  is set to 10 in ods -meaning incorrect transaction. This feild is not there in the infocube.
    There is a routine in the cube that deletes data records with (0statecsys2) set to 10.
    THIS field is not coming in the transaction.
    so, where can i see the master data in crm source system? and why is that feild getting set to 10 ?
    thanks in advance!

    Thanks for the reply..
    I have checked the Fact table which shows
    1. packet Dimension
    2. Time dimension
    3. Unit dimension.
    I have kept the 0CALDAY as the time characteristics.
    Sample data i have loaded from ODS to Cube.
    Sample data in ODS.
    Sales order No_____0CALDAY_____AMOUNT
    800001___________12/02/2009____15
    I have loaded this data in Cube with Full Upload.
    Data in Cube.
    Sales order No_____0CALDAY_____AMOUNT
    800001___________12/02/2009____15
    Again i am loading the same data to cube
    Data in cube after loading.
    Sales order No_____0CALDAY_____AMOUNT
    800001___________12/02/2009____15
    800001___________12/02/2009____15
    The data is duplicated and it is not cumulating.
    Am i missing anything on this.
    Pls help..
    Thanks,
    Siva.

  • How to load java class from jsp page?

    hi all!
    Does anyone know how to load java class from jsp page?
    I try to load java class from jsp page.
    Is it possible to load java class fom jsp page?
    thanks and have a good day!

    What I mean is How to load/open java class file from jsp page?
    I think we can open Applet from jsp page by using
    <applet code=helloApplet.class width=100 height=100>
    </applet>
    but, how to open java class which is an application made by Frame?
    thanks and have a good day

  • Problem calling a jre7 class from jni

    Hi,
    We have a class in java 7 and need to load it from a native code. The system already load some classes in java 6 with JNI, needing an upgrade. I install the new JDK, change include directories and link references in my VC project. All was well, until need to start the jre7 from jni... When call method JNI_CreateJavaVM, we pass the jni version in vm_args.version parameter, but don't have a definition for newer version than 1.6.
              JavaVMInitArgs vm_args;
              vm_args.version = JNI_VERSION_1_6;
              vm_args.nOptions = 2;
              vm_args.options = options;
              vm_args.ignoreUnrecognized = 0;
              int ret = JNI_CreateJavaVM(&jvm, (void**)&env, &vm_args);
    Running the program, when calls JNI method "FindClass" for a jre7 class, the jvm throws an UnsupportedClassVersionError exception. The exception is clear, I'm running a class that the jvm doesn't support, to be a newer version than it.
    The problem: How do I to start, from JNI, a JVM that supports the jre7 classes? I tryed to search, but don't found any reference for this. That's possible? The JNI library supports jre7?
    Regards
    ps. sorry for my "brazilian" english

    Yes, is the problem, now solved.
    The cause was in the User Environment Variables, that sets the path to the jre6, preceding my settings when runs the application. I had checked the System environment, but had forgotten the User environment.

  • Podcast will not load in safari from server, but will load in other Apps

    Podcast will not load in safari from iWeb Page from server, but will load in Firefox and other web apps.
    Here the problem: I have a podcast page made in iWeb. It is setting on a server with GoDaddy. When I try load page with Safari, I get where the Quicktime Playing Bars are a small Quicktime Logo w/? mark and will not download or play. But in Firefox, My iPad and in Windows side it will load and play. Also it play on a friends Macbook Pro in Safari. (Note it will play in my Safari after Firefox has play -it "very strange to me" like Firefox will open some port, but it will not stay open if quit Safari re-booth-it) I have remove the .plist for Quicktime & Safari. And clean out the Cache for Safari. Also have re-set the Firewall setting to Enable Stealth Mode only. Re-load the site to GoDaddy. This is happening to both Mac's in my network and in all users accounts.
    My Network is a A&TT with a 2Wire w/wrieless turn off. going into and Airport Extreme Base Station w/N generation network. One computer is connected with and ethernet cable to the Airport extreme base station the other is a wireless contection.
    I do feel this and network issue and I can't seem to solve-it. How can I get Safari to open the port and download and play-it on my network?

    We've only discover this yesterday. One of our listeners sent me an e-mail about-it. With a little more research this morning. I've discover that everybody I've had check-it is have the same problem only with Safari 4.0.5. So I'm starting to feel that this is an Apple Safari Bug in 4.0.5 for the Mac only. It seems to be OK everywhere else on other devices. I agree in most cases this is not a problem. But when have older people who do not download into iTunes around the world it is to them. We have 250 or more listeners a week. This is a Church podcast.
    For right now we are planing to post a message on the site saying you will not be able to listen to the podcast in Safari, but can in Firefox and ect.

  • Is there a restriction on loading "javax" classes from WEB-INF/lib?

    I'm having trouble with a webapp in WL 10MP1 that is having trouble loading classes from the "jsr311-api-1.0.jar" in my WEB-INF/lib. Even though I have no trouble with it in Eclipse (no compile errors), classes from that jar fail with "NoClassDefFound" exceptions. I have a feeling it might be the fact that the packages in that jar start with "javax". Assuming that's the case, is there anything I can do to fix this?
    What's even stranger is that the errors I get are when I try to load them directly from the Spring context. However, if I remove the test references to those classes, there's other code that loads those classes later in the application startup (after the Spring context finishes loading), and they load perfectly fine (I turned on verbose class loading to verify this).

    Note that I've tried two other strategies that both result in the same failed state.
    I tried putting the "jsr311-api-1.0.jar" in $JDK_HOME/jre/lib/ext, but that causes a failure to find Spring classes. I then copied the "spring.jar" into $DOMAIN_HOME/lib, and then it fails to find CXF classes. After doing the same with "cxf-2.2.3.jar", it then fails to find "javax.servlet.ServletContextListener", which clearly tells me there's no benefit to this approach.
    Similarly, I tried copying the jars into $DOMAIN_HOME/lib, and that fails to find "org.apache.commons.logging.LogFactory". I could continue down this path, but it doesn't seem likely to succeed. Eventually, I'll get to a point where it just can't find the classes specific to my application, which I certainly can't copy into $DOMAIN_HOME/lib.
    The first basic problem is that I can't put anything into a higher-level classloader that will eventually reference classes in a lower-level classloader, because references can only go up the chain, and the second problem is that WebLogic appears to ignore classes in WEB-INF/lib in the "javax.*" packages. I think there might be an exception for "javax.xml.*", but not for other subpackages. I tried adding a "prefer-application-packages" clause to my weblogic-application.xml file, but that had no effect.

  • Socket Problem, Problem about printing the response from server

    Or even I am not sure if there is a response from server. My code is like that
                   //Connection between, httpProxy and target adress
                   Socket clientSocket= new Socket("some host", 80);
                   DataOutputStream outToServer= new DataOutputStream(clientSocket.getOutputStream());
                   BufferedReader inFromServer= new BufferedReader(new     InputStreamReader(clientSocket.getInputStream()));
                   //The first way
                   //outToServer.writeBytes("GET http://www.somehost.com/ HTTP/1.1"+ '\n');
                   //System.out.println("FROM SERVER: "+inFromServer.readLine());
                   //The second way
                   PrintWriter out_writer = new PrintWriter(outToServer, false);
                   out_writer.println("GET http://www.somehost.com/ HTTP/1.1");
                   out_writer.println("Host: localhost:80");
                   out_writer.println("Connection: Close");
                   out_writer.println();
                                        //The second way cont.
                   String s = null;
                   while ((s = inFromServer.readLine()) != null)
                   System.out.println(s);
                   inFromServer.close();There are the two ways that I tried, and both of them didn't work. Why they are not working ? How can I solve it ?

    problem is solved, the reason it doesn't work is i didn't write the parts correctly. I mean it should be exactly the same packetIf you mean that the entire request must be sent in a single IP packet, this isn't true.
    and host name must also be exactly sent to server.Of course.
    They must be like in the wireshark.No. The actual data you send must be the same, but the server has no way of telling about what the IP packet looks like or how many there were.
    One of your problems is that newlines in HTTP are defined as \r\n. In one case you're just using \n and in the other case you're using whatever the platform line terminator is. Neither is correct.

  • Issues loading .txt files from server...

    Hi.
    I have an issue with a script I created that loads text strings from a file on my server.
    The swf file loads a message from a .txt file, displays it in an animation when the animation finishes it loops back to the start and loads the next message and displays it in the animation.
    All works fine. However the script reads the text file from the server on every loop ( 3 seconds ) This will be hard on my server so... Is there a way to read the text file once only and then loop through the eight statements?
    Thanks. Z
    Actionscript 2. Flash CS3. Flash Player 10.
    quotes.txt - text file containing eight quotes
    quote_txt - Dynamic field within animation
    ranQuote = new LoadVars();
    ranQuote.onLoad = function(success) {
        if (success) {
            RanNum = RanNum+1;
            if (RanNum>=9) {
                RanNum = 1;
                ran = this["quote"+(RanNum)];
                quote_txt.text = ran;
            } else {
                ran = this["quote"+RanNum];
                quote_txt.text = ran;
        } else {
            quote_txt.text = "Display if can't load txt file";
    ranQuote.load("quotes.txt");

    Unless I'm missing something, each time you load the file you are loading the entire file.  So you should have all of what's in it stored.  Your load function appears to just be picking out one of them out randomly after they're all loaded.
    I assumed wrongly that this isn't all the code you have and other loading code is what you are trying to inhibit.
    What you probably want to do is take most of your onLoad code and place it into a function.  What you have that is pulling up the quotes should utilize that function.  You shouldn't be using that loading code each time some button or whatever loop cycles.

  • Problem when loading pdf files from Shared Content

    When I load pdf files from Shared Content, I got the following problem: "The selected document could not be retrieved, please try uploading the document again."
    Anyone knows this?
    Thank you very much in advanced.

    I don't migrated the program, but installed it from the original installer,
    i. e. I first installed Indesign from backup, and then uninstalled it and
    reinstall  clean from Adobe.
    What a plug-in or utility converts page from InDesign to PDF?
    2014-08-10 22:51 GMT+04:00 Peter Spier <[email protected]>:
        problem with exporting PDF files from InDesign CS5  created by Peter
    Spier <https://forums.adobe.com/people/P+Spier> in InDesign - View the
    full discussion <https://forums.adobe.com/message/6627440#6627440>

  • Loading .JPG`s from Server and Reusing them in .SWF

    Hi everyone!
    Suppose I want to load a .jpg from the server ONCE and then I want to reuse it a dozen times in my .swf...
    How can I achieve this without adding to the .swf`s file size? I was thinking copying its BitmapData a dozen times, but that adds to the file size, right?
    Thanks!

    The weight of the file doesn't change when you load/create content dynamically.
    (I gotta get my post traffic control system working again--too many close calls lately)

  • Load a class from strea

    Hi i have a strange problem:i save a class object in a database blob then i want to read the object and set them in to the class path.Is possible?

    i save a class object in a database blob then i want to read the object Do you save a Class or an instance of that Class?
    set them in to the class path.Is possible?If you want to save a Class and load it, you need a custom ClassLoader which can read the blob and call defineClass with the bytes.
    If you want to save an Object and load it, you need to read the bytes and then use an ObjectInputStream to read the object. The Class must be on the system classpath or you need to subclass ObjectInputStream and (I think) override resolveClass.

  • How to load a class from its name.

    Hi,
    In my program, I want users can write their own classes, these classes need to implement an interface and name of class will be stored in database. I use Class.forName() to load these classes but I cannot type-cast to interface. Please help me.
    Here is the code in my program:
    public interface A {
    public void doSomething();
    public class test {
    public static void main(String[] args) {
    A clazz = (A)Class.forName("MyClass"); // error here
    A.doSomething();
    }

    Hai,
    Refine your test class as follows:
    public class test
    public static void main(String arg[])
    try
    Class clazz = Class.forName("MyClass");
    Object obj = clazz.newInstance();
    ((MyClass)obj).doSomething();
    catch(Exception ex)
    System.out.println(ex);
    Regards
    Raja.

Maybe you are looking for

  • End to End Monitoring

    Hello, I have implemented this scenario : "Flat file ->mapping->BPM (for calling a bapi)->mapping->Flat file" and when i use the message monitoring sometimes end-to-end monitoring is available and sometimes not, Why ??? Is there a specific configurat

  • Linking a pdf in dreamweaver

    I am learning dreamweaver and I have read and watched many videos on linking a pdf in my web page yet I am still having trouble. I have the file in my webpage folder, called 10brochure.pdf when I view it in sarafi before I upload it, it shows the fil

  • [svn:fx-trunk] 13130: Needed to add masking code to ListBase as well.

    Revision: 13130 Revision: 13130 Author:   [email protected] Date:     2009-12-21 14:11:16 -0800 (Mon, 21 Dec 2009) Log Message: Needed to add masking code to ListBase as well. QE Notes: I saw 5 bitmap failures in gumbo/components/MXItemRenderer.  The

  • ODBC Connection problems

    If anyone can help, please do - I've been at this for 8 hours now and am no further forward! I'm trying to create a form with about 10 fields (2 of which are drop down lists) that users will enter data into over an intranet. The data should then go i

  • Adobe Flash Player 11.7.700.202 Help!!

    Adobe Flash Player 11.7.700.202 I have downloaded Adobe Flash Player 11.7.700.202 and it came back download successful. NoNoNo next time I wanted to a view a video it says to download FP again. It is listed in my computer. Does anyone have any sugest