Jsf 1.2: wizard implementation

Hey all. I have a question to pose to you, more out of interest than an actual need.
I have an application which contains a few wizards. So my first question was: how to implement a wizard structure using JSF? Of course my first attempt was to just create separate steps and link them together using buttons. Easy.
But then I thought: okay, what if someone has page 2 in his history and immediately goes to that one. I want to kick the user to page 1 first in that case. I pondered a long time about how to do that conditional navigation in JSF, and I came up short unfortunately. So I changed the way I did the wizard to the following:
my_wizard.jsf
This is my wizard page with a matching backing bean. The backing bean keeps track of which step the user is viewing, as an integer from 1 to MAX_STEPS. The page INCLUDES all the steps using a simple facelets ui:include.
my_wizard_step1.jsf, my_wizard_step2.jsf, etc.
These include pages contain the forms or each step. They are wrapped by an a4j:outputPanel (layout none) with a rendered attribute that has the following conditions:
step1: rendered="#{myBackingBean.step == 1}"
step2: rendered="#{myBackingBean.step == 2}"
etc.
So all steps are always included, but given the step number only one of them will actually render its content.
This works wonders and makes it only to easy to add a 'previous page' button (step -1), but it just leaves a bad taste in my mouth, especially the a4j:outputPanel.
So finally on to the real question: anybody did a JSF wizard structure in another way? I'm very interested in reading some alternative scenarios that do not include an ugly hack. Thanks!

RaymondDeCampo wrote:
That said, you might improve upon your second design by using the fact that <ui:include> will accept an EL expression for the src attribute. How you can have the backing bean return the name of the XHTML file for the step; adding steps requires only adding a new file and you can leave your template file alone.Very interesting suggestion, I'll give that a try. The only dynamic part of the filename is the step number I take from the backing bean, so that could work wonders. Thanks a lot!

