Skip to main content

Reloading class using spring-loaded Jar

As a  java developer using eclipse, every time, when we made the change on the class, annotation or the xml files, eclipse will pop up a message let us decide ‘continue, restart  tomcat and more’. I am kind of appreciate its kindness. However,  most of the time, I have to select ‘restart’. So, I just wish eclipse  or tomcat can help to reload class files and don’t bother me that option.

Before, I found jRebel which is perfect for my wishing. It is just hard to push management team pay for that  $365 per license annually.

So, I need to cater myself and the one I can afford which is $0 a year, and it’s using Apache License.

How to config?

#2 in your eclipse, adding below arguments in the VM arguments. You need to amend the path to the jar file in your machine.

-Djavaagent:C:/Dev/lib/springloaded-1.1.2.20130430.jar –noverify

#3 Ready to go

Comments

  1. in my case it worked as:
    -javaagent:/path_to_jar/springloaded.jar -noverify

    ReplyDelete
  2. Thanks. Yours are more generic :)

    ReplyDelete
  3. On a Windows Service tomcat installation I found that I had to use

    -Xverify:none
    -javaagent:"C:\path_to_jar\springloaded-1.2.1.RELEASE.jar"

    notice I used -Xverify:none instead of -noverify, otherwise it woudn't recognize the command, spent hours troubleshooting because of that little detail.

    I find that it works great for changing method bodies or constructors, but it doesn't actually let me add new methods or fields, they don't get recognized until I restart the app, which is a bummer, and it's strange because their documentation says otherwise.

    Does anybody have the same problem? JVM has java 7 but the project's source level is set to java 6

    ReplyDelete
  4. is it work on tomcat jee

    ReplyDelete
  5. The hephen before noverify is not formatted properly for copying and pasting over but it works after I replaced it (with correct mapping of course).

    ReplyDelete

Post a Comment

Popular posts from this blog

Stretch a row if data overflows in jasper reports

It is very common that some columns of the report need to stretch to show all the content in that column. But  if you just specify the property " stretch with overflow' to that column(we called text field in jasper report world) , it will just stretch that column and won't change other columns, so the row could be ridiculous. Haven't find the solution from internet yet. So I just review the properties in iReport one by one and find two useful properties(the bold  highlighted in example below) which resolve the problems.   example: <band height="20" splitType="Stretch" > <textField isStretchWithOverflow="true" pa...

Live - solving the jasper report out of memory and high cpu usage problems

I still can not find the solution. So I summary all the things and tell my boss about it. If any one knows the solution, please let me know. Symptom: 1.        The JVM became Out of memory when creating big consumption report 2.        Those JRTemplateElement-instances is still there occupied even if I logged out the system Reason:         1. There is a large number of JRTemplateElement-instances cached in the memory 2.     The clearobjects() method in ReportThread class has not been triggered when logging out Action I tried:      About the Virtualizer: 1.     Replacing the JRSwapFileVirtualizer with JRFileVirtualizer 2.     Not use any FileVirtualizer for c...

JasperReports - Configuration Reference

Data Source / Query Executer net.sf.jasperreports.csv.column.names.{arbitrary_name} net.sf.jasperreports.csv.date.pattern net.sf.jasperreports.csv.encoding net.sf.jasperreports.csv.field.delimiter net.sf.jasperreports.csv.locale.code net.sf.jasperreports.csv.number.pattern net.sf.jasperreports.csv.record.delimiter net.sf.jasperreports.csv.source net.sf.jasperreports.csv.timezone.id net.sf.jasperreports.ejbql.query.hint.{hint} net.sf.jasperreports.ejbql.query.page.size net.sf.jasperreports.hql.clear.cache net.sf.jasperreports.hql.field.mapping.descriptions net.sf.jasperreports.hql.query.list.page.size net.sf.jasperreports.hql.query.run.type net.sf.jasperreports.jdbc.concurrency net.sf.jasperreports.jdbc.fetch.size net.sf.jasperreports.jdbc.holdability net.sf.jasperreports.jdbc.max.field.size net.sf.jasperreports.jdbc.result.set.type net.sf.jasperreports.query.chunk.token.separators net.sf.jasperreports.query.executer.factory.{language} net.sf.jasperreports.xpath....