Protected methods, what did i do wrong?

Hi there, I'm trying to understand why I cant access a Protected Method from a library that I'm trying to use..
Some guidance would be great:
public class Registration {
//Create new instance of ConnectionBean
ConnectionBean conBean = new ConnectionBean();
public Registration() {
public void regUser() {
String server = JOptionPane.showInputDialog( "Enter Server address" );
InetAddress inetaddress;
try {
conBean.connect( inetaddress = InetAddress.getByName( server ));
catch( UnknownHostException unknownhostexception ) {
Object aobj[] = {
"Cancel", "OK"
int i = JOptionPane.showOptionDialog(null, "Retry Server?", server +
": Not Responding", -1, 2, null, aobj, aobj[1]);
if( i == 1 )
regUser();
System.out.println( "Cannot resolve " + server + ":" + unknownhostexception.toString ());
return;
catch( IOException ioexception ) {
Object aobj1[] = {
"Cancel", "OK"
int j = JOptionPane.showOptionDialog( null, "Cannot Connect to:",
server,-1, 2, null, aobj1, aobj1[1] );
if( j == 1 )
regUser();
System.out.println( "Cannot connect " + server);
return;
System.out.println( "Registering User" );
registrationProcess();
public void registrationProcess () {
InfoQueryBuilder iqb = new InfoQueryBuilder();
InfoQuery iq;
IQRegisterBuilder iqRegb = new IQRegisterBuilder();
IQRegister iqReg = new IQRegister( iqRegb );
try {
//Need to getXMLNS packet method getXMLNS() is protected
iqReg.getXMLNS();
catch ( InstantiationException e ) {
System.out.println( "Error in building Registration packet" );
String username = JOptionPane.showInputDialog( "Enter: Username" );
String password = JOptionPane.showInputDialog( "Enter: Password" );
The error as would be expected:
Registration.java:96: getXMLNS() has protected access in org.jabber.jabberbeans.Extension.IQRegister
iqReg.getXMLNS();
^
1 error
Appreciate the help!! :)

I tried to extend the class to make it a subclass of IQRegister (which holds the protected method) but I'm getting this error:
Reg.java:19: cannot resolve symbol
symbol : constructor IQRegister ()
location: class org.jabber.jabberbeans.Extension.IQRegister
public class Reg extends IQRegister {
^
1 error
Any ideas?
thanks

Similar Messages

  • When I scan and save the document to pdf, it comes out complete grayed out.  What did I do wrong?

    When I scan and save the document to a pdf, it comes out completely grayed out.  What did I do wrong?

    Thank you.  I already have that checked.   After an update, it started doing this.   Preferences> Display>Page Content & Info > Show large images is checked.
    It is almost like a protection on the document that grays out all the content.

  • What did i do wrong

    I inserted a new method into the code, and it seems to work alright, but it doesn't solve the problem.
    import java.util.*;
    public class Summer
       public static void main (String[] args)
         Scanner in = new Scanner(System.in);
         int first = 0;
         int last = 0;
         int total = 0;
         int i = 0;
         System.out.println("Hello. I will calculate the sum");
         System.out.println("of consecutive integers.");
         System.out.println("Please enter the starting number:");
         first = in.nextInt();
         System.out.println("Please enter the ending number:");
         last = in.nextInt();
         while (last < first)
           System.out.println(last + " is smaller than " + first);
           System.out.println("The ending number must be bigger than the first");
           System.out.println("Enter the starting number again");
           first = in.nextInt();
           System.out.println("Enter the ending number again");
           last = in.nextInt();
           System.out.println("The sum of the numbers are " + total);
           total = sum(last, first);
                 for (i = first; i <= last; i++)
             total = total + i;     
                  public static int sum(int num1, int num2)
                       int result;
                       result = num1 + num2;
                       return result;
    }what did i do wrong?

    I'm going to try to list the things you could fix here to make this better code. It might seem like a lot and I'm not trying to be mean or rude, I'm just trying to be helpful.
    First this part of your code:
    System.out.println("Hello. I will calculate the sum");
         System.out.println("of consecutive integers.");
         System.out.println("Please enter the starting number:");
         first = in.nextInt();
         System.out.println("Please enter the ending number:");
         last = in.nextInt();
         while (last < first)
           System.out.println(last + " is smaller than " + first);
           System.out.println("The ending number must be bigger than the first");
           System.out.println("Enter the starting number again");
           first = in.nextInt();
           System.out.println("Enter the ending number again");
           last = in.nextInt();
           System.out.println("The sum of the numbers are " + total);
           total = sum(last, first);
         }This code is repetitive and can be shortened greatly. Notice that the result you are looking for is that the number "last" entered is greater than first. So why not begin the loop right away like this to reduce your code by almost half?:
    // bring this outside of the loop so that it only shows once
    System.out.println("Hello. I will calculate the sum");
    System.out.println("of consecutive integers.");
    // last and first are originally set equal to 0 so this loop will begin right away
    while (last <= first) {    
         System.out.println("Please enter the starting number:");
         first = in.nextInt();
         System.out.println("Please enter the ending number:");
         last = in.nextInt();
        // add an if statement to print the please re-enter message
       if (last <= first) {
           System.out.println(last + " not larger than " + first);
           System.out.println("The ending number must be bigger than the first");
    }Second,
    The total part should not be in the loop. Notice how in your original code, the total was inside the loop so even if incorrect numbers were entered, the total would be displayed. The user would then be asked to enter new numbers and the total would be displayed again. I am assuming that the wanted behavior is to only display the total when correct numbers are entered. So we need to take the total out of the loop.
    Third,
    in your orignal code:
    System.out.println("The sum of the numbers are " + total);
           total = sum(last, first);Here you are printing the value total before the total is calculated. That means that the value shown in the print will be incorrect. You must calculate the value of total before printing it.
    I think this will get to the point where the code is almost what you are looking for.
    Right now, your sum method simply adds the two numbers together, which could be done with a simple + sign, rather than writing a new method.
    The for loop which I can see in your code looks like it will perform the action you are looking for.
    What you need to do is move this for loop to the line just above the line where you are printing the total.
    This means that the for loop will calculate the total, and then print it. If you print the total before calculating it you won't see the right value.
    I hope this was clear and that it helped,
    let me know if you have more questions and I will try to be more clear.

  • After installing the trial version some edit functions became disabled, what did I do wrong?

    What am i doing wron taht when I load a .jpg file cut, crop and other functions are dissabled??

    Fede,
    Gracias por responderme.
    Te juro que la pantalla que te adjunto es la de un jpg recién cargado, SIN QUE YO HAYA HECHO MAS NADA
    Fijate que el botón de crop a la izquierda de la pantalla esta faltado
    De: Fede Gianni [email protected]
    Enviado el: martes, 18 de marzo de 2014 19:59
    Para: abirencwajg
    Asunto: after installing the trial version some edit functions became disabled, what did I do wrong?
    Re: after installing the trial version some edit functions became disabled, what did I do wrong?
    created by Fede <http://forums.adobe.com/people/Fede+Gianni>  Gianni in Foros de usuario a usuario - View the full <http://forums.adobe.com/message/6222123#6222123>  discussion

  • I need help to find and open a job app that I exported, was able to fill out and sign and saved and now can't open it? What did I do wrong?

    I need help to find and open a job app that I exported, was able to fill out and sign and saved and now can't open it? What did I do wrong?

    What file format did you export it to?

  • When user clicks on "Like Button," the counter increases but nothing shows up showing the user recommends my site to their friends. What did I do wrong?

    When user clicks on "Like Button," the counter increases but nothing shows up showing the user recommends my site to their friends. What did I do wrong?
    I used the iframe code from Facebook's "Like Button" site; and inserted the code in the html widget popup box, then positioned it where I wanted it on my page and published. It looks fine (though I had to add "http" before my url to get it to show up).
    So, when a user clicks on button, a pop-up opens asking for Facebook password. When I (the user) enter a password, nothing happens after that. I thought the idea was that a user would be able to show their friends that they like my website. After I entered my password in pop-up after clicking on "Like" I went to my facebook page (a company page) to see if it showed that I (the user that clicked on "Like" on iweb) recommended the website. But nothing showed up. I thought maybe it was because Facebook associated my password as the admin for the Facebook page so didn't count it. But a friend tried it and same thing happened. I went back and on one page I put in another facebook code for a combo Like/Send button. It shows up but acted the same as the regular Like button.
    Questions:
    1. Is this the way the Like Button is suppose to work? Only benefit of Like button being that it just counts the clicks on the Like button and does NOT let users share their recommendation with their friends?
    2. If it's suppose to let users share their "Likes" with their friends, what did I do wrong? There were three types of code but in reading discussions, they all say to use iframe. (I used the first choice which I think was html for Javascript SDK and put that in my HTML Snippit box and the Like/Share button showed up on my iweb page next to the facebook icon and the words "likes this" but when I click it, I don't see instructions that it's sending my recommendation to my friends.)
    I must have done something wrong, but can't figure out what. Does anyone know? If the only benefit of the Like Button is the counter, it doesn't seem worthwhile.
    Thanks to anyone who can figure this out!  My website is couponsforfun.com

    You want something like this?
    http://home.wyodor.net/demoos/facebook/
    The send button sends the link to their friends in the address field with a message.
    They recieve a message in the inbox.
    There's no post on a page.
    If they want that, then they should share the link themselves.
    Perhaps it's best to study what facebook has to offer and how it works instead of guessing what it is supposed to do and be disappointed.

  • Everytime I click on the firefox icon on my desktop it keeps reinstalling Firefox... why does this keep on happening? what did I do wrong?

    I have a yahoo_firefox icon on my desk top. When I click on it to go onto the internet it reinstalls firefox every single time first. What did i do wrong or what am I doing wrong? how can I fix this problem?

    In my opinion this icon what you mentioned is related to Firefox installer file.

  • I had microsoft exchange added and when I synced I lost all of my prior contacts. Also, thenames all turned to numbers.  Example when you get a text from a contact, their name appeared.  Now just a phone number.  What did I do wrong and can I get it back?

    Since adding microsoft exchange I sunced my phone and lost all of my old contact, notes. etc.  Also, when I do get a text message it appears as a number instead of a name.  What did I do wrong and can I get my old info restored.  When I tried restoring it only gave me the same thing.

    That number is for an apple server in the UK that is used for iMessage activation.  A hidden SMS is snet to that number when you turn iMessage on and is used to verify your phone number.  I suggest you turn iMessage off.  In settings/phone turn on dial assist.  Check with your carrier to see if you can send an international SMS as you end that possibility to activate iMessage.  Rest your phone (Hold down the Sleep/Wake button and the home button together until the apple logo appears (ignore the ON/OFF slider) then let both buttons go and wait for device to restart (no data will be lost).) then turn iMessage back on.

  • Music not recognized from old PC to new, what did i do wrong.

    So i just got a new PC.  I saved my entire Itunes file on an external hardrive.  The music all transfers to the new PC and i loaded it into the newest Itunes.  I authorized the new computer through Itunes and got all artwork.  Now i cannot play songs or transfer music to my i-pod.  I had to rboot the Ipod. so now i have an empty Ipod and a bunch of Music I cannot play.  I've connested my Iphone and it seems to recognize it, but I'm afraid to connest it again until i trust the itunes to work.  When I try to play a song it say cannot locate the original/
    What did i do wrong?  What can I do?  I still have the old tower available to retreive Itunes
    Thanks for any advice
    MJ

    The index page copied from the template is now reading the css.  I did nothing other than shut down DW and open it again.  Maybe it just takes a while for the process to complete.  Am now creating more pages that are also not reading css.  Will do the same and see if it all connects.

  • My husband and I did the most recent update. Now when we send messages to each other we also receive a duplicate of the message to ourself, what did we do wrong?

    My husband and I did the most recent update. Now when we send messages to each other we also receive a duplicate of the message to ourself, what did we do wrong?

    Check to see if you are both using the same Apple ID for iMessage.  If you are, one of you should go to Settings>Messages>Send & Receive, tap the ID, sign out, then sign back in with a different ID.  (You can continue to share the same ID for other services such as iTunes.)

  • I just updated my iPad to OS5 and all of my apps are gone. What did I do wrong and how can I get them back? Several were paid for. Thanks

    I just updated my iPad to OS5 and all of my apps are gone. What did I do wrong and how can I get them back? Several were paid for. Thanks

    If you have failed to make sure that any apps purchased on the iphone were transferred to your computer before updating, then you will have to redownload.
    Open itunes store, click Purchased, under Quick Links.

  • I have downloaded the Adobe CC free trial.  But when I tried to use the photoshop, it always tells me the photoshop was not working and will be closed.  What did I do wrong ?

    I have downloaded the Adobe CC free trial.  But when I tried to use the photoshop, it always tells me the photoshop was not working and will be closed.  What did I do wrong ?  I like to try it before I buy.  Help, please !

    Could you go to (in Photoshop) Help>System Info>Copy and paste here in its entirety? Also, if there is a crash report paste it here as well.
    Benjamin

  • EMac Freezes while running Diskwarrior!  What Did I Do Wrong?

    I just purchased Diskwarrior upon the suggestion of several people here, and decided to try it out. I booted up from the DiskWarrior CD, and followed instructions. It said HD was ready to rebuild and I clicked on that. It went for awhile and then just froze. I had to turn the power off to get out of the program and back to my my startup disk.
    What did I do wrong? Is there more to installing it than just booting up from the CD? I need some great advice! Thanks.

    Janice,
    You're certain DW really froze? It takes typically about 45 minutes to process a half-full 40 GB HD on my 700 MHz eMac, and at some parts of the run it does appear as if the progress bar isn't moving, but it does come back to update the screen eventually.
    The only times I can recall reports of Disk Warrior failing all ended up being traced to hardware failure of one kind or another (bad RAM in particular). What version of Disk Warrios do you have? The version number will be printed on the DW CD. Since your profile shows OS X 10.3.9, through, any DW recently purchased from Alsoft should work with your Mac. Have you checked the disc for smudges or scratches?
    Dig out your Apple Hardware Test (AHT) disc and see if your Mac will boot from that and if so what it says about the optical drive. You may need to run a CD lens cleaner through the drive one or two passes. Also have AHT check the RAM; you can also use Memtest.
    The other thing that comes to mind is to try DW with all peripherals other than keyboard and mouse disconnected.

  • All my Photos disappeared after I saved a photo from an email from my wife. I am running Mountain lion on Mac book pro 2012, help. What did I do wrong?

    All my Photos disappeared after I saved a photo to Iphoto from an email from my wife. I am running Mountain lion on Mac book pro 2012, help. What did I do wrong?

    Apply the two fixes below in order as needed:
    Fix #1
    Launch iPhoto with the Command+Option keys held down and rebuild the library.
    Since only one option can be run at a time start with Option #3, followed by #4 and then #1 as needed.
    Fix #2
    Using iPhoto Library Manager  to Rebuild Your iPhoto Library
    1 - download iPhoto Library Manager and launch.
    2 - click on the Add Library button, navigate to your Home/Pictures folder and select your iPhoto Library folder.
    3 - Now that the library is listed in the left hand pane of iPLM, click on your library and go to the File ➙ Rebuild Library menu option.
    4 - In the next  window name the new library and select the location you want it to be placed.
    5 - Click on the Create button.
    Note: This creates a new library based on the LIbraryData.xml file in the library and will recover Events, Albums, keywords, titles and comments.  However, books, calendars, cards and slideshows will be lost. The original library will be left untouched for further attempts at fixing the problem or in case the rebuilt library is not satisfactory.
    OT

  • No More Lower Case, What Did I do Wrong

    I'm new in after effects, I tried searching in the forums and on the web but didn't find anything soo...
    everything was working fine but now when i add a text layer, whether i use the text tool icon or right click in the composition area and add text, it only appears in CAPITALS, what did I do wrong?, I tried resetting everything but nothing, in the "Comp Area It Shows Like This" but on the screen and if I export or encode the project with media encoder the text will only shows CAPITALIZED, sooo what button am I missing or feature or something, I bet it's something really simple, thank you...

    It sounds like you've pressed the All Caps button in the text palette.  Just press it again to toggle it off.

Maybe you are looking for

  • Import PO Duty Value duplication

    Dear MM Experts, I am observing some strange values coming to PO header in duty condition. User entered value to duty that is being display correctly but along with the user entry, system is also adding some strange value to another line in Header wi

  • Linking two imacs?

    I know this has probably already been discussed at one point or the other but I need some information. I have an Intel iMac and a G5 iMac that both have Firewire ports. I do a lot of photography work and have many app open at once. I would like run P

  • URGENT---Validating XML file against DTD

    I have a XML & DTD file.I want to validate that xml file against the specified DTD without using any editor.Through program how can i validate?Pl. help me.It's URGENT.

  • How do I apply any changes?

    I have an audio file I've fixed in STP but when I save it, it sounds like the original. Is there something I'm missing to lock in the changes I've made and export a new version?

  • Problems with Safari since upgrading to Snow Leopard!!!  Help!!!

    I updated my OS to Snow Leopard a couple of weeks ago and have noticed a significant change in the way my Safari runs. I NEVER had problems with it prior to the upgrade. Lots of times it is unbearably slow in trying to open the page and more often th