Wierd ClassCastExeption. Do I always need to restart web logic server?

I salute the web development community and thank you in advance for taking the time to read my problem. I just started trying out Jdeveloper. While writing applications, as they become more complex I find myself with the annoying task of restarting the server every time I make changes in my code. For example: in a simple application, the user specifies the Country in an html form and the server gives it's cities in a jsp page. To do this I used the EJB beans to convert my database into entities and the created a Java service facade. My application is now working fine, but if I make even the tiniest change in the code, it totally crashes and I have to restart the server for the changes to take place. The question is: Do I have to start getting used to the annoying task of restarting the server every time I modify my code? Or due to the fact that I',m just starting out in Jdeveloper I might be doing something wrong. This is the exception that I get that causes the 500 internal server error:
java.lang.ClassCastException: model.countries cannot be cast to model.countries
     at model.Service.getCountriesById(Service.java:143)
     at control.ServletLoadCities.doPost(ServletLoadCities.java:26)
     at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
     at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
     at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
     at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
     at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:292)
     at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
     at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
     at oracle.dms.wls.DMSServletFilter.doFilter(DMSServletFilter.java:326)
     at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
     at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3592)
     at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
     at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
     at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2202)
     at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2108)
     at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1432)
     at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
     at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
Wierd... why cant I cast model.countries to model.countries. They are the same class!
Thanks again for your help and time.
Michel

