I have tried to implement a JavaBean in my Application. I'm new on this topic and as it didn't work I got two steps back and tried the same with a HelloWorld example which I had done my self some month ago. This time it didn't work, too. I use the 8.5.3 Designer Client and we have a 8.5.2 Development Server. I set in the Application property the flag for compatibility 8.5.2.
The JAVABean Code looks like this:
package net.ta.java.Backend;
import java.io.Serializable;
public class MyHalloWelt implements Serializable {
private static final long serialVersionUID = 1L;
private String HalloWelt;
public String getHalloWelt() {
return HalloWelt;
}
public void setHalloWelt(String halloWelt) {
HalloWelt = halloWelt;
}
public MyHalloWelt() {
HalloWelt = "Hallo neue Welt!";
}
}
The faces-config:
<?xml version="1.0" encoding="UTF-8"?>
<faces-config>
<managed-bean>
<managed-bean-name>Test</managed-bean-name>
<managed-bean-class>net.ta.java.Backend.MyHalloWelt</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
</managed-bean>
<!--AUTOGEN-START-BUILDER: Automatically generated by IBM Lotus Domino Designer. Do not modify.-->
<!--AUTOGEN-END-BUILDER: End of automatically generated section-->
</faces-config>
The XPage function-call:
<xp:text escape="true" id="computedField1" value="#{Test.HalloWelt}"></xp:text>
The Exception:
Exception javax.faces.FacesException: javax.faces.FacesException: Can't instantiate class: 'net.ta.java.Backend.MyHalloWelt'.. java.lang.ClassNotFoundException: class java.lang.ClassNotFoundException: net.ta.java.Backend.MyHalloWelt javax.faces.FacesException: Can't instantiate class: 'net.ta.java.Backend.MyHalloWelt'.. java.lang.ClassNotFoundException: class java.lang.ClassNotFoundException: net.ta.java.Backend.MyHalloWelt Can't instantiate class: 'net.ta.java.Backend.MyHalloWelt'.. java.lang.ClassNotFoundException: class java.lang.ClassNotFoundException: net.ta.java.Backend.MyHalloWelt java.lang.ClassNotFoundException: class java.lang.ClassNotFoundException: net.ta.java.Backend.MyHalloWelt class java.lang.ClassNotFoundException: net.ta.java.Backend.MyHalloWelt
I followed a hint in this forum which says that it could be an bug with the JAVA Class Design Element new in 8.5.3. Like they said in the post I tried to put my class manually in the src\ path but it didn't work - same error. I thought it is a compatibility issue with our 8.5.2 Server but locally the same error.
I hope someone could help me. I am at a loss with this... Thanks!
Michael
EDIT: Thank you very much to all of the people helped me with this issue so far. Now it works if I opend the XPage with my Notes CLient. It doesen't matter if the database is on the server or local. It doesen't work if I open it with a Browser. If I do so the error is still there.
My problem consists of more then one part:
1. I had a typo in the spelling of my Bean-Attribute "HalloWelt" => "halloWelt"
2. My Server don't have the German Language-pack installed, which caused the misleading Errormessages concerning the resources files.
3. The main Problem finally is the Domino Server 8.5.2 didn't recognize the "Class/JAVA" Folder new in Notes/Domino 8.5.3! If I move my JAVABean to a new created "src" folder the JAVABean get recognized and everything works fine. - A little confusing is the XPage works fine in Notes Client before moving the java file. Only browsers produce the error...
Thanks to all of You provided me with the needed hints. I have learned a lot more about JAVA Development as I had expected. :)
Michael