Can't Access A Class

Hello everyone...i have a program that's composed of a html,jsp and a .java page...i use bean....i have reversed engineer this system i got it is a forum site made of jsp and javabeans...my problem is that it can't reach the class from a .java file...i have put out.write or System.out.print so that i know where the pages stops..but i am unable to figure out why it stops...there's no error it just gives me a blank page...
here is my add_user.html
<html>
<body>
<form action ="add_user.jsp" method ="POST">
Name: <input type = "text" name="name" size=5><br>
Password: <input type = "password" name="password" size=5><br>
Confirm Password: <input type = "password" name="cpassword" size=5><br>
User Type:
<select name="workgroup_id">
<option value="x" selected="Selected">Select User Type</option>
<option value="1">Physician</option>
<option value="2">Scheduler</option>
<option value="3">Clerk</option>
<option value="4">Technologist</option>
<option value="5">Radiologist</option>
<option value="6">Transcriptionist</option>
</select><br>
Default Worklist: <input type = "text" name="dworklist" size=5><br>
Default Forms: <input type = "text" name="dforms" size=5><br>
Printer: <input type = "text" name="printer" size=5><br>
<br>
<br>
<input name="create" type = "submit" value="Submit">
<input type = "reset" value="Clear">
</form>
</body>
</html>and here is my add_user.jsp
<jsp:useBean id="Users" class="ris.Users"/>
<%@ page import="java.util.*" %>
<%
     String name=request.getParameter("name");
     String password=request.getParameter("password");
     String workgroup_id=request.getParameter("workgroup_id");
     String dworklist=request.getParameter("dworklist");
     String dforms=request.getParameter("dforms");
     String printer=request.getParameter("printer");
     if(request.getParameter("create") != null) {            out.write("pasok2");
          if(Users.checkReg(name, workgroup_id)) {
          out.write("pasok");
%>and here is my Users.java
package ris;
import java.sql.*;
import java.util.*;
public class Users {
     private int user_id;
     private String name, password, dworklist, dforms, printer, workgroup_id;
     public boolean checkReg(String name, String workgroup_id) {
     System.out.print("pasok1");
               String query = "SELECT User_ID FROM users WHERE [Name]='" + name + "' AND [Workgroup_ID]='" + workgroup_id + "'";
          try {
               String driver = "org.gjt.mm.mysql.Driver";
               Class.forName(driver).newInstance();
               String url="jdbc:mysql://localhost/ris?user=root&password=restricted";
               Connection con=DriverManager.getConnection(url);
               Statement stat = con.createStatement();
               ResultSet rst = stat.executeQuery(query);
               if(rst.next() == false) {
                    con.close();
                    return true;
               else {
                    con.close();
                    return false;
          catch(Exception e) {
               e.printStackTrace();
               return false;
}see that word "pasok" there that's what i use to know up to where my program really goes...
here is where my program stops...if(Users.checkReg(name, workgroup_id)) {
please help me...thanks....

Do you recall what version you had before, i.e., 6.0.1 or 3.6.22?
There's no easy way to peel off an update. You could reinstall an earlier version over what you have, but it might be faster to run a "portable" version of Firefox from a USB flash drive for those sites that are not compatible on an emergency basis.
http://portableapps.com/apps/internet/firefox_portable/localization#legacy36

Similar Messages

  • How can I access another class in a MembershipRule's Expression

    Hello,
    I want to create an InstanceGroup using Module Microsoft.SystemCenter.GroupPopulator.
    I need to collect all Logical Disks which contain an MS SQL DB Log File.
    I would start as follows:
    <DataSource ID="DS" TypeID="SC!Microsoft.SystemCenter.GroupPopulator">
      <RuleId>$MPElement$</RuleId>
      <GroupInstanceId>$Target/Id$</GroupInstanceId>
      <MembershipRules>
        <MembershipRule>
          <MonitoringClass>$MPElement[Name="Windows!Microsoft.Windows.LogicalDisk"]$</MonitoringClass>
          <RelationshipClass>$MPElement[Name="MSIL!Microsoft.SystemCenter.InstanceGroupContainsEntities"]$</RelationshipClass>     
    <Expression>
            <And>
      <!--
       First Expression
      -->
              <Expression>
                <SimpleExpression>
                  <ValueExpression>
                    <Property>$MPElement[Name="Windows!Microsoft.Windows.LogicalDevice"]/Name$</Property>
                  </ValueExpression>
                  <Operator>Equal</Operator>
                  <ValueExpression>
      <!--
        How can I access another class's properties ? 
      -->
                    <GenericProperty>$MPElement[Name="SQL!Microsoft.SQLServer.2008.DBLogFile"]/Drive$</GenericProperty>
                  </ValueExpression>
                </SimpleExpression>
              </Expression>
              <Expression>
                <SimpleExpression>
                  <ValueExpression>
                    <HostProperty>
                      <MonitoringClass>$MPElement[Name="Windows!Microsoft.Windows.Computer"]</MonitoringClass>
                      <Property>PrincipalName</Property>
                    </HostProperty>
                  </ValueExpression>
                  <Operator>Equal</Operator>
                  <ValueExpression>
                    <GenericProperty>$MPElement[Name="SQL!Microsoft.SQLServer.2008.DBLogFile"]/Drive$</GenericProperty>
                  </ValueExpression>
                </SimpleExpression>
              </Expression>
            </And>
          </Expression>
        </MembershipRule>
      </MembershipRules>
    </DataSource>
    In the first expression you "see" my question:
    I want to compare the LogicalDisk's Name Property with the DB Log File's Drive property.
    But how can I access the DB Log File's Drive property in this MembershipRule ?
    Furthermore LogicalDisk and DB Log File must be hosted on the same Windows Computer.
    Would be great if somebody could help.
    Thanks
    Sebastian

    Hi Niki,
    thanks for the idea, but that will not work. $Target/Id$ refers always to the group to be discovered.
    On last week end I was given following idea, hope it will work:
    Step 1
    Collect all the DB SQL Logfile Objects and write computername (PrincipalName?) and Driveletter into a textfile, line by line. Shouldn't be a problem, PowerShell is your friend.
    Step 2
    Read the file from Step 1, build discovery data for each disk drive as object of class "Logical Disk (Server)",
    and then discover the containment-relationships from those Logical Drive(Server) Objects to the InstanceGroup.
    Perhaps I must do it for the OS-Version related Disks, because I need the target classes  of the Logical Disk Freespace monitors. Some more work. "Risks": I donot know the discovery algorithm for the Logical Disk(Server) Objects, but a "deep
    dive" into the MPs should help.
    Thanks to all, who have read.
    I will inform you about progress and success
    sebastian

  • The online course that I am taking uses firefox 4.0 but when I updated to 5.0 I can't access my classes. I need to go back to 4.0 to do my work. how do I get a 4.0 version, ASAP?

    I have been taking online courses at Colorado Tech and when my firefox updated to 55.0, my classes were mot accessible because they suppported version 4.0 or lower. I can't seem to find a version 4.0 to go back to, since 4.0 has been working fine for me. Iif not, I will have to go with google chrome. I need a solution ASAP.

    I had this same problem when my school's email page refused to work in Firefox 5. I solved it by installing the User Agent RG extension, then changing my user agent to IE7 before accessing my school email. Once you install the extension, you'll have to show your menu bar when you want to use it, then you'll find the User Agent submenu under the Tools menu. Hope this works for you, too.
    https://addons.mozilla.org/en-US/firefox/addon/user-agent-rg/

  • Inner classes can't access parent classes in constructor

    I'm having a problem where I have class A, which has an Inner class B, which has it's own inner class C. In C's constructor (the inner most class), i'm trying to access a method of A (the top most class), and I get a NullPointerException with trace:
    at mearns.finance.DefaultPortfolio.access$0(DefaultPortfolio.java:1)
    at mearns.finance.DefaultPortfolio$AccountsEditor$AccountsTableModel.<init>(DefaultPortfolio.java:253)
    In this case "DefaultPortfolio" is class A, AccountsEditor is class B, and AccountsTableModel is class C. The line given in the second stack trace element is the line in C's constructor which calls Class A's method.
    Debugging, I stop inside C's constructor. Before anything happens, debugger says this$1 is null. Then I step, and it calls super(), and now this$1 is an instance of class B (AccountEditor), but it's own this$1 (which should be an instance of class A) is still null.
    I'm calling C's constructor from within B's constructor (but not A's), not sure if that makes a difference.
    Can anyone explain what's going on here, and (hopefully) how I can work around it?
    Thanks for any help.
    When i debug

    hm, I really don't know what is happening but I want to tell you about something that is not nice in your code and possibly it could cause the error.
    Code behaves somwhat strange when you pass this out of a constructor. You do this implicitly when you create an inner classe which implicitly gets a reference to the outer class. Also just simple method calls can cause such effects.
    This is because the construction process it not finished but methods are already called.
    Even worse: the sub classes constructor possibly did not even start. Special to java is the fact that a method call can lead to an overridden method of a sub class who's constructors has not even passed the super() command.
    My guess now is that you have that some kind of this situation in your code. You create an inner class in a constructor. That inner class calls back a method on the outer class. Now say that the method you are calling is defined in a sub class who's constructor still stucks in super() call. There we are.
    I found a thread in a news group that covers exactly this problem:
    It is therefore a good idea only to call private methods from constructors (that should then also call only private methods). Also if inner classes are created in the constructor then they should not call any non trivial / non private methods of the outer class. Calling overridden methods out of constructors should be avoided strictly!
    Perhaps this has nothing to do with your problem. I cannot tell for sure.
    But this sounds quite interesting.
    Please tell me if my guess was right and if not post simple code the illustrated your problem.
    Here a simple example also throwing NullPointerException:
    class Outer {
      int i = 42;
      abstract class InnerSuper {
        InnerSuper() {
          foo();
        abstract void foo();
      class InnerSub extends InnerSuper {
        void foo() {
          System.out.println(i);
      public void bar() {
        new InnerSub();
      public static void main(String[] args) {
        Outer o = new Outer();
        o.bar();
    } It causes a NullPointerException because the InnerSub constructor did not run. I copied the example from a news group thread i found.
    http://groups.google.de/group/comp.lang.java.programmer/browse_thread/thread/897fba792d689b29/a1ba2ed708636a30?q=inner+class+outer+this+reference+NullPointerException&rnum=4&hl=de#a1ba2ed708636a30
    Here is a even simpler example of strange behavior - even without NullPointerExceptions.
    class A {
         A() {
              System.out.println(getName());
         String getName() {
              return "A";
    class B extends A {
         String NAME = "B";
         String getName() {
              return NAME;
    new B();It will output null instead of B.
    regards
    Sven

  • Client can't access Serializable classes on Server

    Hi there, i have created a very simple client server model and had it running fine. I then added a new serializable class to the server and return it in a new method. Now when i try to run that method on the client side it complains it cannot find my new serializable class ("no class def found exception: rmi/server/ServerObject.class"). This is how it's setup at the moment:
    Server
    -ServerFront extends Remote
    -Server implements ServerFront
    -ServerObject implements Serializable
    The server binds itself to the registry as such:
    ServerFront engine = new Server();
    String name = "Server";
    ServerFront stub = (ServerFront)UnicastRemoteObject.exportObject(engine, 0);
    Registry registry = LocateRegistry.getRegistry();
    registry.rebind(name, stub);The ServerObject class looks like this:
    public class ServerObject implements Serializable
        private static final long serialVersionUID = 10L;
        //methods
    }The ServerFront interface has a method as such:
    ServerObject getServerObject () throws RemoteException;    Client
    -Client
    The client gets a reference to the server as follows:
    String name = "Server";
    Registry registry = LocateRegistry.getRegistry("127.0.0.1");
    server = (ServerFront)registry.lookup(name);Then tries to run the getServerObject() method:
    ServerObject = server.getServerObject();I run the client and server from jar files using the following commands:
    start java -Djava.rmi.server.codebase="http://www.xenwars.com/Server.jar" -Djava.security.policy=security.policy -jar Server.jar
    java -Djava.security.policy=security.policy -jar Client.jar"security.policy" allows all access, and the codebase URL points to my webserver where i uploaded an identical copy of the Server jar file that i'm trying to run.
    So... i've read all the Sun documentation and such and i'm massively confused why my client isn't simply downloading the serializable class as it's supposed to. Any help is massively appreciated, thanks :D
    Edited by: Aldarn on Feb 8, 2009 10:03 AM
    Edited by: Aldarn on Feb 8, 2009 10:05 AM

    By a mirrored interface i mean i just created an interface based off my existing serializable classes, i.e. copied the method constructors into an interface class and made the serializable class implement that interface.
    I think that must have been the problem then, that i wasn't giving the client an interface to the serializable classes on the server that it was attempting to download. I thought by using RMI on a serializable class it would just download that class when it needs it and so wouldn't need an interface pre-defining it.
    Thanks for the help! I'm now working on a system with 3 servers and one client, where two servers have various methods implemented and the third one acts as a bridge between the other two servers and the client - so the client only has to deal with one server. It's working fine but it's pretty annoying having to mirror all the methods from both servers' interface classes in the server that acts as a bridge's interface class - is there any way that the bridge server can inherit the other two servers interfaces into its own so i don't need to make loads of duplicate "shell" methods like this:
    // second server
    public ArrayList<Thing> getAllThings ()
        return things;
    // bridge server
    private SecondServerFront secondServer; // reference loaded in constructor
    public ArrayList<Thing> getAllThings () throws RemoteException
        return secondServer.getAllThings();
    }  

  • Accessing IFS classes from Weblogic

    Can I access the classes of IFS from within Weblogic by adding the IFS jars to the Classpath of Weblogic?
    Also how does EJBs work with IFS?
    Kaustuva Mukherjee

    I'm doing exactly the same thing that you are asking. first install ifs client on weblogic server, so that all ifs jar files are on weblogic. then do this in the weblogic class path file:
    REM ------------------ IFS CLASSPATH ------------------------
    SET IFS_CLASSPATH=d:\Oracle\Ora81\ifs1.1\lib\adk.jar;d:\Oracle\Ora81\ifs1.1\lib\clientlib.jar;d:\Oracle\Ora81\ifs1.1\lib\cmdlineutils.jar;d:\Oracle\Ora81\ifs1.1\lib\cup.jar;d:\Oracle\O ra81\ifs1.1\lib\http.jar;d:\Oracle\Ora81\ifs1.1\lib\oemadmin.jar;d:\Oracle\Ora81\ifs1.1\lib\release.jar;d:\Oracle\Ora81\ifs1.1\lib\repos.jar;d:\Oracle\Ora81\ifs1.1\lib\utils.jar;d: \Oracle\Ora81\ifs1.1\lib\webui.jar;d:\Oracle\Ora81\ifs1.1\settings
    and include IFS_CLASSPATH in your weblogic path.
    restart weblogic and u'll have all ifs classes for your use.
    null

  • Can not access the Instance Data of a Singleton class from MBean

    I am working against the deadline and i am sweating now. From past few days i have been working on a problem and now its the time to shout out.
    I have an application (let's call it "APP") and i have a "PerformanceStatistics" MBean written for APP. I also have a Singleton Data class (let's call it "SDATA") which provides some data for the MBean to access and calculate some application runtime stuff. Thus during the application startup and then in the application lifecysle, i will be adding data to the SDATA instance.So, this SDATA instance always has the data.
    Now, the problem is that i am not able to access any of the data or data structures from the PerformanceStatistics MBean. if i check the data structures when i am adding the data, all the structures contains data. But when i call this singleton instance from the MBean, am kind of having the empty data.
    Can anyone explain or have hints on what's happening ? Any help will be appreciated.
    I tried all sorts of DATA class being final and all methods being synchronized, static, ect.,, just to make sure. But no luck till now.
    Another unfortunate thing is that, i some times get different "ServicePerformanceData " instances (i.e. when i print the ServicePerformanceData.getInstance() they are different at different times). Not sure whats happening. I am running this application in WebLogic server and using the JConsole.
    Please see the detailed problem at @ http://stackoverflow.com/questions/1151117/can-not-access-the-instance-data-of-a-singleton-class-from-mbean
    I see related problems but no real solutions. Appreciate if anyone can throw in ideas.
    http://www.velocityreviews.com/forums/t135852-rmi-singletons-and-multiple-classloaders-in-weblogic.html
    http://www.theserverside.com/discussions/thread.tss?thread_id=12194
    http://www.jguru.com/faq/view.jsp?EID=1051835
    Thanks,
    Krishna

    I am working against the deadline and i am sweating now. From past few days i have been working on a problem and now its the time to shout out.
    I have an application (let's call it "APP") and i have a "PerformanceStatistics" MBean written for APP. I also have a Singleton Data class (let's call it "SDATA") which provides some data for the MBean to access and calculate some application runtime stuff. Thus during the application startup and then in the application lifecysle, i will be adding data to the SDATA instance.So, this SDATA instance always has the data.
    Now, the problem is that i am not able to access any of the data or data structures from the PerformanceStatistics MBean. if i check the data structures when i am adding the data, all the structures contains data. But when i call this singleton instance from the MBean, am kind of having the empty data.
    Can anyone explain or have hints on what's happening ? Any help will be appreciated.
    I tried all sorts of DATA class being final and all methods being synchronized, static, ect.,, just to make sure. But no luck till now.
    Another unfortunate thing is that, i some times get different "ServicePerformanceData " instances (i.e. when i print the ServicePerformanceData.getInstance() they are different at different times). Not sure whats happening. I am running this application in WebLogic server and using the JConsole.
    Please see the detailed problem at @ http://stackoverflow.com/questions/1151117/can-not-access-the-instance-data-of-a-singleton-class-from-mbean
    I see related problems but no real solutions. Appreciate if anyone can throw in ideas.
    http://www.velocityreviews.com/forums/t135852-rmi-singletons-and-multiple-classloaders-in-weblogic.html
    http://www.theserverside.com/discussions/thread.tss?thread_id=12194
    http://www.jguru.com/faq/view.jsp?EID=1051835
    Thanks,
    Krishna

  • Axis Fault: JavaProvider can not access a member of class Hello with mod.

    Hi,
    I am getting the following Axis Fault with content
    Exception in thread "main" AxisFault
    faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
    faultSubcode:
    faultString: java.lang.IllegalAccessException: Class org.apache.axis.providers.java.JavaProvider can not access a member of class Hello with modifiers ""
    faultActor:
    faultNode:
    faultDetail:
         {http://xml.apache.org/axis/}hostname:SNR143052
    java.lang.IllegalAccessException: Class org.apache.axis.providers.java.JavaProvider can not access a member of class Hello with modifiers ""
         at org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder.java:222)
         at org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.java:129)
         at org.apache.axis.encoding.DeserializationContext.endElement(DeserializationContext.java:1087)
         at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(AbstractSAXParser.java:633)
         at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanEndElement(XMLNSDocumentScannerImpl.java:719)
         at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(XMLDocumentFragmentScannerImpl.java:1685)
         at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:368)
         at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:834)
         at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:764)
         at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:148)
         at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1242)
         at javax.xml.parsers.SAXParser.parse(SAXParser.java:375)
         at org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java:227)
         at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696)
         at org.apache.axis.Message.getSOAPEnvelope(Message.java:435)
         at org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnderstandChecker.java:62)
         at org.apache.axis.client.AxisClient.invoke(AxisClient.java:206)
         at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
         at org.apache.axis.client.Call.invoke(Call.java:2767)
         at org.apache.axis.client.Call.invoke(Call.java:2443)
         at org.apache.axis.client.Call.invoke(Call.java:2366)
         at org.apache.axis.client.Call.invoke(Call.java:1812)
    The client code for the webservice using instant deployment is
    import java.net.URL;
    import javax.xml.rpc.ParameterMode;
    import org.apache.axis.client.Call;
    import org.apache.axis.client.Service;
    import org.apache.axis.encoding.XMLType;
    import org.apache.axis.utils.Options;
    public class ClientHello {
         public ClientHello(){
         public static void main(String[] args) throws Exception{
              Options options = new Options(args);
              String endpoint = "http://localhost:" + options.getPort()+"/WebServices/Hello.jws";
              args = options.getRemainingArgs();
              Service services = new Service();
              Call call = (Call) services.createCall();
              call.setTargetEndpointAddress(new URL(endpoint));
              call.setOperationName(args[0]);
              call.addParameter("op1",XMLType.XSD_STRING,ParameterMode.IN);
              call.setReturnType(XMLType.XSD_STRING);
              System.out.print(args[1]);
              String s = new String(args[1]);
              String result = (String) call.invoke(new Object[]{s});
              System.out.println(result);
    The hello.jws is as follows
    class Hello {
         public String hi(String message){
              return "Hello "+ message;
    I am not sure why the message is substituted with "" instead of the parameter i have sent in args[1].
    Please help me out in this regard.
    Thanks,
    winkidzz

    Thanks swatdba.
    Any idea on how to proceed with implementing Webservices using Websphere MQ?

  • Reflection problem: can not access a member of class java.lang.IllegalAcces

    package org.struts.ets.utility;
    import java.lang.reflect.Constructor;
    import java.lang.reflect.Field;
    import java.lang.reflect.InvocationTargetException;
    import java.util.ArrayList;
    import java.util.Iterator;
    import java.util.List;
    import org.struts.bean.FieldTrouble;
    import org.struts.bean.GenericDAOBean;
    public class DynamicObjectCreation
         public static void main(String... args)
              FieldTrouble ft = new FieldTrouble();
              try
                   Class<?> c = ft.getClass();
                   //Class<?> c = FieldTrouble.class;
                   /*Class<?> c = null;
                   try
                        c = Class.forName("org.struts.bean.FieldTrouble");
                   } catch (ClassNotFoundException e)
                        e.printStackTrace();
                   Field f = c.getDeclaredField("var1");
                   //f.setInt(ft, 42); // IllegalArgumentException
                   f.set(ft, new String("A"));
                   System.out.println(ft.getVar1());
                   // production code should handle these exceptions more gracefully
              } catch (NoSuchFieldException x)
                   x.printStackTrace();
              } catch (IllegalAccessException x)
                   x.printStackTrace();
    }// If I put FieldTrouble.java in any other package than the current package I am running this code from. I get the following error:
    java.lang.IllegalAccessException: Class org.struts.ets.utility.DynamicObjectCreation can not access a member of class org.struts.bean.FieldTrouble with modifiers ""
         at sun.reflect.Reflection.ensureMemberAccess(Unknown Source)
         at java.lang.reflect.Field.doSecurityCheck(Unknown Source)
         at java.lang.reflect.Field.getFieldAccessor(Unknown Source)
         at java.lang.reflect.Field.set(Unknown Source)
         at org.struts.ets.utility.DynamicObjectCreation.main(DynamicObjectCreation.java:35)
    I tried all possible ways of creating class as:
    Class<?> c = ft.getClass(); OR
    Class<?> c = FieldTrouble.class; OR
                   /*Class<?> c = null;
                   try
                        c = Class.forName("org.struts.bean.FieldTrouble");
                   } catch (ClassNotFoundException e)
                        e.printStackTrace();
    Edited by: ..-__Kris__-.. on Feb 21, 2008 10:26 AM
    Edited by: ..-__Kris__-.. on Feb 21, 2008 10:26 AM

    Any hidden performance or memory issue here?
    Let us consider an object:
    public class SomeObject
         private String fieldA;
         private String fieldB;
         private String fieldC;
         private String fieldD;
         private String fieldE;
         //... say 50 declared fields....
         public SomeObject()
         public SomeObject(String fieldA, String fieldB)
              this.fieldA = fieldA;
              this.fieldB = fieldB;
    // getters and setters..     
    }When I create an object using the constructor with only two fields initialized such as the following code above, and look at what is happening to other fields as shown in the code below, I see that they are also AVAILABLE, now this is important, but they are set to null. What I wanted to know was, if I created an object with many fields, as many as 50 (getDeclaredFields = 50), and used a constructor with only two input fields to initialize an object, I still have 48 other fields available but set as NULL's. When I create more than 100,000 of these objects in a list and send to a .jsp page, I am unable to understand if this has more memory load than when you use a list of another object which has actually has only two declared fields in it. Each of this new object will have only two declared fields, when I say getDeclaredFields() it would return 2.
    This is where I am unable to figure out if this has anything to do with performance or memory, rather, what is the difference between the many possible ways you can initialize an object when there are too many fields which you probably won't use? Either create a new constructor with only two input arguments OR a generic constructor with all fields as input arguments but all those fields which you won't use assigned NULL's OR create another new object with only two declared fields
    SomeObject someObj = new SomeObject("abcd","cdef");
              Field[] fields = someObj.getClass().getDeclaredFields();
              System.out.println("Number of available fields: " + fields.length);
              for(int i = 0 ; i < fields.length ; i++)
                   try
                        fields.setAccessible(true);
                        System.out.println("Field " + i + ", with value: " + fields[i].get(someObj));
                        fields[i].get(someObj);
                   } catch (IllegalArgumentException e)
                        e.printStackTrace();
                   } catch (IllegalAccessException e)
                        e.printStackTrace();
              }Edited by: ..-__Kris__-.. on Mar 23, 2008 5:04 PM
    Edited by: ..-__Kris__-.. on Mar 23, 2008 5:05 PM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Can not access a member of class Test with modifiers ""

    Hi!
    I am trying to get a application into a applet, but I just get this errormessage:
    Exception: Java.lang.IllegalAccessException: Class sun.applet.AppletPanel can not access a member of class Test with modifiers ""
    Anyone that have any idea whats wrong here?
    Best regards Raymond

    Post class where the exception was ocurred.

  • Can multiple processes access 1 class exclusively

    hi,
    i have three listener programs running in 3 consoles which listen to different queues.now i have a conection program which i call from my 3 listeners.the problem is that only 1 connection must be made at one time.i tried implementing the connection class as a singleton,but it doesnt work as the 3 listeners operate as 3 diff processes(my understanding).however if i implement all 3 listeners in 1 single program and start 1 program in console then the singleton works fine. so my question is is there a way i can synchronize the connection class from 3 listener programs running seperately in different consoles???
    maybe my understanding is wrong.excuse me if it is.
    any help will be highly appreciated... !!!!

    You could either run your three listeners as three threads in the same VM as the connection, or you can construct a means to enforce single access. Here are several possibilities for the latter. Some are better than others:
    * When a listener wants to connect, he opens a server socket on a particular port. The OS will only allow one listener on a port at a time, so while one listener holds the port, the others will wait their turns. The port is only used as a token to say whose turn it is.
    * Have the listeners open a separate connection to the connection program, to tell it when they want their turn. The connection program then tells each listener when it's his turn to open the "real" connection.
    * Have a separte process that accepts multiple connetions and recieves requests from the listeners, then forwards them on one-by-one to the connection program.
    * Give each listener a fixed block of time when it can connect. For example: L1 connects when minute % 9 == 0, L2 when m%0 ==3, L3 when m%0==6
    Or, you could remove the one-connection-at-a-time restriction. Is there a good reason to keep it?

  • Can't access a university location for class could with former FF version please retore me to the former FF (upgraded today now problems)

    Hey,
    Earlier today I clicked on for a FF upgrade. Now I no longer am able to get Skype, and can not access my University of Dallas imba site to listen to today's lecture and access notes etc...crucial...I took the afternoon off from work to do this...and I am clearly frustrated...moral...if it ain't broke don't fix it...less is more.. PLEASE RETURN ME TO MY FORMER FIREFOX STATUS - WHICH CRASHED TOO MUCH, BUT I COULD
    GET BACK TO IT.
    Imba tells me that my browser will not allow me to get to the online course.
    Worked fine yesterday :)
    Thank you.

    Do you recall what version you had before, i.e., 6.0.1 or 3.6.22?
    There's no easy way to peel off an update. You could reinstall an earlier version over what you have, but it might be faster to run a "portable" version of Firefox from a USB flash drive for those sites that are not compatible on an emergency basis.
    http://portableapps.com/apps/internet/firefox_portable/localization#legacy36

  • How can I access the Attribute Values from the Search Region

    Hi all,
    I have a table which contains Company id, department id, and PositonId. For a particular Company and Department there may be multiple records.
    I have to pupulate a table which contains the position and other details that comes under a particular Department and Position based on the selection in the Three comboBoxes.
    Also I have to populate a select many Shuttle to add new postions and records under a particular Department.
    I created a query panel *(Search Region)* for the serch and a table to display the data. That is working fine.
    Now the issue is I am using a view criteria to populate the shuttle with two bind variables ie, DepartmentId and CompanyId.
    If the serach will return a resuktant set in the table it will also pupulate the correct records, otherwise ie, if the if the serch result is empty the corresponding iterator and the attribute is setting as null.
    SO I want to access the attribute values from the Search Region itsef to populate the shuttle.
    I don't know how can I access the data from the Search Region.
    Please Help.
    Regards,
    Ranjith

    you could access the parameters entered in search region by the user as follows:
    You can get handle to the value entered by the user using queryListener method in af:query.
    You can intercept the values entered as described
    public void onQueryList(QueryEvent queryEvent) {
    // The generated QueryListener replaced by this method
    //#{bindings.ImplicitViewCriteriaQuery.processQuery}
    QueryDescriptor qdes = queryEvent.getDescriptor();
    //get the name of the QueryCriteria
    System.out.println("NAME "+qdes.getName());
    List<Criterion> searchList = qdes.getConjunctionCriterion().getCriterionList();
    for ( Criterion c : searchList) {
    if (c instanceof AttributeCriterion ) {
    AttributeCriterion a = (AttributeCriterion) c;
    a.getValues();
    for ( Object o : a.getValues()){
    System.out.println(o.toString());
    //call default Query Event
    invokeQueryEventMethodExpression("#{bindings.ImplicitViewCriteriaQuery.processQuery}",queryEvent);
    public void onQueryTable(QueryEvent queryEvent) {
    // The generated QueryListener replaced by this method
    //#{bindings.ImplicitViewCriteriaQuery.processQuery}
    QueryDescriptor qdes = queryEvent.getDescriptor();
    //get the name of the QueryCriteria
    System.out.println("NAME "+qdes.getName());
    invokeQueryEventMethodExpression("#{bindings.ImplicitViewCriteriaQuery.processQuery}",queryEvent);
    private void invokeQueryEventMethodExpression(String expression, QueryEvent queryEvent){
    FacesContext fctx = FacesContext.getCurrentInstance();
    ELContext elctx = fctx.getELContext();
    ExpressionFactory efactory = fctx.getApplication().getExpressionFactory();
    MethodExpression me = efactory.createMethodExpression(elctx,expression, Object.class, new Class[]{QueryEvent.class});
    me.invoke(elctx, new Object[]{queryEvent});
    Thanks,
    Navaneeth

  • Problem with Dynamically accessing EJB Class objects in WL 7.0 SP1

    I am trying to build a component which has the ability to instantiate and execute
    an known EJB method on the fly.
    I have managed to build the component but when I try and execute it I get a ClassNotFoundException.
    I know that the EJB I am trying to invoke is deployed and available on the server,
    as I can see it in the console, I also seen to have been able to get the remote
    interface of the object, my problem occurs when I try and access the class object
    so I can perform a create on the object and then execute my method
    The code I have written is below:
    private Object getRemoteObject(Context pCtx, String pJNDIName, String pHomeBean)
    throws Exception {
         String homeCreate = "create";
         Class []homeCreateParam = { };
         Object []homeCreateParamValues = {};           
    try {  
    //This call seems to work and doesn't throw an exception     
    Object home = pCtx.lookup(pJNDIName);
    //However this call throws a java.lang.ClassNotFoundException
    Class homeBean = Class.forName(pHomeBean);
    Method homeCreateMethod = homeBean.getMethod(homeCreate,homeCreateParam);
    return homeCreateMethod.invoke(home, homeCreateParamValues);
    } catch (NamingException ne) {             
    logStandardErrorMessage("The client was unable to lookup the EJBHome.
    Please make sure ");
    logStandardErrorMessage("that you have deployed the ejb with the JNDI
    name "+pJNDIName+" on the WebLogic server ");
    throw ne;
    } catch (Exception e) {
    logStandardErrorMessage(e.toString());
    throw e;     
    Any advice would be really appreciated, I'm fast running out of ideas, I suspect
    it has something to do with the class loader but I'm not sure how to resolve it
    Regards
    Jo Corless

    Hello Joanne,
    Congratulations! I'm very happy that you've managed to fix your problem. It's
    always essential to understand how to package applications when deploying on BEA
    WebLogic. Usually, by throwing everything into an EAR file solves just about all
    the class loader problems. :-) Let us know if you have any further problems that
    we can assist you with.
    Best regards,
    Ryan LeCompte
    [email protected]
    http://www.louisiana.edu/~rml7669
    "Joanne Corless" <[email protected]> wrote:
    >
    >
    I've fixed it!!!!!!!!
    Thanks to everyone who gave me help!!!!
    The class loader was the culprit which is what I suspected all along.
    As soon
    as I put the 2 jar files I was using into an EAR file the problem went
    away!!!!!
    Thanks again
    Jo Corless
    "Ryan LeCompte" <[email protected]> wrote:
    Hello Joanne,
    As Mr. Woollen mentioned, I also believe it's a problem with the class
    loader.
    You need to be careful how you arrange your EJBs, because WebLogic has
    a specific
    method in which it loads classes in an EAR, JAR, and WAR file(s). Please
    refer
    to http://dev2dev.bea.com/articles/musser.jsp for more information about
    BEA WebLogic
    class loading mechanisms and caveats. Also, try printing out the various
    methods
    that are available on the object that was returned to you via reflection.
    For
    example, use the getMethods() method, which returns an array of Method
    objects
    that you can subsequently cycle through and print out the various method
    names.
    This way you can discover if the class found/returned to you is indeed
    the one
    you intend to locate.
    Hope this helps,
    Ryan LeCompte
    [email protected]
    http://www.louisiana.edu/~rml7669
    Rob Woollen <[email protected]> wrote:
    I believe the issue is the home interface class for this EJB is not
    available in the class loader which is doing the reflection.
    If you do:
    getClass().getClassLoader().loadClass(homeInterfaceClassName)
    I suspect it will fail. Reflection still requires that the class be
    loadable.
    -- Rob
    Joanne Corless wrote:
    Hi Slava,
    If I make my code look like you describe below I get a compliationerror telling
    me that
    home.getMethod() is not recognised (no such method)
    If I change it slightly and use
    Method homeCreateMethod =
    home.getClass().getMethod(homeCreate,homeCreateParam);
    The code will compile OK but when executed it still throws a NoSuchMethodException
    Any ideas ?
    Thanks for your help so far
    Regards
    Jo Corless
    Your code should look like
    Object home = pCtx.lookup(pJNDIName);
    Method homeCreateMethod =
    home.getMethod(homeCreate,homeCreateParam);
    return homeCreateMethod.invoke(home, homeCreateParamValues);
    Regards,
    Slava Imeshev
    "Joanne Corless" <[email protected]> wrote in message
    news:[email protected]...
    Hi Ryan,
    I also wanted to mention that if you do a "header search" in this
    particular
    newsgroup
    with the search query as "reflection", you will see many previousmessages
    regarding
    reflection and EJBs. I believe you could learn a lot from thedifficulties
    that
    others have faced and solved.I tried that and although there was a number of similar cases noneof them
    actually
    seem to fix my issue. Thanks for the suggestion though
    Are the EJBs that you are trying to access accessible via your
    system
    classpath?
    Try to avoid having them accessible via the main system classpath,and
    only bundle
    them in your appropriate EJB jar files (contained in an EAR file,for
    example).Maybe I should have laid the problem out a little clearer.
    I have a number of EJB's bundled up in a JAR file which is hot deployedto
    the
    server. Within this first JAR file is an EJB (SSB) component that
    needs
    to
    be
    able to invoke a known method on another EJB. This second EJB may
    or
    may
    not be
    within the first JAR file but it also will be hot deployed.
    The component trying to invoke the method on the 2nd EJB has to
    be
    able to
    create
    an instance of the 2nd EJB without actually knowing anything bar
    a
    JNDI
    Name which
    is passed in at runtime.
    I can get as far as doing the
    Object home = pCtx.lookup(pJNDIName);
    This returned a class with the name
    "com.csc.edc.projects.allders.httppostoffice.postman.PostmanBean_mp8qy2_Home
    Impl_WLStub"
    My problem seems to occur when I try and invoke the create method
    Method homeCreate = home.getClass().getMethod("create", new Class[0]);
    My code throws a java.lang.NoSuchMethodException at this point so
    I
    am
    unable
    to progress to the next step of :
    Object bean = homeCreate.invoke(home, null);
    So I can return the instantiated bean back to the calling client.
    Why am I getting the NoSuchMethodException, is is because I am gettinga
    stub
    back rather than the home interface and if so how do I get the truehome
    interface
    from the bean
    Thanks in advance
    Jo Corless

  • How can I split a class into 2 files?

    I converted a C++ program to Java recently and it works fine, but I ran into a problem.
    One file is very large and I need to add more functionality. Unlike with C++ where you can just put new functions in another file, I don't see a way to do it in Java.
    I made another file, and therefore another class, but the compiler complains that it can't call a static function from non-static context. (I did not declare it static so I guess it's assuming it) But I understand why. So I made the new class "extend" the old one so "this" would exist but that doesn't work -- Is it because the new class is a subclass of the original class?
    There must be a way to do this. But I don't see what is likely obvious. HELP! And thanks.

    JavaIsBetterThanCPP wrote:
    There must be a way to do this. But I don't see what is likely obvious. HELP! And thanks.Unfortunately Java has no concept of "partial classes" like C# has. Generally, however, a class that is large enough to split up into separate files is either one class that should be modularized further into separate classes, or it already is modularized and all that code is the result of many inner classes. What some people do is promote those inner classes to top-level members in their own file, and mark them as package-private. Using a package you can basically have two classes that know everything about each other and have full access to each other.
    But personally, and until I see justification otherwise, semantics in Java being unbreakingly tied to a certain file structure and naming is the most bonehead and, frankly, non-Java thing about Java.
    There's probably a pre-processor out there that will let you split a class into multiple files and will combine them into a single source file just-in-time to pass to the compiler.

Maybe you are looking for

  • Error when install Oracle XE in Ubuntu: invalid user && ...

    When I install Oracle XE in Ubuntu I got message from Terminal /bin/chown: `oracle:dba': invalid user /bin/chown: `oracle:dba': invalid user /bin/chmod: cannot access `/etc/init.d/oracle-xe': No such file or directory /var/lib/dpkg/info/oracle-xe-uni

  • How can I find out the total number of gigabytes of all my photos in Iphoto?

    How can I find out the total number of gigabytes of all my photos in Iphoto?

  • Use of MM condition type into Sales Pricing

    Dear All I am having two MM Condition types in STO pricing procedure which are statistical in nature. Condition type A is having condition category G (Cost) and B is having H (Base Price). I have created both the condition types in SD side using V/06

  • Quantity determination for printing labels

    Folks, How and where can I configure how many labels should be printed for a delivery? I.e. I have a material label with customer address and order number on it and depending on the material, we should have different quantities of labels. For example

  • SQL  to find which table data is stored?

    I know a table field value. I don't know, which table that value is stored. I want to find that table from database. What sql will find that?. Please post me online links for tricky sql's like this...so i can master sql's of this kind. Thanks for ur