Struts, Ant, Weblogic & Java Beans! (whats going on?)

Dear all
Could anyone who can spend some time for me, tell me how I should I go about to use Srtuts, Ant, Java Bean and Web Logic.
I have joined my team newly, couldn�t cope up with the technology they are using.
Basically im struggling to use Ant to build the files for Weblogic. Any help will be of much use for me.
Pls don�t try to give me nose-cut by �go and do google search�.
Ihv done enough of it(dont want to test my PLs patiance), before coming to sun!
Thanks & regards
Vijay

WebLogic datasource may be created in the Administration Console. build.xml script and build.properties are not required.
http://java.sys-con.com/node/325151

Similar Messages

  • What is the difference between java direct or java bean in JSP?

    What is the difference if I use java code directly in JSP or use java bean in JSP?
    Which class to use for receiving the passed parameter from html or java script? Any difference for java code and java bean in the way receiving the passed data?
    How can I pass string from jsp to html or java script?

    it's generally accepted as better design to separate presentation from logic. meaning, the java code in the jsp should be used to support displaying data, as oppsoed to implementing the application - like database access, etc.
    when the logic is separated from the presentation, it allows you to reuse logic components within several jsp pages.
    if you decide to change the presentation layer in the future (to support wap, for example) you don't need to rewrite your entire application, since the "guts" of the application is outside of the jsps.
    it is also a good idea to separate your business logic from your data layer. adding a "buffer zone" between these layers helps in the same manner as in separating presentation from logic. if you're using flat files for storage now, upgrading to a database wouldn't require rewriting all your business logic, just the methods which write out the data to a file, for example.
    once you feel comfortable with separating the various layers, check out the struts framework at http://jakarta.apache.org/
    to answer your second question, to get parameters passed in from HTML forms, use ServletRequet's getParameter() method.
    in tomcat:
    <% String lastName = request.getParameter( "lastname" ); %>
    to answer your third question: when displaying the HTML from withing a jsp, print out the string to a javascript variable or a hidden form element:
    <% String firstName = "mike"; %>
    <input type="hidden" name="firstname" value="<%= firstName %>">
    <script language="javascript1.2">
    var firstName = "<%= firstName %>";
    </script>
    this jsp results in the following html:
    <input type="hidden" name="firstname" value="mike">
    <script language="javascript1.2">
    var firstName = "mike";
    </script>

  • Struts 2: Doesn't populate an array of java beans in action classes

    Hello,
    Currently i am working on Struts 2 based application, in which i need to populate an array of Java beans from the form.
    The problem, I am facing is:
    Struts 2 is not instantiating an array of beans
    I have gone through the Data transfer and Type Conversion of struts of 1.2, but every where I can see only following:
    1 An array of primitive data types
    2 List of primitive / Java bean
    3 Map of primitive / Java bean
    but i can't see the docs on An array of Java Beans.
    What I can't do in my application is:
    1 Can not convert an array of beans into java.util.List<beans>
    2 Can not instantiate the bean array (As the number of elements will be decided by the front end - form)
    Please have a look at my configuration file:
    struts.xml:+
    <?xml version="1.0" encoding="UTF-8" ?>
    <!DOCTYPE struts PUBLIC
    "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
    "http://struts.apache.org/dtds/struts-2.0.dtd">
    <struts>
    <constant name="struts.devMode" value="true" />
    <include file="test/test.xml"/>
    </struts>
    test.xml:+
    <?xml version="1.0" encoding="UTF-8" ?>
    <!DOCTYPE struts PUBLIC
    "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
    "http://struts.apache.org/dtds/struts-2.0.dtd">
    <struts>
    <package name="test" namespace="/test" extends="struts-default">
    <action name="TestInput">
    <result>/test/input.jsp</result>
    </action>     
    <action name="TestOutput" class="test.Controller">
    <result name="SUCCESS">/test/output.jsp</result>
    </action>
    </package>
    </struts> Controller.java+
    package test;
    public class Controller {
    private String id = null;
    private Contact[] contacts = null;
    public String execute()  {
    System.out.println("***********************************");
    System.out.println("id::: " + getId());
    System.out.println("contacts::: " + getContacts());
    System.out.println("***********************************");
    return "SUCCESS";
    public Contact[] getContacts() {
    return contacts;
    public void setContacts(Contact[] contacts) {
    this.contacts = contacts;
    public String getId() {
    return id;
    public void setId(String id) {
    this.id = id;
    } Contact.java:+
    package test;
    public class Contact {
    private String name = null;
    public String getName() {
    return name;
    public void setName(String name) {
    this.name = name;
    }+ input.jsp:+
    <%@ page contentType="text/html; charset=UTF-8" %>
    <%@ taglib prefix="s" uri="/struts-tags" %>
    <html>
    <head>
    <title>Test Form</title>
    </head>
    <SCRIPT type="text/javascript">
    // Total number of contacts in the mail request form
    var totalContacts = 0;
    function addContact() {
    var tbody = document.getElementById('testTable').getElementsByTagName('tbody')[0];
    var row = document.createElement('TR');
    var td1 = document.createElement('TD');
    var td2 = document.createElement('TD');
    var inputBox = document.createElement('INPUT');
    td1.innerHTML = new String('Contact ' + (totalContacts + 1) + ' :');
    inputBox.type = 'text';
    inputBox.name = 'contacts['+totalContacts+'].name';
    //inputBox.name = 'contacts.name';
    td2.appendChild(inputBox);
    row.appendChild(td1);
    row.appendChild(td2);
    tbody.appendChild(row);
    // Add to the total number of contacts
    totalContacts += 1;
    </SCRIPT>
    <body>
    <h4>Mail Request Form</h4>      
    <s:form action="TestOutput">
    <table border="1" id="testTable">
    <tr>
    <td colspan="2">
    <s:textfield name="id" label="Request Id"/>
    </td>
    </tr>
    <tr>
    <td align="left">
    <input type="button" value="Add Contact" onklick="javascript:addContact();"/>
    </td>                              
    <td align="right">
    <s:submit/>                         
    </td>     
    </tr>     
    </table>
    </s:form>
    </body>
    </html>
    + output.jsp:+ Not concerned right now
    Exception got in the logs after submitting the form:+
    java.lang.InstantiationException: [Ltest.Contact;
    at java.lang.Class.newInstance0(Unknown Source)
    at java.lang.Class.newInstance(Unknown Source)
    at com.opensymphony.xwork2.ObjectFactory.buildBean(ObjectFactory.java:123)
    at com.opensymphony.xwork2.util.InstantiatingNullHandler.createObject(InstantiatingNullHandler.java:123)
    at com.opensymphony.xwork2.util.InstantiatingNullHandler.nullPropertyValue(InstantiatingNullHandler.java:104)
    at ognl.ASTProperty.getValueBody(ASTProperty.java:94)
    at ognl.SimpleNode.evaluateGetValueBody(SimpleNode.java:170)
    at ognl.SimpleNode.getValue(SimpleNode.java:210)
    at ognl.ASTChain.setValueBody(ASTChain.java:168)
    at ognl.SimpleNode.evaluateSetValueBody(SimpleNode.java:177)
    at ognl.SimpleNode.setValue(SimpleNode.java:246)
    at ognl.Ognl.setValue(Ognl.java:476)
    at com.opensymphony.xwork2.util.OgnlUtil.setValue(OgnlUtil.java:186)
    at com.opensymphony.xwork2.util.OgnlValueStack.setValue(OgnlValueStack.java:158)
    at com.opensymphony.xwork2.util.OgnlValueStack.setValue(OgnlValueStack.java:146)
    at com.opensymphony.xwork2.interceptor.ParametersInterceptor.setParameters(ParametersInterceptor.java:193)
    at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:159)
    at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)
    at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
    at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
    at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
    at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
    at com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:105)
    at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
    at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
    at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
    at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
    at org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:83)
    at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
    at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
    at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
    at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
    at org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:207)
    at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
    at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
    at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
    at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
    at com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:74)
    at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
    at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
    at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
    at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
    at com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:127)
    at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
    at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
    at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
    at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
    at org.apache.struts2.interceptor.ProfilingActivationInterceptor.intercept(ProfilingActivationInterceptor.java:107)
    at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
    at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
    at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
    at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
    at org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:206)
    at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
    at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
    at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
    at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
    at com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:115)
    at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
    at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
    at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
    at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
    at com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:143)
    at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
    at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
    at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
    at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
    at com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:121)
    at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)
    at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
    at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
    at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
    at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
    at org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:170)
    at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
    at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
    at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
    at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
    at com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:123)
    at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
    at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
    at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
    at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
    at com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:176)
    at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
    at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
    at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
    at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
    at org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:50)
    at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:504)
    at org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:419)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
    at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
    at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
    at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
    at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
    at java.lang.Thread.run(Unknown Source)
    Please give me suggestions to move forward
    Thanks in advance
    Vikas Parikh

    I am having the same issue. It appears that the RequestProcessor.processValidate adds the errors (ActionMessages) to the request the does a forward. As such the errors are not available to the jsp page. Does any one know a way to get round this?

  • Problems with a java bean in Weblogic 5.1

    Hello,
              I am having a problem deploying a java bean in Weblogic 5.1:
              I have been given a .class and a .jar file for a java bean (not an EJB). I
              placed the .class file into e:\temp\WEB-INF\classes and added the following
              line to my weblogic.properties file:
              weblogic.httpd.webApp.testApp=e:/temp/
              I have also updated the web.xml file in the WEB-INF directory as follows:
              <?xml version="1.0" encoding="UTF-8"?>
              <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web
              Application 1.2//EN"
              "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">
              <web-app>
              <servlet>
              <servlet-name>EdIface</servlet-name>
              <jsp-file>test.jsp</jsp-file>
              </servlet>
              <servlet-mapping>
              <servlet-name>EdIface</servlet-name>
              <url-pattern>EdIface</url-pattern>
              </servlet-mapping>
              </web-app>
              When I try to access my http:\\server:port\testApp\test I get an "Error
              500 - internal server error".
              Has anyone had experice with deploying a java bean with jsut the .class and
              .jar file? Where should I put the .jar file?
              I appreciate any advice!
              

    Bump

  • What's the difference between using java directly in JSP and java bean

    What is the difference if I use java code directly in JSP or use java bean in JSP?
    Which class to use for receiving the passed parameter from html or java script? Any difference for java code and java bean in the way receiving the passed data?
    How can I pass string from jsp to html or java script?

    1 Cleaner pages
    2 you have to write the class and use set and get methods
    3 What do you mean when saying passing string from jsp to html??, do you mean the value you can use <%=variablename%>

  • What is an enterprise java bean

    Hi,
    What is an enterprise java bean. How is it different from normal java means.
    Thanks a lot,
    Chamal.

    Well an EJB is a object components that lives in the server's container's guts, there are 3 kinds of EJB:
    * Session Beans: performs bussines operations
    * Entity Beans: represents a table from a relational database
    * Message Driven Beans: receives and controlls messages.
    more information about it can be found at: http://java.sun.com/products/ejb/reference/docs/index.html

  • What are Java Beans?

    Can someone tell me what they do please?
    Saple codes might help too

    Here's a simple Java Bean:
    import java.io.Serializable;
    public class SampleBean implements Serializable
        private static final String DEFAULT_MESSAGE = "Do a Google search on 'Java Beans next time'";
        private String message;
        public SampleBean() { this(DEFAULT_MESSAGE); }
        public SampleBean(final String message) { this.message = message; }
        public String getMessage() { return this.message; }
        public void setMessage(final String newMessage) { this.message = newMessage; }
    }Do a Google search to learn more. Sun has Java Bean tutorials.

  • Weblogic 6.1 SP2 Caching Java Bean

    Hi,
    It seems like Weblogic 6.1 SP2 caches Java Bean, because any changes in Java Bean requires restart of the Instance. Is there any alternative to it , i am sure there will be..
    waiting for reply .

    Nope don't think so.
    Any time you change the code of your javabeans, you need to redeploy them on the server - that normally requires a restart to pick up the changes.
    Its the same with Tomcat and JRUN.

  • What is java beans?

    what is the difference between java application and java beans?
    thanks!

    Hmm, I'm gonna have a go at this - hopefully someone will build on it with more differences or requirements:
    A Java Bean is merely a Java class written to conform to some simply rules for construction and method naming eg:
    public class MyBean
      private String myField;
      public MyBean()
      public void setMyField(String myField)
        this.myField = myField;
      public String getMyField()
        return myField;
    }Applications can use Java Beans without having to know about the class in advance - a typical situation might be their use in visual GUI editors where the properties of the bean can be exposed and manipulated by the editor through examination of the method names or an accompanying descriptor.
    An Enterprise Java Bean doesn't have all that much in common with a Java Bean. An EJB is a small set of classes meeting a single (usually) business requirement written to conform to the EJB specification. This enables them to be used by J2EE Application servers to perform enterprise business functions (data storage, manipulation, business logic etc.). The whole idea is that by writing to the specification the server can automatically provide support for transaction management, concurrent access, scaleability, etc that a mission-critical system might require without the programmer having to understand the workings of the application server.
    Essentially an EJB can either
    1) maintain the permanent state of a business object (eg, hold the data for a single product in a catalogue)
    2) perform a small set of business operations (eg, place an order for a customer)
    3) act in response to messages passed around the system (eg, send a mail to the user when the items have been shipped)
    I would have a look at the following two pages to get a better overview:
    http://java.sun.com/products/javabeans/
    http://java.sun.com/products/ejb/
    Hope this helps.

  • Approach of Java Bean Model: What is the best way?

    Hi Experts,
    In our project, we are trying to connect Oracle Database and display the tables and information in it on Web Dynpro View.
    For this I'm following 4 step procedure broadly:
    1. Java DC: a) Create Class files --> one for connecting Database (JDBC Connectivity) ; other only having Input and Output variables with corresponding getter & setter methods ;and one more class file having all methods. I make Jar file out of this class files and store that within that DC project under _comp folder.
    2. Ext Lib DC: a) Copy the created Jar file in Library and make 2 public parts (one PP for compile time and other PP for assembly time).
    3. SAP J2EE DC: a) Create DC of type Library and above create PPs is added to this library.
    4. Web Dynpro DC: a) Add SAP J2EE DC of Library Type in my Used DCs. b) This will make the  JAR file created in Java DC to be available in options of " Jars from Pubilc Part" and  use all these class files as Models. And Using them we access the Oracle DB and get access to data.
    This proved to long exercise. I want to know if there is any other approach available other than this. I'm aware EJB Models approach, but this will be hit on my performance, so want to avoid this. Yet if any shorter approach is available.
    My Idea behind this long approach is from the SDN provided example on Java bean where in Web Dynpro Project uses a local jar file created from Java project which wraps a EJB Module project and Enterprise Application project. So in DC perspective if we have to include jar file we have to make it public part.
    <a href="/people/valery.silaev/blog/2005/09/14/a-bit-of-impractical-scripting-for-web-dynpro from Valery : A bit of (impractical) scripting for Web Dynpro</a> was in great help for making jar file exposed as Public part.
    I want opinions and suggestion on this regard and best available approaches.
    Thanks in advance
    Srikant

    D.V.,
    Here is an option to trun steps 1-4 into 1-2
    As far as you are using your Java classes only from WD DC-s, then:
    1. Put all your Java source in WD DC, create single public part for compilation. Bonus: you may create JavaBean model right here and add it to public part as well.
    2. In other WD DC-s refer public part created above and add run-time reference (via Project -> Properties) to corresponding DC. Now you can use both Java classes and JavaBean model.
    Valery Silaev
    SaM Solutions
    http://www.sam-solutions.net

  • What makes a Java Bean invaild for a model import?

    I'm busy prototyping some functionality that will expose some MDM 5.5 data through a WebDynpro application.  I'm having a problem creating a java bean that will sit in front of an EJB, in that the Bean importer will refuse to import a bean if a certain line of code in a method is visible.  Here's the offending code from the method:
    try {
         A2iResultSet rs = cat.GetRecordsByValue(ary, rsd, Schema.MyTable.NAME);
         setEventLocation(rs.GetValueAt(0, Schema.MyTable.EVENT_LOCATION).GetStringValue());
    } catch (StringException e) {
         setEventLocation("failed to find record");
    Note that I have a class instance variable called 'eventLocation', which has get/set methods defined for it, thereby satisfying the Javabean requirement.
    The first two lines of the 'try' block are the problem.  If I comment them out and assemble the DC, I can import the Bean into a model with no issues.  If I uncomment them, I cannot import the bean - I get a message that says 'Invalid Jar - no beans to import'.
    Can someone explain why this is happening?  Does it have something to do with the StringException?  As far as I can tell from the Java bean model import documentation, I think I'm doing everything correctly, but something must be amiss.
    Suggestions?

    Pablo,
    Now I understand your question in comments to my blog better
    You have to add "ejb20" classes to your WebDynpro project as well, and import model afterwards.
    In WebDynpro DC expand path (<project> -> DC MetData -> DC Definition -> Used DC) and invoke "Add Used DC..." in contextual menu. In dialog select "<dev. config> -> SAP-J2EE -> ejb20 -> DC MetaData -> Public Parts -> default". Set dependencies Built-time (probably Design-time as well). Click OK. Try to import model. If fails, restart IDE and try to import again.
    Valery Silaev
    EPAM Systems
    http://www.NetWeaverTeam.com/

  • What is the difference between Java Beans and EJBs ?

    Hi,
    Can someone tell me that ? Kind of confused... Thanks !
    Philip

    Hmm, I'm gonna have a go at this - hopefully someone will build on it with more differences or requirements:
    A Java Bean is merely a Java class written to conform to some simply rules for construction and method naming eg:
    public class MyBean
      private String myField;
      public MyBean()
      public void setMyField(String myField)
        this.myField = myField;
      public String getMyField()
        return myField;
    }Applications can use Java Beans without having to know about the class in advance - a typical situation might be their use in visual GUI editors where the properties of the bean can be exposed and manipulated by the editor through examination of the method names or an accompanying descriptor.
    An Enterprise Java Bean doesn't have all that much in common with a Java Bean. An EJB is a small set of classes meeting a single (usually) business requirement written to conform to the EJB specification. This enables them to be used by J2EE Application servers to perform enterprise business functions (data storage, manipulation, business logic etc.). The whole idea is that by writing to the specification the server can automatically provide support for transaction management, concurrent access, scaleability, etc that a mission-critical system might require without the programmer having to understand the workings of the application server.
    Essentially an EJB can either
    1) maintain the permanent state of a business object (eg, hold the data for a single product in a catalogue)
    2) perform a small set of business operations (eg, place an order for a customer)
    3) act in response to messages passed around the system (eg, send a mail to the user when the items have been shipped)
    I would have a look at the following two pages to get a better overview:
    http://java.sun.com/products/javabeans/
    http://java.sun.com/products/ejb/
    Hope this helps.

  • Re: Running Struts on weblogic - more info

    Below is a response that was snipped from the struts-user mail list. Yet
              another case of BEA dis-information! When will you guys finally admit that you
              don't totally support the JSP1.1/Servlet2.2 specification. SOS. (Same old
              S..t)
              The responses below are from Craig McClanahan who is one of the guys in involved
              in struts. I believe he is responsible for the effort, but don't quote me on
              that!
              WebLogic wrote:
              > You should be able to get past this point with service pack 5. One of the
              > problems with struts is that some of
              > the pages take advantage of non-standard behaviour in Tomcat, however. For
              > example, in the bean-cookie.jsp
              > test they attempt to set a property on a bean that was never useBeaned.
              > Section 2.13.2, JSP 1.1 spec:
              >
              ---------------------------- Begin Quote
              The "bean-cookie.jsp" actually uses <jsp:getProperty>, not <jsp:setProperty>.
              In this particular case the relevant spec language is Section 2.13.3:
              "An <jsp:getProperty> action places the value of a Bean instance
              property, converted to a String, into the implicit out object, from
              which you can display the value as output. The Bean instance
              must be defined as indicated in the name attribute before this point
              in the page (usually via a useBean action).
              Note the word "usually" -- the reason it is here is because custom tags can be
              defining elements as well, as long as they use the corresponding TagExtraInfo
              class and, in the tag, call pageContext.setAttribute() appropriately. In this
              page, the call
              <bean:cookie id="sess" name="JSESSIONID"/>
              is the defining element that looks up the cookie named "JSESSIONID" (more on
              that
              name below) and exposes it as a JSP bean. This tag precedes the use of the bean
              in statements like this:
              <jsp:getProperty name="sess" property="domain"/>
              which looks up the "domain" property of the cookie (i.e. it calls getDomain())
              and
              writes that to the output stream.
              Thus, this page conforms to the JSP 1.1 spec requirements.
              ---------------------------- End Quote
              >
              > The name of a Bean instance defined by a <jsp:useBean> element or some other
              > element. The Bean instance must contain the property you want to set. The
              > defining element (in JSP 1.1 only a <jsp:useBean> element) must appear
              > before the <jsp:setProperty> element in the same file.
              >
              ---------------------------- Begin Quote
              Note the phrase "or some other element" -- again, custom beans can be defining
              elements, so this page would be valid even if it had been using
              <jsp:setProperty>
              instead. It is interesting to note that the corresponding paragraph in the JSP
              1.2 draft specification (Section 4.2.2.1, p. 63) has been clarified to indicate
              this:
              "The name of a Bean instance defined by a <jsp:useBean>
              or some other element. The Bean instance must contain the
              property you want to set. The defining element must appear
              before the <jsp:setProperty> element in the same file.
              so the confusing parenthetical comment about <jsp:useBean> has been removed.
              Even
              if it's a little inconsistent in 1.1, the intent is clear -- custom tags can be
              defining elements for JSP-accessible beans. That is the whole point of the
              TagExtraInfo functionality.
              ---------------------------- End Quote
              > They also hard-code the Tomcat session identifier into the tests. If you
              > want them to work either change the weblogic cookie name to JSESSIONID or
              > change the references to JSESSIONID to WebLogicSession.
              >
              ---------------------------- Begin Quote
              Servlet API Specification, Version 2.2, Section 7.1.2, p. 35:
              "Session tracking through HTTP cookies is the most used
              session tracking mechanism and is required to be supported
              by all servlet containers. The container sends a cookie to the
              client. The client will then return the cookie on each subsequent
              request to the server unambiguously associating the request
              with a session. The name of the session tracking cookie must
              be JSESSIONID.
              Prior to 2.2, the servlet container could use whatever cookie name it wanted.
              However, for 2.2 onwards, the cookie name is fixed for all containers.
              There may well be spec compliance issues with Struts that need to be fixed (such
              as the current question over whether body content can be accessed in the
              doEndTag() method of a custom tag). However, on these two issues, Struts
              complies
              with the specification.
              ---------------------------- End Quote
              Sam, it interesting that OTHER application servers can support struts. It's
              probably just a case that you don't handle the specification very well. Is this
              also why your server has not passed the J2EE compatibility tests? Oh, I'm sure
              that you guys will complain about SUN and licensing. I understand your
              complaints and I agree, but that doesn't have to do with specification
              compliance! ;^)
              BTW, everyone, there is a serious ClassCastException that should be fixed in
              service pack 6. This particular exception illustrates that BEA Weblogic 5.1 sp5
              does not support web applications properly. I created an web application under
              Tomcat3.1 and moved it to Weblogic5.1sp5. I was receiving ClassCastExceptions
              when I was trying to access an object that was passed in my JSP request and
              display it on a JSP page. I'm grateful that one of the support people finally
              fixed the problem. However, this was only a temporary patch. I'm told the
              "official patch" will be included with sp6.
              Let's hope that some day BEA Weblogic will be compliant. BTW, why is it you are
              charging so much. Oh it must be for the great support! ;-)
              If you BEA Weblogic users would like some addition links to application servers
              that support JSP1.1/Servlet2.2 specification better than Weblogic, here are two.
              http://www.orionserver.com (This is actually a full J2EE class application
              server. It has not passed the compatibility test, but they do a hell of a
              better job than BEA Weblogic. BTW, it's much cheaper too.)
              http://www.caucho.com/ (This is an open source effort. They are only in beta
              with EJB support and they are using Servlets and XML to implement the EJB
              specification. There is a charge for commercial use. Many people are using
              this engine to do the JSP/Servlets and Weblogic to do EJBs. Wonder what will
              happen when they provide EJB support?)
              You know I thought this news group was to help solve problems with Weblogic. It
              has turned into a newsgroup that tries to hide problems and respond with
              dis-information. However, this is just my opinion, just as Sam expressed his
              opinion about struts. That's assuming Sam's email was an opinion, I just
              figured it was since he did not know the JSP1.1/Servlet2.2 specification. Sorry
              if I was wrong.
              Steve
              > Sam
              >
              > "kevinx" <[email protected]> wrote in message
              > news:[email protected]...
              > > "kevinx" <[email protected]> wrote:
              > > >
              > > >I'm trying to get the Struts examples from Apache Group
              > (http://jakarta.apache.org/struts) to run on Weblogic server but getting no
              > where. The examples run perfectly on Tomcat 3.1.
              > > >
              > > >Has anyone successfully ported struts on Weblogic? Any hint is
              > appreciated.
              > > >
              > > >Thanks
              > > >Kevin
              > >
              Steven D. Wilkinson, [email protected]
              President, Elkhorn Creek Software, Inc.
              Co-author: Professional JSP, Wrox Press Inc.; ISBN: 1861003625
              Silent author: Developing Java Servlets, Sams; ISBN: 0672316005
              

    Has anyone had any luck getting struts to run with later service packs? I've got SP6 installed and now get the following when trying to run the struts-example app:javax.servlet.jsp.JspException: Missing resources attribute org.apache.struts.action.MESSAGE at org.apache.struts.taglib.MessageTag.doStartTag(MessageTag.java:360)
              

  • Serializing Java Bean to XML

    I would like to know if it is possible with XMLBeans to convert existing java beans to XML.
    I learnt by going trhu' few materials of XMLBeans that we need to create bean classes from XSD and can use these classes for marshalling/unmarshalling.
    But I have java beans already defined which I want to serialize/deserialize to/from XML.
    Thanks in advance.
    --Ramu                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    If you are not interested in writing a bunch of code (which is probably the case), I know of a couple options for WLS 8.1:
    1. Use the "undocumented" and "unsupported" java2xsd class, in the %WL_HOME%\server\lib\webservices.jar.
    2. Use the Java2Schema tool in the Systinet Server for Java product.
    Here's the contents of a sample build.xml that uses the java2xsd class:
    <project
    name="java2xsd"
    default="assemble"
    basedir="."
    >
         <path id="compile.classpath">
              <fileset dir="d:/bea81sp4/">
                   <include name="lib/tools.jar" />
              </fileset>
              <fileset dir="d:/bea81sp4/weblogic81">
                   <include name="server/lib/weblogic.jar"/>
                   <include name="server/lib/webservices.jar"/>
              </fileset>
         </path>
         <target name="clean">
              <delete dir="xsd" />
         </target>
         <target name="run-java2xsd">
    <delete dir="xsd" />
    <mkdir dir="xsd"/>
    <java
         classname="weblogic.xml.schema.binding.util.java2xsd"
    fork="true"
    >
    <jvmarg line="-Djava.io.tmpdir=xsd"/>
    <arg line="
    com.acme.world.schema.x2005.x11.elending.Loan
    com.acme.world.schema.x2005.x11.elending.Applicant
    com.acme.world.schema.x2005.x11.ebillpay.Account
    "/>
    <classpath>
    <path refid="compile.classpath"/>
    <pathelement location="classes"/>
    </classpath>
    </java>
         </target>
         <target name="assemble" depends="run-java2xsd">
         </target>
    </project>
    Here, you would replace the paths in the <path> element of course, but you would also need to come up with a way to provide a list of the JavaBean classes to process. The good thing is that java2xsd is smart enough to put all the classes in a given Java package, in the same <xs:schema> element :-) For instance, in:
    <arg line="
    com.acme.world.schema.x2005.x11.elending.Loan
    com.acme.world.schema.x2005.x11.elending.Applicant
    com.acme.world.schema.x2005.x11.ebillpay.Account
    "/>
    the complexType element for "Loan" and "Applicant", will be defined in the same <xs:schema>. There will only be one schemas.xsd file. I don't know of an easy way to change the file name, but it will contain a <xs:schema> for each unique Java package name. Once you have this schemas.xsd file, you can decide how you want to create the XMLBeans from it. You can either break each <xs:schema> element out into it's own .xsd file, or create a WSDL that uses the contents of the schemas.xsd file. You'll notice that there is a <type> element wrapping all the <xs:schema> elements in the schemas.xsd file, which is exactly the name of the element that WSDL uses :-)
    Again, java2xsd is not a "supported" class, so don't confuse it (or the information provided above) with being "the tool that BEA provides" for doing what you want to do :-)
    Regards,
    Mike Wooten

  • Running Struts on Weblogic

    Hi,
    I've just started to explore Struts, and am trying to set up a very simple example with one simple Action, one Form Bean using the validate() method to manually validate inputs.
    I've gotten the example working in Tomcat. However when I tried to run the same example on Weblogic, I ran into some problems with the message resources for the validation.
    On Tomcat, if I trigger a validation error, I got this message on my form page:
    Wrong Login NameHowever when I tried the same code on Weblogic, I got this instead.
    ???en_US.errors.wrongLoginName???The error key in my .properties file is errors.wrongLoginName. So it seems like Weblogic prefixes the key with the locale before it tries to look for the key. Any ideas how to stop Weblogic from doing that? Or are there better ways to code my application so that it works without modifications on both Tomcat and Weblogic?
    Also anyone familiar with what I may need to take note of when developing Struts application for Weblogic?
    I'm sorry if this is not exactly the right forum to post this, but I can't find a more appropriate one to post this. Anyone knows of any good Struts forum that I can join?
    Thanks in advance for any replies!

    Hi all,
    Just found out what's wrong with this. Apparently the weblogic deploy script that I was using (I'm developing on Eclipse, and am using Ant deploy scripts to deploy to Tomcat and Weblogic) had some problems. It didn't deploy the .properties files.
    Sorry, my bad :-(
    I would still however hope to get some advice on the Struts forums and also if there are any known issues anyone has encountered when running Struts with Weblogic.

Maybe you are looking for

  • Installed new SSD. How do I get my files back from Time Machine?

    Hi all, if you take the time to read my issue, thanks a lot. I appreciate any help you can offer, and sorry if anything is unclear... The 1tb drive eventually failed on my 2009 27", quad core i7 imac. I had USB backup using time machine to an externa

  • SOAP to JMS synch scenario issue

    Dear Experts, I am working on SOAP to JMS (Websphere MQ) synch scenario.In the ESR i created 2 synch service interfaces(1 Inbound & 1 outbound). I created my 1 SOAP communication channel with QOS as "Best Effort"  2 JMS comm channel( 1 Receiver & 1 S

  • I cannot update software for my Macbook Pro

    when i try to update software, it shows update is available. i click update, and then shows 12 items available. i click continue, soon, shows message that needs to restart the computer. i click restart and computer turns and screen frozen

  • Customization for register id 000 missing in table Registrations

    Hi all, when iam creating (factory sales)excise invoice in j1iin from billing document the error comes as: Customization for register id 000 missing in table Registrations Message no. 8I303 Diagnosis The customization details have not been maintained

  • Static or non-static...

    Well i guess this is a design issue... If i make an application, and create a main object for it like "App". Now i want the application to have some internal code for like maybe a network, and call it "Net". Now in the App, should i make the Net obje