Similar Messages

  • JSF Page Creation wizard title configuration uses old values!

    I just noticed that if you don't explicit change the value of the page's title in the JSF Page Creation Wizard, the page created will get the title from the last page where you changed the title.
    Tested in JDev 10.1.3.1Production and JDev 10.1.3.1 Preview

    I'm thinking this has to do with the fact that the UIComponents use the localValue after validation fails. This prevents the values from being overwritten when re-rendering the page, i.e. the inputs keep the value set by the user.
    The solution is to manipulate the components directly during the AJAX request when the first pull down is changed. Use the binding attribute to place them into your bean and clear the value directly. That way it will not matter that the expression is not evaluated.

  • [svn:cairngorm3:] 16464: Added first history and wizard implementation to SpringAS extension.

    Revision: 16464
    Revision: 16464
    Author:   [email protected]
    Date:     2010-06-04 11:07:46 -0700 (Fri, 04 Jun 2010)
    Log Message:
    Added first history and wizard implementation to SpringAS extension.
    Modified Paths:
        cairngorm3/trunk/libraries/NavigationSpringAS/.actionScriptProperties
        cairngorm3/trunk/libraries/NavigationSpringAS/src/com/adobe/cairngorm/navigation/core/Met adataUtil.as
        cairngorm3/trunk/libraries/NavigationSpringAS/src/com/adobe/cairngorm/navigation/history/ GlobalHistory.as
        cairngorm3/trunk/libraries/NavigationSpringAS/src/com/adobe/cairngorm/navigation/history/ WaypointHistory.as
        cairngorm3/trunk/libraries/NavigationSpringAS/src/com/adobe/cairngorm/navigation/landmark /AbstractNavigationProcessor.as
        cairngorm3/trunk/libraries/NavigationSpringAS/src/com/adobe/cairngorm/navigation/wizard/W izard.as
        cairngorm3/trunk/libraries/NavigationSpringASTest/src/sample1/core/presentation/Navigatio nBar.mxml

    Remember that Arch Arm is a different distribution, but we try to bend the rules and provide limited support for them.  This may or may not be unique to Arch Arm, so you might try asking on their forums as well.

  • Create jsf jsp page / page implementation / third option is not visible

    The third option (check box) for page implementation settings in the create jsf jsp page is not visible. The window is not resizable.

    I see the option radio button and text "Automatically Expose UI Components in an Existing Managed Bean" that is disabled but i see only partially the label what is a disabled input text field i suppose just below the radio button.
    I see also the Directory input field and Browse button a little bit truncated at the bottom (1-2 pixels missing).
    I see also the Render in Mobile Device check box and combo box ... cutted by the half when i expand the page implementation part.
    As said the window is not resizable.
    Let me know a location i can send you a hard copy of the screen.

  • JSF Portlet with RichFaces implementation

    I am trying to build a JSF 1.1 portlet with RichFaces implementation.
    Although, the portlet gets displayed with out any errors. I do not see the RichFaces capabilities getting executed such as "A4J:support" tag is not doing an Ajax based form validation.
    Any help on this? Are there any completed PoCs on RF compatibility with JSF portlets.
    Thanks
    Rajesh

    Hello,
    Have you resolved your issue ? I am also trying to run a RichFaces-based webapp on an Oracle portal (WCI) and I have some troubles.
    If you have time to look at my problem, I created a post here Oracle JSF Bridge with JBoss Richfaces .
    Thanks
    K.L.

  • JSF Wizard with Weld

    Hi All,
    Wanna show my imaginary design of wizard using Wizard and JSF... but it seems not works some where. firstly let us the classes I have...
    2 inferfaces and 1 abstract class
    package wziard;
    public interface IWizard {
         // The return string for the JSF path
         public String next();
         public String back();
         public String abort();
         public boolean hasNext();
         public boolean hasBack();
    package wziard;
    public interface WizardStep {
         //do the business and return JSF path
         String onNext();
         String onBack();
    }One wizard contains couple of wizardStep
    package wziard;
    import java.util.List;
    public abstract class WizardBean {
         public String next() {
              String next = getCurrentStep().onNext();
              setCurrentStep(ListUtils.getNext(getWizSteps(), getCurrentStep()));
              return next;
         public String back() {
              String back = getCurrentStep().onBack();
              setCurrentStep(ListUtils.getBack(getWizSteps(), getCurrentStep()));
              return back;
         public boolean hasNext() {
              return !ListUtils.isLast(getWizSteps(), getCurrentStep());
         public boolean hasBack() {
              return !ListUtils.isFirst(getWizSteps(), getCurrentStep());
         public abstract WizardStep getCurrentStep();
         public abstract void setCurrentStep(WizardStep curStep);
         public abstract List<WizardStep> getWizSteps();
         public abstract String abort();
    }Abstract wizardbean is to implement the wizard's constitutional features.
    Then the wizard implements
    package wziard;
    import java.util.List;
    @Stateful
    @ConversationScope
    @Named
    public class RegisterWizard extends WizardBean implements IWizard {
         @RegisterWizard // qualifier for wizards producers
         @Inject
         private List<WizardStep> wizardSteps;
         private WizardStep currentStep;
         private Conversation conversation;
         @Override
         public String abort() {
              // TODO Go the JSF and end session
              conversation.end();
              return null;
         @Override
         public WizardStep getCurrentStep() {
              // TODO Auto-generated method stub
              return currentStep;
         @Override
         public List<WizardStep> getWizSteps() {
              // TODO Auto-generated method stub
              return wizardSteps;
         @Override
         public void setCurrentStep(WizardStep curStep) {
              this.currentStep = curStep;
    }The steps implementations:
    package wziard.step;
    import wziard.WizardStep;
    import wziard.model.Account;
    public class AccountInfoStep implements WizardStep {
         @Named("newAccount");
         @ConversationScope
         private Account account;
         public Account getAccount() {
              return account;
         public void setAccount(Account account) {
              this.account = account;
         @Override
         public String onBack() {
              // TODO Auto-generated method stub
              return null;
         @Override
         public String onNext() {
              // TODO Auto-generated method stub
              return null;
    package wziard.step;
    import wziard.WizardStep;
    import wziard.model.Person;
    public class PersonInfoStep implements WizardStep {
         @Named("newPerson");
         @ConversationScope
         private Person person;
         public Person getPerson() {
              return person;
         public void setPerson(Person person) {
              this.person = person;
         @Override
         public String onBack() {
              // TODO Auto-generated method stub
              return null;
         @Override
         public String onNext() {
              // TODO Auto-generated method stub
              return null;
    package wziard.step;
    import wziard.model.Contact;
    public class ContactInfoStep implements WizardStep {
         @Named("newContact");
         @ConversationScope
         private Contact contact;
         public Contact getContact() {
              return contact;
         public void setContact(Contact contact) {
              this.contact = contact;
         @Override
         public String onBack() {
              // TODO do the business and return JSF path
              return null;
         @Override
         public String onNext() {
              // do the business and return JSF path
              return null;
    }other classes:
    package wziard.utils;
    import java.util.List;
    public class ListUtils {
         public static <T> T getNext(List<T> list, T obj) {
              // TODO Auto-generated method stub
              return null;
         public static <T> T getBack(List<T> list, T obj) {
              // TODO Auto-generated method stub
              return null;
         public static <T> boolean isLast(List<T> list, T obj) {
              // TODO Auto-generated method stub
              return false;
         public static <T> boolean isFirst(List<T> list, T obj) {
              // TODO Auto-generated method stub
              return false;
    package wziard;
    import java.util.ArrayList;
    import java.util.List;
    import wziard.step.AccountInfoStep;
    import wziard.step.PersonInfoStep;
    public class WizardProducer {
         @RegisterWizard
         @Produces
         private List<WizardStep> wizardSteps(@New AccountInfoStep s1,
                   @New PersonInfoStep s2, @New ContactInfoStep s3) {
              List<WizardStep> steps = new ArrayList<WizardStep>();
              steps.add(s1);
              steps.add(s2);
              steps.add(s3);
              return steps;
    }after all these in the JSF page
    <h:inputtext name="username" value="#{newAccount.userName}">
    <h:inputtext name="password" value="#{newAccount.password}">These ideas should be very straightforward, while the newAccount, newPerson, and newContact, which @Named in the WizardStep seems not hook up with JSF component, these value were not populated at all....
    Can anyone kindly advise? thanks.

    Hello,
    I faced the same problem, but on a Weblogic 10 server.
    The problem with Weblogic 10 is, even if it's "supposed" to be a EE5 compliant server, it is not.
    As described here http://e-docs.bea.com/wls/docs100/webapp/annotateservlet.html , there is no Dependency Injection in JSF managed beans:
    The web container will not process annotations on classes like Java Beans and other helper classes.
    But, WL 10 offers DI on Servlets, Filters and Listeners.
    Here is how I solved it (probably not the best way, but it works for me):
    - created a filter with a list of EJB injected (as it works). For every filtered request, set a list of known (enum) as request attributes mapped each to a EJB service:
    public class EJBInjectFilter implements Filter {
    @EJB
    private MyEJBService ejbRef;
    public void doFilter(ServletRequest req, ServletResponse resp, FilterChain chain) throws IOException,
                   ServletException {
    log.debug("Setting EJB ref into request as attribute ");
              req.setAttribute(ServiceEnum.MY_EJB_SERVICE.toString(), ejbRef);
              chain.doFilter(req, resp);     
    - for every managed bean who needs a service you can do something like:
    (MyEJBService) ((HttpServletRequest) FacesContext.getCurrentInstance().
                   getExternalContext().getRequest()).getAttribute(ServiceEnum.MY_EJB_SERVICE.toString())
    to get a reference to service.
    I agree it is a totally not elegant solution. But why does WL 10 say it's a full JEE5 compliant server, and though does not provide DI for managed beans?
    A drawbacks I could think of is performance slow-down (for every request, apply filter, set list of attributes + references into request) - probably it does take some time.
    Let me know your thoughts.
    Edited by: cosminj on Nov 20, 2007 8:16 AM

  • Oracle Applications Implementation Wizard

    I've installed using rapid install Oracle applications 11.5.10.2. I've read that implementing more than one module it can be much easier to use Oracle Applications Implementation Wizard. I've found documentation about this wizard but I cannot start it. Does it need to be seperatly installed after installing applications?. I do not have standard user wizard that should be created after installation of implementation wizard, also I do have only 2 roles containg word implementation
    -Implementation System Administration
    -Implementation Financials
    do I need to install/configure extra product ?

    One correction, there was installed user wizard, only the password was different then wizard. That user have assigned to implementation roles
    -Implementation System Administration
    -Implementation Financials
    documentation of application Wizard describes following steops to launch the wizard:
    1. Sign onto Oracle Applications using a user ID that has access to Implementation Wizard responsibilities. (You can use the predefine user Wizard, with password "Wizard.")
    2. Choose any of the "Implementation" responsibilities.
    3. Open the Application Implementation Wizard Startup window.
    4. Using the Process list of values, choose the Wizard Implementation Process.
    5. Leave the Context field blank.
    When I open application implementation wizard get a window with tab
    Functions / Documents / Processes
    Goint to processes I cannot choose Wizard Implementation Process, from functions I can open Implementation wizard however in the next window "Select process group" there are no process groups, so I cannot go further.
    How can I launch oracle implementation wizzard?

  • How To Create Gallery Wizard in Jdev 10.1.3.1?

    Folks,
    I'm working on an extension that will add a new file extension to JDeveloper. I would my extension to show up in the File/New Gallery. I know that this will involve code in the extension.xml and one or more Java classes.
    I've looked at the PHP extension and the extension.xml adds a PHPFileWizard to the File/New Gallery:
         <gallery>
            <item>
              <name>oracle.jdeveloper.addin.php.gallery.PHPFileWizard</name>
              <category>Web Tier</category>
              <folder>PHP</folder>
              <technologyKey>Web</technologyKey>
              <description>${PHP_FILE_DESC}</description>
            </item>
    ...Presumably PHPFileWizard implements one or more interfaces so that it is a 'legal' Gallery Wizard. Presumably my Java class needs to implement them as well. What are they? :)
    David Rolfe
    Orinda Software
    Dublin, Ireland
    Message was edited by:
    [email protected]
    (edited for clarity)

    The Extension SDK comes with a sample called class wizard that shows you how to implement a new wizard.
    There is a little error in one of the files there though.
    Here is the correct version of that file:
    package oracle.jdeveloper.extsamples.classgeneratorwizard;
    import java.awt.Dimension;
    import java.awt.Image;
    import java.io.File;
    import java.lang.reflect.Modifier;
    import java.net.URL;
    import javax.swing.JOptionPane;
    import oracle.bali.ewt.wizard.ImageWizardPage;
    import oracle.bali.ewt.wizard.Wizard;
    import oracle.bali.ewt.wizard.WizardDialog;
    import oracle.bali.ewt.wizard.WizardEvent;
    import oracle.bali.ewt.wizard.WizardListener;
    import oracle.ide.Context;
    import oracle.ide.editor.EditorManager;
    import oracle.ide.Ide;
    import oracle.ide.model.NodeFactory;
    import oracle.ide.model.Project;
    import oracle.ide.net.URLFactory;
    import oracle.ide.util.GraphicsUtils;
    import oracle.ide.wizard.WizardWelcomePage;
    import oracle.javatools.parser.java.v2.JavaConstants;
    import oracle.javatools.parser.java.v2.model.SourceBlock;
    import oracle.javatools.parser.java.v2.model.SourceClass;
    import oracle.javatools.parser.java.v2.model.SourceFile;
    import oracle.javatools.parser.java.v2.model.SourceMethod;
    import oracle.javatools.parser.java.v2.SourceFactory;
    import oracle.javatools.parser.java.v2.write.SourceTransaction;
    import oracle.jdeveloper.java.JavaManager;
    import oracle.jdeveloper.java.TransactionDescriptor;
    import oracle.jdeveloper.model.JavaProject;
    import oracle.jdeveloper.model.JavaSourceNode;
    import oracle.jdeveloper.model.PathsConfiguration;
    public class RealWizard extends Wizard implements WizardListener {
    // In this example, all images are the same. They could be different.
    private static final String WIZARD_LEFT_IMAGE_01 = "150x300_Generic.gif";
    private static final String WIZARD_LEFT_IMAGE_02 = "150x300_Generic.gif";
    private static final String WIZARD_LEFT_IMAGE_03 = "150x300_Generic.gif";
    private static final String WIZARD_LEFT_IMAGE_04 = "150x300_Generic.gif";
    private Context context;
    ImageWizardPage[] wizardPage;
    WizardWelcomePage wwp;
    ImageWizardPage iwpOne;
    ImageWizardPage iwpTwo;
    SummaryPage wsp;
    /** @snippet_reference {@start WizardContext.2} */
    private Model model;
    /** @snippet_reference {@end WizardContext.2} */
    public
    RealWizard(Context ctx) {
    this.context = ctx;
    this.model = new Model();
    this.setPreferredSize(new Dimension(166, 387));
    wwp = createWelcomePage();
    this.addPage(wwp.getWizardPage());
    /** @snippet_reference {@start WizardContext.3} */
    iwpOne = createWizardPageOne(model);
    this.addPage(iwpOne);
    PanelOne panelOne = (PanelOne)iwpOne.getInteractiveArea();
    iwpOne.addWizardValidateListener(panelOne);
    iwpTwo = createWizardPageTwo(model);
    this.addPage(iwpTwo);
    PanelTwo panelTwo = (PanelTwo)iwpTwo.getInteractiveArea();
    iwpTwo.addWizardValidateListener(panelTwo);
    wsp = createSummaryPage(model);
    /** @snippet_reference {@start WizardContext.3} */
    this.addPage(wsp);
    if (!wwp.isHidden())
    this.setSelectedPage(wwp.getWizardPage());
    else
    this.setSelectedPage(iwpOne);
    this.setMustFinish(true);
    wizardPage =
    new ImageWizardPage[] { wwp.getWizardPage(), iwpOne, iwpTwo,
    wsp };
    // Create wizard Dialog
    WizardDialog wDialog = createWizardDialog();
    wDialog.setTitle("Create a Java Class");
    this.addWizardListener(this);
    wDialog.runDialog();
    public void wizardApplyState(WizardEvent p0) {
    public void wizardCanceled(WizardEvent p0) {
    public void wizardFinished(WizardEvent p0) {
    try {
    // Get Current Project
    Project prj = Ide.getActiveProject();
    JavaSourceNode jsn = null;
    String greeting = this.model.getHelloWord();
    String greetee = this.model.getName2Greet();
    String className = "Hello" + greetee.replace(' ', '_');
    String packageName =
    JavaProject.getInstance(prj).getDefaultPackage();
    String srcPath =
    PathsConfiguration.getInstance(prj).getSourcePath().toString();
    String srcDir = "";
    if (srcPath.indexOf(File.pathSeparatorChar) > -1)
    srcDir =
    srcPath.substring(0,
    srcPath.indexOf(File.pathSeparatorChar));
    else
    srcDir = srcPath;
    URL dirURL =
    new File(srcDir + File.separator + packageName.replace('.',
    File.separatorChar)).toURL();
    URL classURL = URLFactory.newURL(dirURL, className + ".java");
    if (classURL == null) {
    JOptionPane.showMessageDialog(null,
    "Cannot create URL for " +
    className +
    ".java", "Ooops",
    JOptionPane.ERROR_MESSAGE);
    } else { // Let's go on
    jsn =
    (JavaSourceNode)NodeFactory.findOrCreate(JavaSourceNode.class, classURL);
    JavaManager javaMgr = JavaManager.getJavaManager(prj);
    SourceFile javaFile = javaMgr.getSourceFile(jsn.getURL());
    if (javaFile != null) {
    JOptionPane.showMessageDialog(null,
    "Cannot create URL for " +
    className + ".java" + "\n"
    +
    "Source Already Exists",
    "Error",
    JOptionPane.ERROR_MESSAGE);
    return;
    jsn =
    (JavaSourceNode)NodeFactory.findOrCreate(JavaSourceNode.class, classURL);
    prj.add(jsn, true);
    jsn.open();
    jsn.save();
    // Now the Node is created, let's create its content
    boolean success =
    createContent(jsn, prj, packageName, className, greeting,
    greetee);
    if (success) {
    jsn.save();
    EditorManager.getEditorManager().openDefaultEditorInFrame(jsn.getURL());
    } else {
    JOptionPane.showMessageDialog(null,
    "Cannot create node
    content",
    "Ooops",
    JOptionPane.ERROR_MESSAGE);
    } catch (Exception ex) {
    ex.printStackTrace();
    JOptionPane.showMessageDialog(null, ex.toString(), "Ooops",
    JOptionPane.ERROR_MESSAGE);
    public void wizardSelectionChanged(WizardEvent wEvent) {
    int pageNo = 0;
    try {
    pageNo = wEvent.getPage().getIndex();
    } catch (Exception ignore) {
    if (pageNo == 0) // to Welcome
    else if (pageNo == 1) {
    PanelOne p1 = (PanelOne)iwpOne.getInteractiveArea();
    p1.setDefaultValues();
    } else if (pageNo == 2) {
    PanelTwo p2 = (PanelTwo)iwpTwo.getInteractiveArea();
    p2.setDefaultValues();
    } else if (pageNo == 3) // to Summary and generation
    wsp.enterPage();
    private WizardWelcomePage createWelcomePage() {
    // This key is used to remember the "Show next time" check box!
    final String strShowAgainKey = "SAMPLE_EIGHT_REF";
    WizardWelcomePage wp = new WizardWelcomePage(strShowAgainKey);
    // Set the image
    java.awt.Image img =
    GraphicsUtils.loadFromResource(WIZARD_LEFT_IMAGE_01,
    this.getClass());
    // java.awt.Image img =
    GraphicsUtils.createImageIcon(GraphicsUtils.loadFromResource(WIZARD_LEFT_IMAGE
    _01, this.getClass())).getImage();
    if (img != null)
    wp.setImage(img);
    else
    System.out.println(WIZARD_LEFT_IMAGE_01 + " not found");
    // Set the Title
    final String welcomeTitle = "Creating a Java Class";
    wp.setTitle(welcomeTitle);
    // Set the Description Text for first page
    final String welcomeDesc =
    "This wizard will help you to create a Java Class." + "\n" +
    "This is a sample from the JDeveloper Extensions SDK
    demonstrating " +
    "how to integrate a wizard into the product." + "\n" +
    "Press Next to continue\n";
    wp.setDescription(welcomeDesc);
    // Return results
    return wp;
    private ImageWizardPage createWizardPageOne(Model m) {
    PanelOne panel = new PanelOne(m);
    final String title = "A dummy title";
    Image img =
    GraphicsUtils.createImageIcon(GraphicsUtils.loadFromResource(WIZARD_LEFT_IMAGE
    _02,
    this.getClass())).getImage();
    ImageWizardPage iwp = new ImageWizardPage(panel, img, title);
    return iwp;
    private ImageWizardPage createWizardPageTwo(Model m) {
    PanelTwo panel = new PanelTwo(m);
    final String title = "A dummy title";
    Image img =
    GraphicsUtils.createImageIcon(GraphicsUtils.loadFromResource(WIZARD_LEFT_IMAGE
    _03,
    this.getClass())).getImage();
    ImageWizardPage iwp = new ImageWizardPage(panel, img, title);
    return iwp;
    private SummaryPage createSummaryPage(Model m) {
    Image img =
    GraphicsUtils.createImageIcon(GraphicsUtils.loadFromResource(WIZARD_LEFT_IMAGE
    _04,
    this.getClass())).getImage();
    return new SummaryPage(m, img);
    private WizardDialog createWizardDialog() {
    WizardDialog wdlg = new WizardDialog(this, Ide.getMainWindow());
    return wdlg;
    private static final boolean createContent(JavaSourceNode node,
    Project prj, String
    packageName,
    String className,
    String greeting,
    String greetee) {
    boolean ret = true;
    JavaManager javaMgr = JavaManager.getJavaManager(prj);
    SourceFile javaFile = javaMgr.getSourceFile(node.getURL());
    final String QUOTE = "\"";
    String greet =
    QUOTE + greeting + QUOTE + " + \" \" + " + QUOTE + greetee +
    QUOTE + " + \"!\"";
    //logMessage("Step 1 - Initializing...");
    if (javaFile == null)
    return false;
    //logMessage("Step 2 - Getting Source File...");
    SourceTransaction st = javaFile.beginTransaction();
    try {
    SourceFactory factory = javaFile.getFactory();
    javaFile.setPackageName(packageName);
    //logMessage("Step 3 - Setting Package Name...");
    // Class Description
    SourceClass helloClass = factory.createClass(0, className);
    helloClass.addSelf(javaFile);
    helloClass.setModifiers(Modifier.PUBLIC);
    //logMessage("Step 4 - Setting Class Name...");
    // Create main method
    SourceBlock block = factory.createBlock();
    SourceMethod meth =
    factory.createMethod(factory.createType(JavaConstants.PRIMITIVE_VOID),
    "main",
    factory.createFormalParameterList(factory.createLocalVariable(factory.createTy
    pe("String",
    1),
    "args")),
    null,
    (SourceBlock)factory.createBlock("\n\n{\n\n\t" +
    "System.out.println(" +
    greet +
    ");" +
    "\n\t}"));
    meth.setModifiers(Modifier.PUBLIC | Modifier.STATIC);
    meth.addSelf(helloClass);
    //logMessage("Step 5 - Creating Main Method...");
    // Write the file
    javaMgr.commitTransaction(st,
    new TransactionDescriptor("Generate
    file"));
    //logMessage("Step 6 - Commiting Work...");
    } catch (Exception e) {
    st.abort();
    //logMessage(e.getMessage());
    ret = false;
    return ret;
    }

  • How to create dynamic DataTable with dynamic header/column in JSF?

    Hello everyone,
    I am having problem of programmatically create multiple DataTables which have different number of column? In my JSF page, I should implement a navigation table and a data table. The navigation table displays the links of all tables in the database so that the data table will load the data when the user click any link in navigation table. I have gone through [BalusC's post|http://balusc.blogspot.com/2006/06/using-datatables.html#PopulateDynamicDatatable] and I found that the section "populate dynamic datatable" does show me some hints. In his code,
    // Iterate over columns.
            for (int i = 0; i < dynamicList.get(0).size(); i++) {
                // Create <h:column>.
                HtmlColumn column = new HtmlColumn();
                dynamicDataTable.getChildren().add(column);
                // Create <h:outputText value="dynamicHeaders"> for <f:facet name="header"> of column.
    HtmlOutputText header = new HtmlOutputText();
    header.setValue(dynamicHeaders[i]);
    column.setHeader(header);
    // Create <h:outputText value="#{dynamicItem[" + i + "]}"> for the body of column.
    HtmlOutputText output = new HtmlOutputText();
    output.setValueExpression("value",
    createValueExpression("#{dynamicItem[" + i + "]}", String.class));
    column.getChildren().add(output);
    public HtmlPanelGroup getDynamicDataTableGroup() {
    // This will be called once in the first RESTORE VIEW phase.
    if (dynamicDataTableGroup == null) {
    loadDynamicList(); // Preload dynamic list.
    populateDynamicDataTable(); // Populate editable datatable.
    return dynamicDataTableGroup;
    I suppose the Getter method is only called once when the JSF page is loaded for the first time. By calling this Getter, columns are dynamically added to the table. However in my particular case, the dynamic list is not known until the user choose to view a table. That means I can not call loadDynamicList() in the Getter method. Subsequently, I can not execute the for loop in method "populateDynamicDataTable()".
    So, how can I implement a real dynamic datatable with dynamic columns, or in other words, a dynamic table that can load data from different data tables (different number of columns) in the database at run-time?
    Many thanks for any help in advance.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

    flyeminent wrote:
    However in my particular case, the dynamic list is not known until the user choose to view a table. Then move the call from the getter to the bean's action method.

  • JSF design view - visual components are shrinking

    Hello,
    I have some strange issue while using Design view for JSF and data binding.
    Once I drop any data control elements into visual component (panel, etc) my visual components are shrinking to such size, that I cannot distinguish any elements within design view. I cannot use design view since then and have to place all elements base on structure panel.
    How to reproduce:
    1. Create new JSF page with wizard and accept defaults.
    2. Drop one of the panels (panel box, panel group layout) into JSF layout
    At this stage my visual elements occupy 100% of design view screen and represent anticipated outcome
    3. Drag and drop one of the data control elements (data control panel) into created panels on JSF and create table or form
    Immediately after it visual panel where data control was dropped shrinks to approximately 1/4 of the screen and I cannot see neither available space nor created table for my data components.
    I figured out, that if I remove created by wizard default <af:messages> tag from the top of my JSF, then design view representation fixes. Not sure if I should remove <af:messages> from all my pages.
    Above all looks to me as and bug.
    Environment:
    -Jdeveloper 11g
    -Windows Vista 64b
    -Not bundled JDK 6

    Hi Shay,
    Thank you for response.
    1. I tried to play with screen size without result
    2. I checked your video post, but this does not resolve my issue
    3. This issue occures with all JSF pages and can be reproduced even when following official Oracle step by step tutorials.
    4. I figured out, that removing <af:messages> tag resolves the issue ?! It seems this tag is added by default during drag and drop binding.
    5. On this link http://drop.io/jdev_001 you can see how design view is changes with and without <af:messages> tag
    6. Below is code example from one of the tutorials, that leads to shrinking as well:
    7. Once app is deployed and running page get normal view in IE as expected, so it seems to me, it is issue with Jdev design view, probably influenced by my environment, if nobody reported it before.
    Thank you for your help.
    ===========================================================================
    <?xml version='1.0' encoding='windows-1252'?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html"
    xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
    <jsp:directive.page contentType="text/html;charset=windows-1252"/>
    <f:view>
    <af:document id="d1">
    <af:messages id="m1"/>
    <af:form id="f1">
    <af:panelStretchLayout id="psl1">
    <f:facet name="center">
    <!-- id="af_one_column_stretched" -->
    <af:decorativeBox theme="dark" id="db1">
    <f:facet name="center">
    <af:decorativeBox theme="medium" id="db2">
    <f:facet name="center">
    <af:panelFormLayout id="pfl1">
    <af:inputText value="#{bindings.p_name.inputValue}" label="#{bindings.p_name.hints.label}"
    required="#{bindings.p_name.hints.mandatory}" columns="#{bindings.p_name.hints.displayWidth}"
    maximumLength="#{bindings.p_name.hints.precision}" shortDesc="#{bindings.p_name.hints.tooltip}" id="it1">
    <f:validator binding="#{bindings.p_name.validator}"/>
    </af:inputText>
    <af:commandButton actionListener="#{bindings.getEmployeesFindByName.execute}" text="getEmployeesFindByName"
    disabled="#{!bindings.getEmployeesFindByName.enabled}" id="cb1"/>
    <af:panelFormLayout id="pfl2">
    <af:inputText value="#{bindings.commissionPct.inputValue}" label="#{bindings.commissionPct.hints.label}"
    required="#{bindings.commissionPct.hints.mandatory}" columns="#{bindings.commissionPct.hints.displayWidth}"
    maximumLength="#{bindings.commissionPct.hints.precision}" shortDesc="#{bindings.commissionPct.hints.tooltip}"
    id="it4">
    <f:validator binding="#{bindings.commissionPct.validator}"/>
    <af:convertNumber groupingUsed="false" pattern="#{bindings.commissionPct.format}"/>
    </af:inputText>
    <af:inputText value="#{bindings.email.inputValue}" label="#{bindings.email.hints.label}"
    required="#{bindings.email.hints.mandatory}" columns="#{bindings.email.hints.displayWidth}"
    maximumLength="#{bindings.email.hints.precision}" shortDesc="#{bindings.email.hints.tooltip}" id="it7">
    <f:validator binding="#{bindings.email.validator}"/>
    </af:inputText>
    <af:inputText value="#{bindings.employeeId.inputValue}" label="#{bindings.employeeId.hints.label}"
    required="#{bindings.employeeId.hints.mandatory}" columns="#{bindings.employeeId.hints.displayWidth}"
    maximumLength="#{bindings.employeeId.hints.precision}" shortDesc="#{bindings.employeeId.hints.tooltip}"
    id="it6">
    <f:validator binding="#{bindings.employeeId.validator}"/>
    <af:convertNumber groupingUsed="false" pattern="#{bindings.employeeId.format}"/>
    </af:inputText>
    <af:inputText value="#{bindings.firstName.inputValue}" label="#{bindings.firstName.hints.label}"
    required="#{bindings.firstName.hints.mandatory}" columns="#{bindings.firstName.hints.displayWidth}"
    maximumLength="#{bindings.firstName.hints.precision}" shortDesc="#{bindings.firstName.hints.tooltip}" id="it3">
    <f:validator binding="#{bindings.firstName.validator}"/>
    </af:inputText>
    <af:inputDate value="#{bindings.hireDate.inputValue}" label="#{bindings.hireDate.hints.label}"
    required="#{bindings.hireDate.hints.mandatory}" shortDesc="#{bindings.hireDate.hints.tooltip}" id="id1">
    <f:validator binding="#{bindings.hireDate.validator}"/>
    <af:convertDateTime pattern="#{bindings.hireDate.format}"/>
    </af:inputDate>
    <af:inputText value="#{bindings.jobId.inputValue}" label="#{bindings.jobId.hints.label}"
    required="#{bindings.jobId.hints.mandatory}" columns="#{bindings.jobId.hints.displayWidth}"
    maximumLength="#{bindings.jobId.hints.precision}" shortDesc="#{bindings.jobId.hints.tooltip}" id="it2">
    <f:validator binding="#{bindings.jobId.validator}"/>
    </af:inputText>
    <af:inputText value="#{bindings.lastName.inputValue}" label="#{bindings.lastName.hints.label}"
    required="#{bindings.lastName.hints.mandatory}" columns="#{bindings.lastName.hints.displayWidth}"
    maximumLength="#{bindings.lastName.hints.precision}" shortDesc="#{bindings.lastName.hints.tooltip}" id="it8">
    <f:validator binding="#{bindings.lastName.validator}"/>
    </af:inputText>
    <af:inputText value="#{bindings.phoneNumber.inputValue}" label="#{bindings.phoneNumber.hints.label}"
    required="#{bindings.phoneNumber.hints.mandatory}" columns="#{bindings.phoneNumber.hints.displayWidth}"
    maximumLength="#{bindings.phoneNumber.hints.precision}" shortDesc="#{bindings.phoneNumber.hints.tooltip}"
    id="it9">
    <f:validator binding="#{bindings.phoneNumber.validator}"/>
    </af:inputText>
    <af:inputText value="#{bindings.salary.inputValue}" label="#{bindings.salary.hints.label}"
    required="#{bindings.salary.hints.mandatory}" columns="#{bindings.salary.hints.displayWidth}"
    maximumLength="#{bindings.salary.hints.precision}" shortDesc="#{bindings.salary.hints.tooltip}" id="it5">
    <f:validator binding="#{bindings.salary.validator}"/>
    <af:convertNumber groupingUsed="false" pattern="#{bindings.salary.format}"/>
    </af:inputText>
    <f:facet name="footer">
    <af:panelGroupLayout layout="vertical" id="pgl1">
    <af:panelGroupLayout layout="horizontal" id="pgl2">
    <af:commandButton actionListener="#{bindings.First.execute}" text="First" disabled="#{!bindings.First.enabled}"
    partialSubmit="true" id="cb2"/>
    <af:commandButton actionListener="#{bindings.Previous.execute}" text="Previous" disabled="#{!bindings.Previous.enabled}"
    partialSubmit="true" id="cb3"/>
    <af:commandButton actionListener="#{bindings.Next.execute}" text="Next" disabled="#{!bindings.Next.enabled}"
    partialSubmit="true" id="cb4"/>
    <af:commandButton actionListener="#{bindings.Last.execute}" text="Last" disabled="#{!bindings.Last.enabled}"
    partialSubmit="true" id="cb6"/>
    </af:panelGroupLayout>
    <af:commandButton text="Save" id="cb5" actionListener="#{bindings.mergeDepartments.execute}"
    disabled="#{!bindings.mergeDepartments.enabled}" action="browse"/>
    </af:panelGroupLayout>
    </f:facet>
    </af:panelFormLayout>
    </af:panelFormLayout>
    </f:facet>
    </af:decorativeBox>
    </f:facet>
    </af:decorativeBox>
    </f:facet>
    </af:panelStretchLayout>
    </af:form>
    </af:document>
    </f:view>
    </jsp:root>
    Edited by: user555411 on May 2, 2010 2:08 PM

  • JSF 1.2/Tomcat 6.x

    I'm having trouble getting JSF 1.2 (myFaces implementation) running with Tomcat 6. Pretty much any JSF tag I use gives me this error:
    javax.servlet.ServletException: /index.jsp(22,4) According to TLD or attribute directive in tag file, attribute value does not accept any expressions
         javax.faces.webapp.FacesServlet.service(FacesServlet.java:152)I've done a search, and found some old threads that offer many different solutions that don't work (replace jars in tomcat lib dir, or other wierd configuration changes). It seems tomcat 6 shouldn't need any wierd hacks to play nice with JSF 1.2, as it meets the Servlet and JSP spec required. Any idea whats going on here?
    web.xml
    <?xml version="1.0" encoding="UTF-8"?>
    <web-app xmlns="http://java.sun.com/xml/ns/javaee"
               xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
               xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
                http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
               version="2.5">
        <servlet>
            <servlet-name>Faces Servlet</servlet-name>
            <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
            <load-on-startup>1</load-on-startup>
        </servlet>
        <servlet-mapping>
            <servlet-name>Faces Servlet</servlet-name>
            <url-pattern>/faces/*</url-pattern>
        </servlet-mapping>
        <servlet-mapping>
            <servlet-name>Faces Servlet</servlet-name>
            <url-pattern>*.faces</url-pattern>
        </servlet-mapping>
    </web-app>faces-config.xml
    <?xml version='1.0' encoding='UTF-8'?>
    <faces-config xmlns="http://java.sun.com/xml/ns/javaee"
                  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                  xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd"
                  version="1.2">
        <managed-bean>
           <managed-bean-name>TestFace</managed-bean-name>
           <managed-bean-class>com.jacked.TestFace</managed-bean-class>
           <managed-bean-scope>request</managed-bean-scope>
         </managed-bean>
    </faces-config>index.jsp
    <%@ page contentType="text/html;charset=UTF-8" language="java" %>
    <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
    <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
    <html>
    <head>
    <title>enter your name page</title>
    </head>
    <body>
    <f:view>
    <h1>
    <h:outputText value="JSF 1.2 Tutorial"/>
    </h1>
      <h:form id="UserEntryForm">
        <h:outputText value="Enter Your Name:"/>
        <h:inputText value="#{TestFace.test}" />
        <h:commandButton action="welcome" value="OK" />
       </h:form>
    </f:view>
    </body>
    </html>Any help is greatly appreciated.
    Thanks

    You could compare with this Pre-configured 6.0.1.0 version. I've done a manual install, but you're right, there are too many possible solutions that just don't work
    http://www.coreservlets.com/Apache-Tomcat-Tutorial/Preconfigured-Tomcat-Version.html

  • JSF 1.2 in Weblogic 10

    Hi JSF 1.2 is bundled with weblogic 10 and out of interest I tried to use it to see if it was suitable for our new development. The application works with both JSF-RI1.1 and myfaces 1.1, so I was hoping to see if 1.2 would bring any benefits.
              I have set up my weblogic.xml to deploy the 1.2 version, but when I start my app I get an exception (see below) . Do I have to undeploy the other versions? Is there anything missing from the faces-config.xml, I changed it ti use the new XML schema, but this made no difference.
              Is JSF1.2 useable in portal 10?
              <faces-config xmlns="http://java.sun.com/xml/ns/javaee"
              xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
              xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
              http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd"
              version="1.2">
              <application>
              <view-handler>org.apache.myfaces.tomahawk.application.jsp.JspTilesViewHandlerImpl</view-handler>
              </application>
              <application>
              <variable-resolver>org.springframework.web.jsf.DelegatingVariableResolver</variable-resolver>
              </application>
              </faces-config>
              Log extracts::
              Oct 15, 2007 6:48:46 PM com.sun.faces.config.ConfigureListener contextInitialized
              INFO: Initializing Sun's JavaServer Faces implementation (1.2_03-b04-FCS) for context '/nop_portal'
              Oct 15, 2007 6:48:48 PM com.sun.faces.spi.InjectionProviderFactory createInstance
              WARNING: JSF1033: Resource injection is DISABLED.
              Oct 15, 2007 6:48:49 PM com.sun.faces.config.ConfigureListener contextInitialized
              INFO: Completed initializing Sun's JavaServer Faces implementation (1.2_03-b04-FCS) for context '/nop_portal'
              <Oct 15, 2007 6:48:49 PM CEST> <Warning> <HTTP> <BEA-101162> <User defined listener com.sun.faces.config.ConfigureListener failed: j
              ava.lang.AssertionError.
              ####<Oct 15, 2007 6:48:50 PM CEST> <Error> <Deployer> <FHD3076G> <AdminServer> <[STANDBY] ExecuteThread: '3' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <> <1192466930114> <BEA-149265> <Failure occurred in the execution of deployment request with ID '1192466874504' for task '1'. Error is: 'weblogic.application.ModuleException: '
              weblogic.application.ModuleException:
                   at weblogic.servlet.internal.WebAppModule.startContexts(WebAppModule.java:950)
                   at weblogic.servlet.internal.WebAppModule.start(WebAppModule.java:353)
                   at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:204)
                   at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:26)
                   at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:60)
                   at weblogic.application.internal.flow.ScopedModuleDriver.start(ScopedModuleDriver.java:200)
                   at weblogic.application.internal.flow.ModuleListenerInvoker.start(ModuleListenerInvoker.java:117)
                   at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:204)
                   at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:26)
                   at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:60)
                   at weblogic.application.internal.flow.StartModulesFlow.activate(StartModulesFlow.java:26)
                   at weblogic.application.internal.BaseDeployment$2.next(BaseDeployment.java:635)
                   at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:26)
                   at weblogic.application.internal.BaseDeployment.activate(BaseDeployment.java:212)
                   at weblogic.application.internal.DeploymentStateChecker.activate(DeploymentStateChecker.java:154)
                   at weblogic.deploy.internal.targetserver.AppContainerInvoker.activate(AppContainerInvoker.java:80)
                   at weblogic.deploy.internal.targetserver.operations.AbstractOperation.activate(AbstractOperation.java:566)
                   at weblogic.deploy.internal.targetserver.operations.ActivateOperation.activateDeployment(ActivateOperation.java:136)
                   at weblogic.deploy.internal.targetserver.operations.ActivateOperation.doCommit(ActivateOperation.java:104)
                   at weblogic.deploy.internal.targetserver.operations.StartOperation.doCommit(StartOperation.java:139)
                   at weblogic.deploy.internal.targetserver.operations.AbstractOperation.commit(AbstractOperation.java:320)
                   at weblogic.deploy.internal.targetserver.DeploymentManager.handleDeploymentCommit(DeploymentManager.java:816)
                   at weblogic.deploy.internal.targetserver.DeploymentManager.activateDeploymentList(DeploymentManager.java:1223)
                   at weblogic.deploy.internal.targetserver.DeploymentManager.handleCommit(DeploymentManager.java:434)
                   at weblogic.deploy.internal.targetserver.DeploymentServiceDispatcher.commit(DeploymentServiceDispatcher.java:161)
                   at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.doCommitCallback(DeploymentReceiverCallbackDeliverer.java:181)
                   at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.access$100(DeploymentReceiverCallbackDeliverer.java:12)
                   at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer$2.run(DeploymentReceiverCallbackDeliverer.java:67)
                   at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:464)
                   at weblogic.work.ExecuteThread.execute(ExecuteThread.java:200)
                   at weblogic.work.ExecuteThread.run(ExecuteThread.java:172)
              java.lang.AssertionError
                   at com.sun.faces.application.ConverterPropertyEditorFactory$ClassTemplateInfo.loadTemplateBytes(ConverterPropertyEditorFactory.java:281)
                   at com.sun.faces.application.ConverterPropertyEditorFactory$ClassTemplateInfo.<init>(ConverterPropertyEditorFactory.java:172)
                   at com.sun.faces.application.ConverterPropertyEditorFactory$ClassTemplateInfo.<init>(ConverterPropertyEditorFactory.java:154)
                   at com.sun.faces.application.ConverterPropertyEditorFactory.<init>(ConverterPropertyEditorFactory.java:524)
                   at com.sun.faces.application.ConverterPropertyEditorFactory.getDefaultInstance(ConverterPropertyEditorFactory.java:544)
                   at com.sun.faces.application.ApplicationImpl.addPropertyEditorIfNecessary(ApplicationImpl.java:718)
                   at com.sun.faces.application.ApplicationImpl.addConverter(ApplicationImpl.java:675)
                   at com.sun.faces.config.ConfigureListener.configure(ConfigureListener.java:795)
                   at com.sun.faces.config.ConfigureListener.configure(ConfigureListener.java:538)
                   at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:435)
                   at weblogic.servlet.internal.EventsManager$FireContextListenerAction.run(EventsManager.java:458)
                   at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
                   at weblogic.security.service.SecurityManager.runAs(Unknown Source)
                   at weblogic.servlet.internal.EventsManager.notifyContextCreatedEvent(EventsManager.java:168)
                   at weblogic.servlet.internal.WebAppServletContext.preloadResources(WebAppServletContext.java:1721)
                   at weblogic.servlet.internal.WebAppServletContext.start(WebAppServletContext.java:2890)
                   at weblogic.servlet.internal.WebAppModule.startContexts(WebAppModule.java:948)
                   at weblogic.servlet.internal.WebAppModule.start(WebAppModule.java:353)
                   at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:204)
                   at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:26)
                   at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:60)
                   at weblogic.application.internal.flow.ScopedModuleDriver.start(ScopedModuleDriver.java:200)
                   at weblogic.application.internal.flow.ModuleListenerInvoker.start(ModuleListenerInvoker.java:117)
                   at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:204)
                   at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:26)
                   at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:60)
                   at weblogic.application.internal.flow.StartModulesFlow.activate(StartModulesFlow.java:26)
                   at weblogic.application.internal.BaseDeployment$2.next(BaseDeployment.java:635)
                   at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:26)
                   at weblogic.application.internal.BaseDeployment.activate(BaseDeployment.java:212)
                   at weblogic.application.internal.DeploymentStateChecker.activate(DeploymentStateChecker.java:154)
                   at weblogic.deploy.internal.targetserver.AppContainerInvoker.activate(AppContainerInvoker.java:80)
                   at weblogic.deploy.internal.targetserver.operations.AbstractOperation.activate(AbstractOperation.java:566)
                   at weblogic.deploy.internal.targetserver.operations.ActivateOperation.activateDeployment(ActivateOperation.java:136)
                   at weblogic.deploy.internal.targetserver.operations.ActivateOperation.doCommit(ActivateOperation.java:104)
                   at weblogic.deploy.internal.targetserver.operations.StartOperation.doCommit(StartOperation.java:139)
                   at weblogic.deploy.internal.targetserver.operations.AbstractOperation.commit(AbstractOperation.java:320)
                   at weblogic.deploy.internal.targetserver.DeploymentManager.handleDeploymentCommit(DeploymentManager.java:816)
                   at weblogic.deploy.internal.targetserver.DeploymentManager.activateDeploymentList(DeploymentManager.java:1223)
                   at weblogic.deploy.internal.targetserver.DeploymentManager.handleCommit(DeploymentManager.java:434)
                   at weblogic.deploy.internal.targetserver.DeploymentServiceDispatcher.commit(DeploymentServiceDispatcher.java:161)
                   at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.doCommitCallback(DeploymentReceiverCallbackDeliverer.java:181)
                   at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.access$100(DeploymentReceiverCallbackDeliverer.java:12)
                   at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer$2.run(DeploymentReceiverCallbackDeliverer.java:67)
                   at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:464)
                   at weblogic.work.ExecuteThread.execute(ExecuteThread.java:200)
                   at weblogic.work.ExecuteThread.run(ExecuteThread.java:172)

    It seems like you are running weblogic server 10 with assertion enabled.
              The issue is a bug in JSF 1.2 reference implementation. Please refer to
              https://javaserverfaces.dev.java.net/issues/show_bug.cgi?id=452+
              for detail. The bug has been fixed. However, the JSF1.2 library bundled weblogc 10 does not catch the fix.
              As a workaround, you can disable assertion to ignore the error. Please update if the workaround works.
              Thanks,
              -Fred.

  • JSF (RI) app hot-deploy memory leak

    I have a standard JSF (RI) based web app that appears to be working just fine in terms of functionality. However, I believe that there is a memory leak associated with the sort of frequent hot-deploy cycles that are typical during a normal development cycle. I have been monitoring the app via the jvmstat 3.0 tools and have witnessed NO memory growth in the young or old generation areas - regardless of useage pattern. All of the growth seems to happen in the perm area of memory and be directly coincidental with the occurence of a deploy. Eventually, continued hot-deply cycles will result in an OutOfMemory error on the container - please note that continued and extensive use of the app WITHOUT the aforementioned hot-deploys does NOT result in the OutOfMemory error.
    From my research so far, I have discovered the following thread:
    http://forum.hibernate.org/viewtopic.php?t=935948&postdays=0&postorder=asc&start=75
    It refers to a similar problem with hiberate (which I am NOT using) as well as a commons-logging and several others. From the looks of it, I strongly suspect that there may be an issue with JSF when it's implementation is bundled inside the WEB-INF/lib dir - i.e. inside the specific web app's ClassLoader.
    Based on the above, I have implemented a SessionContextListener that invokes the org.apache.commons.logging.LogFactory.release() inside the contextDestroyed( ServletContextEvent e ) method. This does appear to free up some perm memory but there is still large growth that appears to be directly related to the FacesServlet initialization (navigation handlers, etc). I looked into calling the FacesContext.release() method which seems to have purpose similar to that of the LogFactory.release() method. However, at the time of the contextDestroyed() invocation, FacesContext.getCurrentInstance() always returns null, so I do not ever have an opportunity to invoke the release method that I am aware of. If my suspicions are correct, than I would likely be able to avoid this problem entirely by simply placing the JSF implementation jars in the conatiner's shared lib dir - instead of bundling it inside WEB-INF/lib. However, this is not an option for this container as multiple web apps (which require the flexibility to use differing JSF implementations and versions - i.e. RI vs MyFaces, etc) will run on this container.
    I don't believe it is at all related to the problem at hand, but my container is JBoss 4.0.2.
    Any and all assistance and suggestion will be greatly appreciated! Has anyone else seen this sort of behavior? Are there any work arounds or corrective actions?
    TIA

    Has anyone else run into this? I'd greatly appreciate any assistance as I cannot seem to resolve this hot-deploy related leak.

  • EAR Structure for JSF project with EJBs

    Hi All,
    I have a JSF project which makes use of EJBs through EJB injection. The project basically consists of 3 components, which are independently archived (as JARs/WARs) and then added to an EAR. The components interact as follow:
    EJB JAR: contains the EJB code.
    Library JAR: contains the bean injection and common methods.
    JSF WAR: contains the JSF pages as well as a request (page) bean which inherits from a class in the library JAR (one containing a bean injection).
    The way I understand it, everything should work fine if I archive those components independently and then add them to an EAR (with the JSF WAR and EJB implementation JAR in the root, and the EJB interface JAR and the Library JAR in a /lib folder). If I do this, however, the bean injection fails and the bean proxy class is just null.
    I managed to get around this by adding the Library JAR to the JSF WAR's lib directory, in which case the bean injection works fine, but if I do it this way it means I'll have to add the Library JAR to all WAR components I have, which seems like needless duplication. Am I doing something wrong when creating the EAR or is this just the way it is? To make myself a bit more clear I include the EAR structures below:
    Not Working
    |_ EJB-impl.jar
    |_ JSF.war
    |_ lib
          |_ EJB-intf.jar
          |_ Library.jar
    Working
    |_ EJB-impl.jar
    |_ JSF.war
          |_ lib
                 |_ Library.jar
    |_ lib
          |_ EJB-intf.jarThank you,
    Ristretto

    Hi All,
    I have a JSF project which makes use of EJBs through EJB injection. The project basically consists of 3 components, which are independently archived (as JARs/WARs) and then added to an EAR. The components interact as follow:
    EJB JAR: contains the EJB code.
    Library JAR: contains the bean injection and common methods.
    JSF WAR: contains the JSF pages as well as a request (page) bean which inherits from a class in the library JAR (one containing a bean injection).
    The way I understand it, everything should work fine if I archive those components independently and then add them to an EAR (with the JSF WAR and EJB implementation JAR in the root, and the EJB interface JAR and the Library JAR in a /lib folder). If I do this, however, the bean injection fails and the bean proxy class is just null.
    I managed to get around this by adding the Library JAR to the JSF WAR's lib directory, in which case the bean injection works fine, but if I do it this way it means I'll have to add the Library JAR to all WAR components I have, which seems like needless duplication. Am I doing something wrong when creating the EAR or is this just the way it is? To make myself a bit more clear I include the EAR structures below:
    Not Working
    |_ EJB-impl.jar
    |_ JSF.war
    |_ lib
          |_ EJB-intf.jar
          |_ Library.jar
    Working
    |_ EJB-impl.jar
    |_ JSF.war
          |_ lib
                 |_ Library.jar
    |_ lib
          |_ EJB-intf.jarThank you,
    Ristretto

  • JSF 1.2 GraphicImage

    I got a simple application (JSF) developed using JDeveloper.
    The first page is used to register a new product, the info you provide is a title/name, description, category, quantity, and a picture.
    When the page is submitted, the information is registered into a mysql db and the picture file is copied to a folder .
    (I verified all the information the file location as well as the file path in the DB. EVERYTHING is correct.)
    This is where the problem starts:
    The submit process in the first page will do the processing discussed earlier, then the user is directed to a listing page. This page lists all products with their respective image.
    9 out 10 tests, the page will not load the picture (only the picture, everything else is loaded correctly: title, description...) of the new item(s) unless if I redeploy the application. and 1 in 10 tests, the application will behave normal as supposed.
    Any help will be greatly appreciated.
    Note: I am using GraphicImage tag
    Sincerely,

    It seems like you are running weblogic server 10 with assertion enabled.
              The issue is a bug in JSF 1.2 reference implementation. Please refer to
              https://javaserverfaces.dev.java.net/issues/show_bug.cgi?id=452+
              for detail. The bug has been fixed. However, the JSF1.2 library bundled weblogc 10 does not catch the fix.
              As a workaround, you can disable assertion to ignore the error. Please update if the workaround works.
              Thanks,
              -Fred.

Maybe you are looking for

  • Error message while trying to encode a video with afterFX composition involved

    OK, so heres the thing.  I wanna encode this video I made, in CS3, but every time I try, it says, "the source and output color space are not compatible or a conversion does not exist" This only happened after I tried adding an After Effects compositi

  • Programme RM06INP0 is NOT updaing Net price value at in ME13 screen in ECC

    Hi Experts , We are on  ECC 6.04 with SRM 7. We are using PIR as one of the SoS in Shopping cart in Classic scenario. When we are running the programme RM06INP0 in ECC in foreground /background to update the Net price field ( NETPR), but  it is only

  • Internet sharing works but the DNS part doesn't

    I'm posting this message because I believe it is a bit different from other 'Lion internet sharing' posts in terms of the source of sharing and also the results I get. Similar to other users experiencing the same problem, my internet sharing setup st

  • Postfix blocking Yahoo/webmail

    Hi I have successfully setup Postfix using osx.topicdesk's Frontline Spam Defence for OS X and this works very well at blocking most spam. However we have a problem with certain emails getting blocked. Today my colleague at our other office tried to

  • How do you update to the new Java 10.7 after the Mountain Lion upgrade?

    I recently downloaded the OS X Mountain Lion, I need the Java version 10.7 for gaming purposes. When i go to Java preferences the latest version is Java SE 6, so I tried to do a "software update" but there is no update available.