I want to make a registration by writing the userEmail, userPassword and userRole in .properties files and then work with them in auth-config.xml. so, i make this in loginManagerBean: i am aware of code duplication in register method, i'll fix it
public void register(String Remail, String Rpassword, String Rrole) throws InvalidUserException{
Properties prop = new Properties();
InputStream in = getClass().getResourceAsStream("auction-roles.properties");
try {
prop.load(in);
prop.setProperty(Remail,Rrole);
prop.store(new FileOutputStream("auction-roles.properties"), null);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
Properties prop2 = new Properties();
InputStream in2 = getClass().getResourceAsStream("auction-users.properties");
try {
prop2.load(in2);
prop2.setProperty(Remail,Rpassword);
prop2.store(new FileOutputStream("auction-users.properties"), null);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
login(Remail,Rpassword);
}
LoginManager is a named, sessionscope, stateful bean.. the thing is that login is WORKING, but at registration:
<h:commandButton id="registerButton" value="register"
action="#{loginManager.register(registerEmail, registerPassword, registerRole)}"/>
I have this errors after clicking the register button:
javax.servlet.ServletException: javax.el.MethodNotFoundException: /templates/register.xhtml @34,86 action="#{loginManager.register(registerEmail, registerPassword, registerRole)}": Method not found: class org.auction.LoginManager$244422980$Proxy$_$$_Weld$EnterpriseProxy$.register(java.lang.String, java.lang.String, java.lang.String)