Run Into Problem When Trying Not To Hard Code the Host Name

My code (using the JavaMail API) works fine when the SMTP host name is hard coded in the program:
       props.put( "mail.smtp.host", "TheHostName" );Then, I tried to put the host name in a properties file (smtpServer.properties). The properties file is in the $TOMCATHOME\webapps\AppName\WEB-INF\classes\resources directory. And the properties file has this one single line:
smtpServer = TheHostName     //Note: The host name has only alpha characters, dots, and dashesIn my program, I did:
   private final String PROPFILE = "resources/smtpServer.properties";
   private Properties oProp = null;
   public SendBatchMails()  // this is the constructor in my class
      try
         oProp = new Properties();
         oProp.load ( getClass().getClassLoader().getResourceAsStream( PROPFILE ) );
      catch( IOException oEx )
         System.out.println("Unable to load the Properties " + PROPFILE + oEx );
       String smtpServer = oProp.getProperty( "smtpServer" );
       Properties props = System.getProperties();
       props.put( "mail.smtp.host", smtpServer );And, I got this runtime error:
java.lang.IllegalArgumentException: argument type mismatch
     sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
     sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
     sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
     java.lang.reflect.Method.invoke(Method.java:324)
     org.apache.commons.beanutils.PropertyUtils.setSimpleProperty(PropertyUtils.java:1789)
     org.apache.commons.beanutils.PropertyUtils.setNestedProperty(PropertyUtils.java:1684)
     org.apache.commons.beanutils.PropertyUtils.setProperty(PropertyUtils.java:1713)
     org.apache.commons.beanutils.BeanUtils.setProperty(BeanUtils.java:1019)
     org.apache.commons.beanutils.BeanUtils.populate(BeanUtils.java:808)
     org.apache.struts.util.RequestUtils.populate(RequestUtils.java:1252)
     org.apache.struts.action.RequestProcessor.processPopulate(RequestProcessor.java:821)
     org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:254)
     org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
     org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
     javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
     javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

I would agree with Reply 1. From the stack trace it is apparent that it comes from Struts, where it is failing to set some kind of property in a bean. However the code that you posted doesn't seem to have anything to do with that. Check your Struts configuration.

