Discussions

EJB programming & troubleshooting: Eclipse + Weblogic

  1. Eclipse + Weblogic (17 messages)

    Hello guys,

    I am using Eclipse 2.1 for my development where I have multiple
    projects. I have an ANT script to build and deploy the application to
    Weblogic 7.0. The problem however is that when I do any changes to
    JSPs, I need to re-build, deploy and restart Weblogic to see my
    changes reflected....Restarting weblogic every time I change my JSPs
    is becoming a pain as it takes about 3-4 minutes everytime...

    Using WSAD was really easy as the Websphere Test Environment was
    recompiling any modified JSPs while the WTE was up - no need of
    restarting if I just change JSPs....

    If anyone has faced a similar problem, please let me know how to go
    about solving it....

    Thanks,
    Prashanth.

    Threaded Messages (17)

  2. Eclipse + Weblogic[ Go to top ]

    This is weird. The modified JSP should automatically recompile when you deploy them to Weblogic. I have never had a problem with it.

    How are you deploying things? If you are coming from a Websphere/WSAD background, you may be under the impression that you can only deploy JSP inside a WAR file. That is not the case. You can copy your revised JSP directly into the application directory. The server will notice that the file has changed (by looking at the timestamp) and recompile the JSP.

    The only other reason I can think of for why this is failing is that someone has disabled automatic JSP recompilation on your Weblogic server. Find out if this is the case, and get them to turn it back on.

    Personally what I do is do all my JSP development on Tomcat, and deploy it to my production server (Weblogic or Websphere, usually). This work great, so long as you are not using EJB.
  3. Eclipse + Weblogic[ Go to top ]

    Paul,

    I have 2 EJB projects, about 5-6 normal Java Projects and a Web Project from which I build an EAR file using an ANT script - this EAR file gets deployed by the ANT script to Weblogic 7.0 but everytime I make any changes to my JSPs, I am having to bounce my server which usually takes 2-3 mts. With minute changes to JSPs everytime, this is becoming a bottleneck. Did you turn on some feature in the Weblogic Console for thie feature ?

    Are you talking about turning on some feature in the Weblogic Console ? Someone else was saying that Weblogic will recognize any changes to the JSP. I will try to do that and shall see how it works. Can anyone tell me where I can turn on this feature in Weblogic 7.0 ?

    Please let me know.

    Thanks,
    Prashanth
  4. Try unpacking the EAR and then the WAR containing the JSPs? You'll need to modify the application.xml & the config.xml slightly, i.e. reference the folder e.g. 'admin' rather than the war 'admin.war' but there should be no more than that, then edit the JSP's in situ.
  5. I will try unpacking the EAR and WAR files but isnt there a better way than unpacking the files ? Cant I have one EAR file and have the changes reflected ?
  6. The main point of EAR and WAR is to provide a convenient unit for deploying finished applications into production. For development, it is usually easier to work directly with the unpacked files.

    When I developing web applications, I write a "deploy" task that copies my JSP and servlet files directly into the server environment with bothering to archive them. I have a seperate "dist" task that packages all my JSP/servlet code in a WAR/EAR for production, but I don't bother with it during normal development. If you use the file copy option, you usually only need to reboot the server when you update the web application configuration in the web.xml file.

    In fact, when I am feeling especially lazy, I sometimes edit the server's JSP files directly, and simply hit the "reload/refresh" button in my browser to see the changes. I don't recommend this as a general practice, though, because it is too easy to make a mistake and lose your changes.
  7. Thank you Paul...
    I unpacked the WAR file and when I changed some files (including JSPs and Java class files) it seems to work without any restart but once I copy modified files to the Weblogic Applications directory, I am having to press "Refresh/Reload" on my browser to see the changes reflected. Is this the way it works or should Weblogic automatically detect the change when a new request comes in for the resource ?
  8. Eclipse + Weblogic[ Go to top ]

    The exploded format and redeploying a modified WAR seems to be working for me now. I am able to deploy a new WAR with changes (changed the STARTMODE in startup script to false) and Weblogic is recognizing them.

    Now, there is a problem with my classpaths....Earlier, I was managing my classpaths thru the Manifest files in the various jar and war files. Since I have separated out the WAR file, how should I manage the classpaths - the JAR files that were earlier part of the EAR file are loaded thru a separate classloader and the WAR file by a different one....

    Questions are :
    1) Can I still have all the other Jars (EJB projects and Normal Java Projects) packaged as an EAR file and have the separate WAR file access them ? (My guess is this is not possible !! Pls correct me).
    2) Should I have all the Jar (EJB and normal Java) files at the root level of the weblogic deployment folder i.e., in mydomain\applications folder. This, I think would make managing the files a nightmare....

    Pls advise...

    Thanks...
  9. Eclipse + Weblogic[ Go to top ]

    Have you tried using hot deployment for your development?
    The moment you place the modified ear file in the hot deployment directory of weblogic (i.e. %WLS61%\config\wlsd21\applications), it redeploys your EJB. It's perfect for development and testing EJBs. It's been a while, but I think there is an option in the admin console to enable Hot deployment. You can also set the rate at which the server should poll the hot deplyment directory for changes.

    - Ruben
  10. Eclipse + Weblogic[ Go to top ]

    Ruben,

    I dont see any specific hot deployment directory in Weblogic 7.0. I have tried referring the documentation but there is nothing mentioned about it other than hot deploying a web application. The admin console option for polling the application is available only for a Web Application...

    Did you mean hot deploying an EAR file or a WAR file ??

    Thanks,
    Prashanth
  11. Eclipse + Weblogic[ Go to top ]

    Prashant,
    I have done hot deployment in Weblogic 6. It that, I could package my EJB jars and war for web app files into an ear file (standard operation as you know) and then I could place the ear file in the directory for hot deployment.
    I think the directory you are reading about for hot deploying web apps is the same directory. Try placing your ear file in that directory and view the logs of the server to see if your server deploys your EJB for you.
  12. Eclipse + Weblogic[ Go to top ]

    The exploded format and redeploying a modified WAR seems to be working for me now. I am able to deploy a new WAR with changes (changed the STARTMODE in startup script to false) and Weblogic is recognizing them.

    Now, there is a problem with my classpaths....Earlier, I was managing my classpaths thru the Manifest files in the various jar and war files. Since I have separated out the WAR file, how should I manage the classpaths - the JAR files that were earlier part of the EAR file are loaded thru a separate classloader and the WAR file by a different one....

    Questions are :
    1) Can I still have all the other Jars (EJB projects and Normal Java Projects) packaged as an EAR file and have the separate WAR file access them ? (My guess is this is not possible !! Pls correct me).
    2) Should I have all the Jar (EJB and normal Java) files at the root level of the weblogic deployment folder i.e., in mydomain\applications folder. This, I think would make managing the files a nightmare....

    Pls advise...

    Thanks...
  13. WebLogic Server 7 Server mode[ Go to top ]

    Make sure you are running the server in development mode. Under this mode, the server will detect changes and automatically redeploy.
  14. WebLogic Server 7 Server mode[ Go to top ]

    Yes, I did start it in development mode and whenever I deploy my EAR file, Weblogic is recognizing the changes but it does so only once...After that whenever I deploy a new EAR file, Weblogic tries to reload the EAR but shutdowns the server while getting the Hotspot JVM down and says that there is a bug and that I have to report at the Sun site....

    My EAR file is about 13 MB in size..Is this a problem ? Has anyone else faced a similar problem ?

    Thanks.
  15. Eclipse + Weblogic[ Go to top ]

    Hi Prashanth,

    Mine is also a similar problem like you. We also use ant script to compile deploy the application into weblogic 10.3 server. But what I do is I created a java project in eclipse, imported src folder to here, have the code compiled and set the PRE_CLASSPATH of weblogic to bin folder of this project and restarted the server. This keeps away the compile and deploy process whenever I modified any java related files (including servlets, ejb ...I manually add the configuration stuff in the ear though). Here it needs server restart for any change.

    My question is, is there any way to do this without restarting the server? if I modified any  jsp or java file in eclipse, without restarting server, do they get effected in weblogic server? If you know anything about this, please reply me.

     

    Thanks & Regards,

    Prasanna.

     

  16. EJB[ Go to top ]

    hi,

    thanks your information ,it i s uesful to me .plz keep posting...find more

    <a href="click" rel="nofollow">http://www.theasianconnectionsnewspaper.com/">click here</a>

  17. Nice Topic[ Go to top ]

    hi,

    wow great...nice post...

     

    _________________________________

    yoga classes for pregnancy

  18. Hi..I need a system too for the system I'm working. I'll be glad if you will recommend some reference. Its about field surveillance camera. thanks!