Can't reload certain classes in jrebel - jrebel

I am using JRebel + Intellij JRebel IDE Plugin to hot deploy a gradle project.
I have a situation with JRebel where there are certain Java classes that JRebel refuses to allow me to hot-deploy.
Some classes reload fine.
Other classes do not reload at all. (often in the same gradle sub-project as classes that reload OK)
There is no rhyme or reason to why they do not want to reload. The classes are not really anything special. Not insanely long.
We use Guice... but some files that are managed by Guice reload fine while others do not.
It is making JRebel pretty much unusable because you can't trust whether it will hot deploy or not.
I created a custom JRebel plugin for our project hoping it would help but it did not. Because the class itself will not trigger a reload event, the plugin fails to help fix this.
Note the class in question that will not reload is often an implementation of an interface where if I change the implementation, no reload happens. But if I change the interface java class, that will reload fine!
There is something that JRebel in particular does not like about the Java class files.
When I build the files that it won't pick up, you can even see in the IDE and 100% of the time for these files I get:
Any have any ideas of a way to get this to stop happening?

The class was not in the classloader yet due to lazy loading. Thus the issue.
JRebel can't reload classes not yet in the classloader.

Related

Is there any way to perform ant all from hac in hybris?

I need to do frequently code changes in Hybris and test it on the server on my local setup. so every time I need stop the server and perform ant all then again start the server. this process takes at least of 15 minutes.
ant update updates the whole system where i just need to rebuild my java classes. so is there any way I can perform ant all or build java files again while server is running.
You can use JRebel for dynamic class replacement in runtime. JRebel tracking updated class and spring config files and replace them in runtime. Also you can try to use HotSwapAgent for free but JRebel is best option.

Can't find or load main class to make a Javafx jar in IntelliJ IDEA

I made my first Javafx Application in IntellIJ IDEA it runs perfectly but i have a problem.
I can't make an executable jar for this Application.
To be more explicit whenever i try to search for the main class i can't find it in the artifact tab.
I tried making a normal jar (in the artifacts menu they give you the choice between normal jar and javafx application jar) and the main is detected.
It's a known issue. You can type the fully qualified class name manually as the workaround (foo.bar.MyClass).

Domino 9 Update site osgi class not found

I'm trying to use an Updatesite.nsf to deploy jar to a test server. I can see it in this case the jdbc driver plugin at the server console using the http osgi ss command. But when I use it I get a java.lang.ClassNotFoundException com.mysql.jdbc.driver. What I'm missing or doing wrong. Thank you
The immediate answer is that the code that's calling Class.forName will need to have the MySQL driver in its classloader one way or another, which an XPage or in-NSF Java won't have by default.
To expand on it a bit:
If you're trying to call it from an XPage or Java code in an NSF, it would have to be part of an XPages Library from another plugin, which in turn depends on and re-exports the driver plugin.
If you're trying to call it from another plugin, that other plugin should have a Require-Bundle or Import-Package entry to bring it in.
The class will be available to NSFs by default if you plunk it in jvm/lib/ext, though that admittedly gives up the niceties of OSGi-based deployment.
The reason it works for the XPages JDBC support is that the wrapped plugins created by the wizard in Designer include a special extension point to provide the driver class to the ExtLib code that wants it, but they don't make it automatically available to XPages apps themselves.

Loading resources in a plug-in works in eclipse but not for maven

I am trying to load resources with the platform URL approach in an e4 RCP application.
This works fine for my application plug-in. But I have got a second plug-in which extends the application via fragments. In this plug-in this approach
platform:/plugin/<name>/<path>
does not work. If I start the project from eclipse though, the resources can be loaded.
What could I be doing wrong?
The build.properties content of the plug-in is as follows:
source.. = src
bin.includes = META-INF/,\
.,\
plugin.xml,\
fragment.e4xmi,\
res/
The problem was:
The Maven build is case sensitive for file names, while eclipse is not.
new URL("platform:/plugin/name/res/myfile.txt")
new URL("platform:/plugin/name/res/myFile.txt")
In eclipse, both versions are working; from maven build, only the second version.
This seems quite strange to me. It would be great if anyone could explain this.

XPages - Can't instantiate class: 'Cannot find class <<classname>> in NSF'

I have an XPages application that has been running quite happily for the last couple of years.
The application uses some Java classes as converters that are used to convert data entry on certain fields to upper case, proper case, etc. This functionality has been present and working since the app was first deployed.
Today I was asked to make a change to one of the pages, adding a new field. The change was made in a test copy of the database, the app rebuilt and tested and all was fine.
The same change was then promoted into the live database, but after being rebuilt the error
Can't instantiate class: 'Cannot find class uk.co.xxx.beans.UpperCase in NSF'.
is being returned.
I have tried rebuilding the app and cleaning the project numerous times without success. I have also tried amending the code in the Java class and rebuilding.
If I remove all references to the UpperCase class it then complains about the ProperCase class. It appears as if the app has lost its reference to the Java classes and rebuilding isn't fixing the problem.
As an interim solution I have removed all uses of these classes so that users can at least display the page - but this is obviously not a long term solution. As soon as I reinstate one instance and rebuild, the error returns.
The only change in the app has been the addition of the new field. Removing it makes no difference.
Can you suggest anything else I can try and what may be causing the problem?
Open production db in designer and using Navigator view open WebContent/WEB-INF and delete classes folder. Then rebuild the app or refresh it from template again.
Sometimes classes are not updated correctly. I've seen it few times.
I have seen this too (domino 8.5.3). I recompile until it eventually works. With a restart of the http task thrown in for good measure. How are you deploying the classes within the db or as jar files in lib/ext?
I ran into similar issues with 8.53 FP2 with the same "can't instantiate errors" if accessed by a designer client. I even put a PRD in at IBM for it.
In order to fix this problem we had to update to the server and clients to FP5. We had a work around before we could update the FP5. We had to modify how the application was rolled out. Once the database was updated from a template we had to do a clean then a build while use our Application ID used for signing applications.
http://www-01.ibm.com/support/docview.wss?uid=swg21639571
JDAE8ZV2CX
XPage With Java Design Element Breaks When Domino Designer opens after applying 8.5.3 Fix Pack 2 interim fix of any 853 Fix Pack 2/Fix Pack 3 hotfix

Resources