Similar Messages

  • My iMac is running very slowly when trying to retrieve data from the internet.

    Safari hangs on all web pages, take at least 15mins to download a single page.  Connecting iTunes Store hangs indefinitely.
    I am running OS X 10.7.5.
    All other devices connected to my router have no problems accessing the web including NetFlix through Apple TV, iPad etc. I have not changed my router or service provider.
    What I have tried so far:
    Turned off Extensions (not that I had any to start)
    Removed all Website Data
    Unchecked Allow Plug-ins
    Any other suggestions...?

    Please answer as many of the following questions as you can. You may already have answered some of them. In that case, there's no need to repeat the answers.
    Have you restarted your router and your broadband device (if they're separate) since you first noticed the problem? If not, do that now and see whether there's any change.
    If your browser is Safari, then from the Safari menu bar, select
    Safari ▹ Preferences... ▹ Privacy ▹ Remove All Website Data
    and confirm. Any change?
    If you're running OS X 10.9 or later, select the Advanced tab in the Preferences window and uncheck the box marked
    Stop plug-ins to save power
    Any change?
    Quit and relaunch the browser. Any change?
    Log out and log back in. Any change?
    Enable Private Browsing in the Safari menu. Any change?
    Are any other web browsers installed, and are they the same? What about other Internet applications, such as iTunes and the App Store?
    If other browsers and Internet applications are also affected, follow these instructions and test. Any change?
    If Parental Controls is active for any user, please turn it off and test. Any change?
    If only Safari is affected, launch the Activity Monitor application and enter "web" (without the quotes) in the search box. If a process named "Safari Web Content" is shown in red or is using more than about 5% of a CPU, select it and force it to quit by clicking the X or Quit Process button in the toolbar of the window. There may be more than one such process. Any improvement?
    Again, if only Safari is involved, open the iCloud preference pane and uncheck the box marked Safari, if it's checked. Any change?
    Are there any other devices on the same network that can browse the Web, and are they affected?
    If you can test Safari on another network, is it the same there?
    If you connect to your router with Wi-Fi and you can also connect with Ethernet, do that and turn off Wi-Fi. Any difference?

  • Another problem when trying to open iTunes8 for the first time

    I have just downloaded iTunes8 and after the installation received the message: - "iTunes has been installed successfully./"
    However, when trying to open it, I too have a problem and the message I get is: - "iTunes cannot run because some of its required files are missing. Please re-install iTunes."
    The previous version ran OK and I have de-installed it and re-installed it 3 times and each time I get the same message that it has been installed successfully but the same message sayind ome files are missing when I try to open it.
    I have checked the QTime is up to date and it is. Anyone else had this problem?

    I am getting this error message as well. I have just downloaded Lightroom recently. I try to click on Lightroom / preferences....and nothing happens. I tried to uninstall and it is greyed out so I can't do that either. Suggestions? Please help?

  • Problem when importing two photo galleries with the same name. Please Help!

    Hi Guys,
    I'm not a pro in dreamweaver so I would appreciate if your answer wouldn't be too technical...
    Anyway I have experienced a problem. Heres the sotory, I have been making a websie in DW and used Adobe Bridge CS5 to create a photo gallery SWF file that I would use for my website. The problem is that I want to use two different photo galleries on two different pages however when I save my second photo gallery in bridge, it saves every file with the exact name as the first photo gallery I created and is working fine... Thus when I try to import the photo gallery files into my website folder structure, I find that it asks me to rename them because the files from the first photo gallery are called the exact same names.. Now obviously when I try to rename them dreamweaver gets confused and goes to the wrong folder and uses the images from my first photo gallery in the second one.
    So I guess my question is how can I organize my folder structure to be able to import multiple galleries without dreamweaver getting confused because bridge names all the files the same. Or how could I save the files through bridge so that they have different names and will work fine when I import into DW...
    Thanks and sorry for the essay,
    Patrick

    #1 You cannot have two files / folders or galleries with the same name.  Redo your image Galleries with different names.
    #2 SWF (flash) is not visible to iPhone, iPad, iTouch, Android or other web devices that don't support Flash Player.  These users will see nothing.  You might wish to explore other photo gallery / slideshow options that rely on jQuery instead of Flash technology.  Some links below.  A Google search will reveal many others.
    jQuery WOW Slider
    http://wowslider.com/
    jQuery Cycle
    http://www.malsup.com/jquery/cycle2/
    jQuery Nivo Slider
    http://dev7studios.com/nivo-slider/
    Nancy O.

  • I have a MacBook Pro late 2008 edition with 2 Gigs of RAM and running Mavericks. When trying to download Yosemite from the App Store it gives me an error message. Anyone has a similar problem?

    MacBook Pro late 2008 edition with 2 Gigs of RAM and running Mavericks (10.9.5). It gives me an error message when I try to download Yosemite

    All,
    I thought it may be related to spaces in the path in which the script was called from. I tried having the ODBC command script in another directory but the same thing happens. It will give me the "CONFIGSYSDSN: Unable to create a data source for the 'Oracle in OraClient10g_home1' driver: Could not load the setup or translator library with error code -2147467259". As soon as the script is done running I can manually double click the script and it adds the DSN fine.
    Thanks,
    Clif Bridegum

  • Problem when trying to transfer messages using the...

    Hey all.
    I rang Nokia Support today, but they didn't seem to understand the issue that I was having, so I've decided to post it here.
    I reesently sent my N95 away to be repaired, because it had a broken speaker. I got it back on monday, and decided that I would try and transfer the messages from my old N73 to the N96. I launched the Switch application on the N95, and turned Bluetooth on on the N73. I selected the messages option from the list, and hit the ok option. After fetching about 250 messages, I noticed that the status line on the screen wasn't updating, so I figured that for some unknown reason the message transfer had crashed. I hit the stop option on the N95, and got a message stating that the connection had been broken. I checked in the inbox of the N95, and saw that some of the messages were there. I attempted to transfer the itoms again, and this time the connection held. However, upon recieving all of the messages from the N73, the N95 informed me that It was sending messages to the N73! I figured that this must be because it was sincrinising the messages that it had first attempted to fetch (the first time, when the connection broke). When it had finished, I checked in the inbox of both phones. The N95 had the correct number of messages, and so, surprisingly did the N73.
    So my question: does anyone know what would have happened to the messages that the N95 attempted to fetch first (the time the Bluetooth connection broke half way through), and the messages that the N95 had transfered to the N73?
    I am assuming that may be after transfering both of the phones look through the messages, and if it finds any messages with the same timestap it just overwrites them. If someone knows the answer to this question, please let me know.
    Sorry for the long post, and I hope everyone understands my question!
    Thanks a lot in advance,
    Elliott.

    Never had a transfer crash on me before. Apart from using switch to transfer, I also use it to sync my phones and that also involves the messges being transferred back and forth except I do it fairly regularly and I have yet ended up with any duplication. Hence, your theory about the phone checking checking for dupliction is probably correct.

  • [Deployment] How NOT to hard code the Database SID, Username, and Password

    Hi, I'm new in J2EE so be easy on me. :)
    How can I parameterize the database SID, username, and password in my J2EE application? So that anyone can change the SID, username, and password without the need to modify my code? I use Oracle 10g, ADF BC, JSF and JDeveloper 10.1.3.1.
    My friend said that I can use XML for this. But he didn't go to detail for doing this. Is it true? Is there any [or better alternative]?
    Any help or pointer to a simple tutorial would be fine.
    Thanks in advance.

    Hi -- this is quite easy to do with J2EE.
    In your application code, you declare "logical" references to resources (such as datasources, security roles, etc.) and use those in your application code so all it depends on is the logical name
    On the server where the application is deployed, "physical" resources are created that point to the actual resource -- in the case of a database, this would be the JDBC URL, username, password.
    At deployment time of the application, you then use the facilities of deployment tool to "map" the logical references in the application, to the physical references that exist on the server. So you connect the dots between your application needing something and the server providing the something. That way all the "details" are abstracted out of the your application code.
    I don't know how this works in ADF, BC4J, etc. but I presume that since they are based on standard/J2EE, it must be available somehow.
    I wrote something about this a while back using direct JDBC as an example:
    http://buttso.blogspot.com/2006/06/datasource-lookup-using-javacompenv.html
    -steve-

  • I'm getting this problem when trying to update my iphone 3gs it says that the iphone software could not be contacted and I went on youtube got some advise to go into my hard drive to fix the error I have nothing in my host file please help me if you can

    I'm getting this problem when trying to update my iphone 3gs it says that the iphone software could not be contacted and I went on youtube got some advise to go into my hard drive to fix the error I have nothing in my host file please help me if you can this is all new to me.

    Read this: iOS 4: Updating your device to iOS 5 or later
    ... oh I think it is a 3gs or a 3
    This makes a difference. What does it say in Settings > General > About?

  • Problem when trying to run MD04

    I am experiencing problems when trying to run my MD04 Collective access, for vendor say X & Y.
    I buy many products from these vendors and I therefore need to have access to place these orders anytime of the day (as it can take more than one hour to raise the orders) and it is only allowing me access last thing in the day for some strange reason.
    Please can you look into this - I'm not sure if there is a server issue due to the size of the job, but I must have the ability to undertake this task.
    I tried to limit the selection further but still the problem is not getting solved.
    please tell me what else can be done?
    Thanks in advance.
    Regards,
    Sonal.

    Basically when i am trying to do collective access thru MD04 I am putting plant and vendor.
    the sys is not displaying the stock reqmt list but is getting time out.
    I tried limiting further by putting delivery dates, MRP controller but still it is not working.
    What else can be done?
    Thanks & Regards,
    Sonal

  • I got problem when trying to contact my iphone 4 using facetime,it did ringing,but my iphone 4 did not receive that call as if nothing happen.But,when the call ended,that call appeared in the missed call list.fyi both are connected to internet.

    i got problem when trying to call my iphone 4 using facetime with my Macbook Pro 13',it did ringing,but my iphone 4 did not receive that call as if nothing happen.But,when the call ended,that call appeared in the missed call list.fyi both are connected to internet.Help!! thank you in advance

    i got problem when trying to call my iphone 4 using facetime with my Macbook Pro 13',it did ringing,but my iphone 4 did not receive that call as if nothing happen.But,when the call ended,that call appeared in the missed call list.fyi both are connected to internet.Help!! thank you in advance

  • How do i deactivate a device through icloud if the device is broken and i am unable to turn on find my iphone? Also i do not own a apple id as ive been using a family members due to problems when trying to make one?

    How do i deactivate a device through icloud if the device is broken and i am unable to turn on find my iphone? Also i do not own a apple id as ive been using a family members due to problems when trying to make one?

    Hey tyjox,
    Thanks for the question. After reviewing your post, it sounds like you need to deactivate Find My iPhone on a device that does not work. You will need to work with the family member of the account the iPhone is registered with. I would recommend that you use this article to help you resolve or isolate the issue.
    iCloud: Remove your device from Find My iPhone
    http://support.apple.com/kb/PH2702
    Remove an iOS device you no longer have
    If you no longer have the iOS device because you gave it away or sold it, you need to remotely erase it before you can remove it.
    Sign in to icloud.com/#find with your Apple ID (the one you use with iCloud).If you’re using another iCloud app, click the app’s name at the top of the iCloud.com window, then click Find My iPhone.
    Click All Devices, then select the device.
    Click Erase [device], then enter your Apple ID password. Because the device isn’t lost, don’t enter a phone number or message.If the device is offline, the remote erase begins the next time it’s online. You’ll receive an email when the device is erased.
    When the device is erased, click Remove from Account.All your content is erased and someone else can now activate the device.
    Thanks for using Apple Support Communities.
    Have a nice day,
    Mario

  • Is it possible to install both FCP7 and FCP X on your hard drive without running into problems?

    Is it possible to install both FCP7 and FCP X on your hard drive without running into problems?

    Apple recommends separate partitions: http://support.apple.com/kb/HT4722

  • Running into Problems with Flash Player with some sites and not others

    Hi All,
    I've run into problems with Flash Player 10,0,45,2. In IE 8, FF 3.6.3 and Google Chrome (which I downloaded as a last ditch measure), some websites (such as youtube) work fine. Other sites such as wimp.com I get an empty box. I've reinstalled flash, but haven't seen much else in these forums to try to figure out what the problem is.
    Any help would be greatly appreciated.

    Bump.         

  • GenericServiceFactory initialization problem when trying to load Web servic

    Hi,
    I am making a Guided procedure that calls a webservice. I have created a new Destination Template and was able to load the webservice definition successfully, but when I test the callable object I created for that same webservice y get the error:
    GenericServiceFactory initialization problem when trying to load Web service model for WSDL.
    Somehow I think there is something wrong with the user authentication. The Destination template has a user and password but somehow I think the callable object test is not using this information at all.
    Can anyone help ?
    Thanks in advance

    Hi Hans,
    Have you verified if you can call any external web service calls from your J2EE engine?  Go into the SOA Management / Global settings (if you are on CE - if you're on 7.0 it's in manage WS desintations).
    Look at your proxy settings and set them like your web browser that enables external calls.  For example, in the SAP network I set my global proxy settings on my local J2EE engine to be:
    Proxy host:  proxy
    Proxy port: 8080
    Exclude list:  *.sap.corp
    Does that make sense - have you verified if your settings are correct for your company?
    Regards
    Ginger

  • Problems when trying to migrate from 6.0 to 6i

    Hi,
    I'm having problems when trying to migrate a Designer 6.0 application to 6i.
    When I get to start the migration after having selected the source application, the process fails immediately after I've pressed the button.
    I'm getting the error: CDR-21244: This process has been aborted and the advice to check the log file. But no log file is created.
    I've read Note 234984.1 which gives two suggestions in this situation: That the ORACLE_HOME environment variable is unset, and that the LOG_DIRECTORY_RAU directory is writeable. Both is fulfilled in my situation. However it seems that the migration procedure tries to start imp - I've noticed a short flash with the command prompt screen - and when I try to start imp manually from the command prompt I get errors. I was able to fix this error by setting ORACLE_HOME and ORA_NLS33. But the defining ORACLE_HOME is "illegal" ref. Note 234984.1. Of course I tried to leave it anyway, but that didn't help neither: The migration still dies a quick and silent dead.
    So now I'm stucked. How can I carry on?
    The source is on version 6.0.3.5.0 running on 8.1.5, and the taget is version 6.5.92.1.9 running on 8.1.7.4.
    Regards, Michael

    The migration from Designer 6.0 to 6i requires careful planning. Please read the migration guide on OTN (http://www.oracle.com/technology/products/designer/index.html) for advice and to assist you with the migration.
    Regards
    Sue

Maybe you are looking for