Hello pedja,
No, re-deploying the project doesn't work. What do you mean by Classloader issues?
This exception occours at the EntityManager class that talks with the database, right here:
/** <code>select o from Paises o where o.codigopais = :elCodigo</code> */
public Paises getPaisesFindPaisById(Object elCodigo) {
Paises elPais;
Object o = getEntityManager().createNamedQuery("Paises.findPaisById").setParameter("elCodigo", elCodigo).getResultList().get(0);
elPais = (Paises)o;
return elPais;
in: elPais = (Paises)o
If I call the method above within the same class nothing happens... It crashes when I call this method from a Servlet.

Similar Messages

  • We need integrate a Web Logic server 6.1 or 7.0 with Lotus Domino 5.x or 6.x

    Hello,
    We have a customer that for requirements from some applicactions needs Web
    Logic server 6.1 or 7.0 to work with Lotus Domino 5.x or 6.x
    According to our experience we think its possible but we will appreciate
    your opinion on the issue.
    We would also want to know if you know of someone that has build up this
    system or that has spent some time on testing accomplihing the connection.
    A name and email address would be fine so we can get in touch with them.
    Regards,
    Philippe Abadie
    DyDeCom Ltda.
    [email protected]
    [att1.html]

    Hello,
    We have a customer that for requirements from some applicactions needs Web
    Logic server 6.1 or 7.0 to work with Lotus Domino 5.x or 6.x
    According to our experience we think its possible but we will appreciate
    your opinion on the issue.
    We would also want to know if you know of someone that has build up this
    system or that has spent some time on testing accomplihing the connection.
    A name and email address would be fine so we can get in touch with them.
    Regards,
    Philippe Abadie
    DyDeCom Ltda.
    [email protected]
    [att1.html]

  • Update Planning table but need to restart Web application server

    Hi All,
    We want to update the process state externally. After updating table, Windows services (Web application server) need to be restarted.
    However, the updating operation could be done frequently so that we can get real-time result. How to notify Planning application to refresh its data without restarting services ?
    Any ideas or suggestions will be appreciated.
    Edited by: kyhsu on 2009/11/24 下午 10:59

    Hi,
    Planning uses a caching system where it caches the current state of the relational tables. If changes are made in planning then the cache is updated and the tables.
    If you update the tables directly the cache will not be updated so planning will still hold its previous state. I don't think there is an easy way round this and there is no simple update cache procedure.
    If you do need to update tables directly then the only sure way of clearing the cache is to restart the web app.
    Cheers
    John
    http://john-goodwin.blogspot.com/

  • Iphone 5-updated to ios 7.0.2 keeps freezing in lock screen.I always need to restart or should wait till a phone call come to unlock the screen. Does any body have the same issue??

    Iphone 5-updated to ios 7.0.2 keeps freezing in lock screen.I always need to restart or should wait till a phone call come to unlock the screen. Does any body have the same issue??

    I do have the same issue with my 4s after updating.tried with restoring several times,but the problem still persists.....

  • Why do we need to Restart XI Production server frequently ?

    Hi Friends,
                    We have faced issue like Timeout , deadloack  in  JDBC Adapter and many issues . If we restart the XIPRD once  the problem get solved .
                <b> 1.   Can you please suggest why do we need to restart teh XI  Server ?
                  2.  In what way it will be helpful for us ?
                   3. Will it clear any locks ? or any dump files ?
                   4. Is it recommended to star t and stop the sever ?</b>
                              Can you please give valuable replies as why  should we restart the xi sevrer in particular period like once in a month like that
    Regards.,
    Shyam.S

    1. Can you please suggest why do we need to restart teh XI Server ?
    It is not done on the frequent basis until you fae some problems like file adapter not appearing in the adapter configuration.....none of the adaters are present in ID (EX)
    it will only start the servicess or other things which were hanging or not responding state.....
    2. In what way it will be helpful for us ?
    ot moght e helpfull some times but not always...it depends on the probelm you are facing...lot of problems can be solved without restarting the server
    3. Will it clear any locks ? or any dump files ?
       Not sure
    4. Is it recommended to star t and stop the sever ?
      Not recomded to do it frequenlty without any valid reason (until you apply some patches etc)

  • Do we need to restart the Tomcat server each time when we modify servlets?

    Hi Friends,
    Do we need to restart the Tomcat server each time when we modify servlets. Or is there any otherway to achieve the functionalitly?
    Thanks and Regards,
    JG

    JamesGeorge wrote:
    Hi kajbj,
    Java guys are mostly using TOMCAT,so for me it seems to be the best place.That's not correct. Most people who are writing stuff for the web might be using Tomcat, but there are lots and lots of Java applications that aren't for the web.
    Is there any other reason behind your question.Yes, this forum is named "New to Java" and Tomcat questions shouldn't be asked here, even if people knows the answer to you question. You will probably get better and more detailed answers in a Tomcat forum. All othe guys there are actually using Tomcat, and they know the small differences between the different versions, and how they behave on different operating systems. They do also know if you need to make configurations changes, and where you should make them.
    So in future, please ask questions in a forum that is specific to the product that you are using.

  • Connecting to home internet via airport - always need to restart the router

    I set my home PC as the main station to connect to my ISP. With a wireless router (linksys Wireless-B), I used to share the internet connection to other wireless devices, for instanace, my palm and ibook, my sister's notebook PC and Pocket PC. once, I took my ibook to an internet cafe, which gives free wireless connection facilities. My ibook obviously scanned the wireless network, and was connected (as I noted from the Summary of the "internet Connection". but, when I activate Safar, it said that it could bring me to any website because my computer is not connected to internet. it's very strange, as the Internet Connection said it's connected to the wireless network. The Safari page suggests me to run "network diagnosis". i follow the instruction, and it says I should restart the router and then it would work. I didn't succeed. A while later, it connected. I thought it was okay.
    Then, this problem comes up even when I am using my home's internet connection via the airport. I use DHCP to connect to my home internet connection. though the airport summary page said that it's connected to my router (the IP address is my router's address), again, Safari said my computer is not connected to internet, so it didn't work. I followed the instruction of the Network Diagnosis, it again asked me to restart my router device. I also noted from the Airport Section of the Network Perference that, it says the airport has a self-designated IP addres, so it may not connect to the itnernet. later on, I retarted the router and the modem (without turn on my home PC), the ibook connected to the internet.
    i checked the router setting of my home PC. I'm sure that it's open to all wireless user. Strange through, after I update the settings (even though i didn't make any changes, perhaps the action of 'save settings', it's kind of equivalent to the action of restarting it), my ibook's connection works. When my retarted my PC and ibook, the connection problem comes up again.
    it's very frustrating. Does it mean that I need to restart my router everytime? What about if I want to connect to wireless hotspot outside?
    Please please help

    Your problem description is complicated, making it hard to figure out what exactly is wrong. Unfortunately, WiFi does this quite often.
    To avoid this kind of problem, you should set up different Locations in your Network Preferences for different places that you connect up. That is, make one location for your Internet cafe and another for home. Leave the Automatic location alone.
    For locations you know you are going to connect by WiFi, go to Network Port Configurations and drag Airport to the top of the list to give it priority.
    If you have a location, where you want an ethernet connection or want to use your internal modem only, then drag those options to the top. Get the idea?
    MacOS seems to get confused sometimes when you switch back and forth between different connections all the time. This will not happen if you tell MacOS where you are by explicitly setting a location.
    To get out of a situation where MacOS thinks you are connected to non-existent ethernet connection, go into
    /Library/Preferences/SystemConfiguration
    and delete the NetworkInterfaces.plist file.

  • Why I need to restart my my server to update my servlet in WL5.1

              Hai
              We have servlets and ejbs in our acchitecture and using weblogic5.1. For EJBs
              weblogic have given hot deploy. But for every change of servlets currently we
              are stopping the server and replacing the servlet class and starting the server.
              Since we getting drastic changes we need to update or deploy servlet in the existing
              running server. Is there any thing is available for servlets or normal classes
              to update in the server. Thanks In Advance
              Kiran N
              

              Hi,
              What is the service pack you are using?
              You should be able to dynamically load the servlet classes.
              Please make sure that you put your servlet classes in servlet classpath:
              weblogic.httpd.servlet.classpath=....
              For every reload check secs server will check for any changes in the classes
              and loads if they are changed.
              Also make sure that you do not have the same class in the system classpath.
              --Vijay
              "Kir" <[email protected]> wrote:
              >
              >Hai
              >
              >We have servlets and ejbs in our acchitecture and using weblogic5.1.
              >For EJBs
              >weblogic have given hot deploy. But for every change of servlets currently
              >we
              >are stopping the server and replacing the servlet class and starting
              >the server.
              >Since we getting drastic changes we need to update or deploy servlet
              >in the existing
              >running server. Is there any thing is available for servlets or normal
              >classes
              >to update in the server. Thanks In Advance
              >
              >
              >Kiran N
              

  • Do we need to restart admin server evertime we restart slapd process

    Hi all !
    For system stability Do we need to restart admin server evertime we restart slapd process ?
    -

    Recently i had some core dump file on my /var/core directory which is actually filling out the filesystem.
    When i send core dump file to sun support they told there is a bug in Directory server BUG ID 4992815.
    But to fix the core dump every time need to restart slapd process i need to restart the admin server.
    It seems strange to me ...but if its how i can fix the dump then i need to follow thier instruction...
    Just curious whether other people also following the same ...
    Thank you for your response....

  • Test java class wihtout restart the APplicaiton Server

    I have modified some java class files for iProcurement and upload to the unix box. Do I need to restart the Application server to reflect the change or any other way that I don't need to restart the server every time I make change to the java class.
    Many thanks for your help

    Hi,
    You need to bounce the apache, to make to changes visible. There is no other way to achieve the same.
    Regards,
    Gyan

  • BIP 11g Enterprise - Need second instance of bip server

    we are short of boxes and instead of deploying a full vm just for a second instance, I was thinking of setting up a second instance of bip under the web logic. However, when I try to clone the existing bip managed server, the system is adding it a as a node in the same cluster. That is not good because I am not doing load balancing.
    I need a complete second instance with its own ports but managed under same web logic server. Any guidance would be appreciated?
    D

    Hi Joe
    I can't say I've tried Robin's technique to run two presentation servers but from my basic understanding of it, both versions will share the same cache as defined in a single nqsconfig.ini file. Maybe these 2 are conflicting somehow?
    I see that a separate instanceconfig.xml is used for each presentation server. I know there are a bunch of advanced, largely undocumented, cache properties you can set in there. I can send you a document listing the various properties if you want to play with it - contact me via my website.
    Paul
    http://total-bi.com

  • Why won't my Itunes update to 11.4 It always asks to restart but once i restart it, it just goes back to saying i need to update it again?

    Why won't my Itunes update to 11.4 It always asks to restart but once i restart it, it just goes back to saying i need to update it again?

    Looks like you have a 3G not a 3Gs...
    Connect to iTunes on the computer you usually Sync with and “ Check for Updates “...
    If an Update Appears Install it... if not... you are up to date for your particular Device...
    iPhone 3G can only go to iOS 4.2.1

  • When I try to delete my current installation of firefox or install new one it always leads me back to the same place, telling me i need to restart computer to install upgrade, but does nothing, how do i get new installation?

    I have windows 7. When i recently installed windows updates I began having script errors for firefox and my weatherchannel programs. I went to control panel, programs and features and tried to delete these 2 programs to install new ones. It seems like the programs didnt compeletly uninstall because they are still listed in my programs but have no file size. I downloaded latest version of firefox but it wont install. It tells me i need to restart computer to install a previous upgrade. I do that and nothing happens. I keep going around in circles.

    If you have problems with updating or with the permissions then easiest is to download the full version and trash the currently installed version to do a clean install of the new version.
    Download a new copy of the Firefox program and save the DMG file to the desktop
    * Firefox 5.0.x: http://www.mozilla.com/en-US/firefox/all.html
    * Trash the current Firefox application to do a clean (re-)install
    * Install the new version that you have downloaded
    Your profile data is stored elsewhere in the Firefox Profile Folder, so you won't lose your bookmarks and other personal data.
    * http://kb.mozillazine.org/Profile_folder_-_Firefox

  • I can't install Firefox 5. It downloads & starts the wizard. I follow the prompts till it says it needs to restart the computer 'to complete a previous upgrade of firefox' . I say yes and it restarts and there is no sign of firefox and no error message.

    The very first time I tried this there was a red message that flashed on the screen too fast to read it. I have Windows 7 and AVG. My son's computer also has Windows 7 and AVG and his upgrade went without a hitch. It deleted my old version of firefox (3.6.12) so now I'm using IE. Windows installed a lot of updates just before I tried upgrading firefox. I have tried turning my firewall down. I have gone to the file in downloads and double clicked it and it does the same thing. It always says it needs to restart the computer even though I have closed all other applications. Should I just give up and try reinstalling an older version of Firefox? Thanks

    It is probably because you are not properly closing Firefox. Restarting your system would make sure that Firefox had terminated, but you do not have to do that.
    To properly close Firefox on Windows systems, use
    :File > Exit or "Firefox:" button > Exit
    When you get the message "Firefox is already running" it is too late, and you must force termination of Firefox through the Windows Task Manager before restarting Firefox. Windows 7 has a keyboard shortcut to save you a step "Ctrl+Shift+Esc" then on "Processes" tab, select "firefox.exe" and use the "End Process" button. More thorough would be to right-click on the "firefox.exec" and choose "End Process Tree".
    You would find firefox.exe in a Mozilla folder in your program files, but y0u would not want to delete it there, you would need to use the Control Panel which you have already identified and do it from there -- but generally you would not need to do that, and there is nothing in what you have posted to indicate that you should. But if you did do that, then don't let the install start Firefox for you as you would want to use you existing desktop icon or method of starting Firefox, and should decline having Firefox install start Firefox for you. When the install starts then invoke Firefox in your normal manner. This should eliminate problems of creating a new profile rather than using your old profile.

  • When I turn off my mini, and at other random times, i get a message saying I need to restart my computer

    When I turn off my mini, and at other random times, i get a simple message that says I need to restart my computer.  any suggestions?

    The message to restart your computer, in multiple languages, is a kernel panic. This is usually, but not always, caused by hardware, with memory being the leading cause.
    You might want to run the Apple hardware test, which is on the original gray-faced OS X disks that came with the mini. FInd the one that says 'AHT Version x.x' in small print on the label, insert and reboot holding the alt/option key down. Choose the Apple hardware test, and when prompted, choose the extended test. You can also download Rember from http://kelleycomputing.net/rember/ if you want to really test the memory. Set it up and let it run over night.
    See this kernel panic FAQs for other ideas: http://www.thexlab.com/faqs/kernelpanics.html

Maybe you are looking for