Folk,
This thread continues the thread https://community.oracle.com/thread/4060857?start=15&tstart=0 .
I am implementing a java class converter "JobDescriptionConverter.java" with ADF Form "JobDetal.jspx". Converter java code is below:
public class JobDescriptionConverter implements Converter
{
public JobDescriptionConverter { super ();}
// get string from UI (RTF) and convert the string into the format that is stored in Database.
public Object getAsObject(FacesContext facesContext, UIComponent uiComponent, String string)
{ return string; }
// get Data from Database and convert the data to the format for UI. Filter byte code 0x0a and replace it with <br>.
public String getAsString(FacesContext facesContext, UIComponent uiComponent, Object object)
{
String obj1, obj2;
// get the whole string from Database table and store it in variable obj1.
obj1 = object.toString();
if (obj1 != null)
{
obj2 = obj1.replaceAll("0A", "<br>"); // replace 0A with <br> and store the new string in obj2.
return obj2;
}
else { return null;}
}
}
The way in which I register the converter is to do 2 things below:
1) In the file faces-config.xml, select "converters", click "+",
ID: JobDescriptionConverter
Class: JobOnlineApplication.GUI.JobDescriptionConverter.java
2) In the file JobDetail.jspx, click "Source" tab, in the field "Description" add the line below:
<af:inputText ...>
<f:converter converterId="JobDescriptionConverter"/>
</af:inputText>
Because the converter cannot be reached using converterId, I add the file path below:
<af:inputText ...>
<f:converter converterId="JobOnlineApp.GUI.JobDescriptionConverter.java"/>
</af:inputText>
Then the converter can be reached. But after run the converter, debugging Log comes up the error message below:
<Application Impl><createConverter>JSF1006: Cannot instantiate Converter of type JobOnlineApp.GUI.JobDescriptionConverter.java.
In Log extensions tab, for both cases, there is an error message below:
Unknown Source. Error: Failed to create stream factory class oracle.ide.net.ideWrapperURLStreamHandlerFactory.
I have 3 questions:
1) Why the converter cannot be reached by <f:converter converterId="JobDescriptionConverter"/> ?
2) How to solve the error "JSF1006: Cannot instantiate Converter of type JobOnlineApp.GUI.JobDescriptionConverter.java" ?
3) Does the error in Log Extensions cause the problem ? How to solve the issue ?
Thanks in advance.