Results 1 to 3 of 3
  1. #1
    willemjav is offline Senior Member
    Join Date
    Dec 2007
    Location
    Spain
    Posts
    1,075
    Rep Power
    9

    Default making a independent application available in a struts2 application

    I have two applications:
    1) A Java-application that takes care of the DB in JPA manner;
    2) A presentation-layerered, Dynamic Web-application that runs on Struts2.
    They are both free-standing projects running on Maven: right!

    Now I'd like them to communicate in a way that the struts2 layer manipulates
    the DB (in a previous project, based on servlet-technic I made that work by
    enter the first application into the servlet-app by turning the first into a jar-file:
    and it worked!)

    I'd like to do something similar but this time not using a Jar but making the
    first project available in the second!

    There are several ways doing that, right?

    What would be the best way?

  2. #2
    willemjav is offline Senior Member
    Join Date
    Dec 2007
    Location
    Spain
    Posts
    1,075
    Rep Power
    9

    Default Re: making a independent application available in a struts2 application

    The two applications are:
    1) “petstore” the DB and JPA stuff;
    2) “petstoreweb” the strutsREST-presentation layer.

    When working with both separate projects (making petstore/maven available in petstoreweb/maven) here is what I do:

    1) at petstoreweb rightclick/ properties-/ Java build path/ projects/ and there I add petstore as a project to petstoreweb
    2) under “Order and Export” I put the petstore on top so that project is first on the class path!

    Than when I run petstoreweb on the server I get:
    Jul 17, 2014 9:59:12 PM org.apache.catalina.core.StandardContext filterStart
    SEVERE: Exception starting filter struts-prepare-execute
    java.lang.NoClassDefFoundError: showing a class name of the petstore project DB-model
    And at the end of the message: Caused by: java.lang.ClassNotFoundException with the above class name

    What am I doing something wrong?

  3. #3
    willemjav is offline Senior Member
    Join Date
    Dec 2007
    Location
    Spain
    Posts
    1,075
    Rep Power
    9

    Default Re: making a independent application available in a struts2 application

    This is what one does when Maven is in play:
    How do I add a project as a dependency of another project? - Web Tutorials - avajava.com
    It did not work for my anyway:

    com.opensymphony.xwork2.util.logging.commons.Commo nsLogger info
    INFO: Loading global messages from texts
    Jul 19, 2014 1:41:30 PM org.apache.catalina.core.StandardContext filterStart
    SEVERE: Exception starting filter struts-prepare-execute
    java.lang.NoClassDefFoundError: com/company/petstore/model/petfood
    at java.lang.Class.getDeclaredMethods0(Native Method)
    at java.lang.Class.privateGetDeclaredMethods(Class.ja va:2688)
    at java.lang.Class.privateGetPublicMethods(Class.java :2814)
    at java.lang.Class.getMethods(Class.java:1602)

Similar Threads

  1. Making a Coin Application
    By seaisle68 in forum Java Applets
    Replies: 3
    Last Post: 04-08-2011, 02:14 AM
  2. Making my application Friend Friendly
    By chayan in forum Java 2D
    Replies: 3
    Last Post: 07-04-2010, 07:27 PM
  3. Ask:Developt Map Application Using Struts2
    By jocko_b201 in forum Web Frameworks
    Replies: 0
    Last Post: 05-21-2010, 04:49 AM
  4. Making application run by itself
    By quickfingers in forum New To Java
    Replies: 5
    Last Post: 06-13-2009, 08:05 PM
  5. Struts2 helloworld application.
    By makpandian in forum New To Java
    Replies: 0
    Last Post: 06-02-2009, 12:19 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •