How to share common classes across multiple projects in Jdeveloper?

Hi Experts,
I have a basic question.
I am using Jdeveloper 11g and have divided my application into 2 projects (Model(ejb's) and Viewcontroller(jsf+managed beans etc)).
The model project has a stateless session bean(named VisitingScholarBean) which uses a java bean class(named VisitingScholarDetails) defined in the ViewController project.
The relevant Method in the stateless session bean is public void saveVSDetails(VisitingScholarDetails vsDetails).
Now the issue is that the VisitingScholarDetails class is part of only the ViewController project but is being used in the Model project.
So when I try to run the application it gives an error saying that
weblogic.application.ModuleException: Exception preparing module: EJBModule(VisitingScholar-Model-ejb)
[EJB:011023]An error occurred while reading the deployment descriptor. The error was:
edu/nyu/ecoms/oaa/vs/web/backing/VisitingScholarDetails.
     at weblogic.ejb.container.deployer.EJBModule.prepare(EJBModule.java:452)
     at weblogic.application.internal.flow.ModuleListenerInvoker.prepare(ModuleListenerInvoker.java:93)
     at weblogic.application.internal.flow.DeploymentCallbackFlow$1.next(DeploymentCallbackFlow.java:387)
     at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:37)
     at weblogic.application.internal.flow.DeploymentCallbackFlow.prepare(DeploymentCallbackFlow.java:58)
     Truncated. see log file for complete stacktrace
java.lang.ClassNotFoundException: edu.nyu.ecoms.oaa.vs.web.backing.VisitingScholarDetails
     at weblogic.utils.classloaders.GenericClassLoader.findLocalClass(GenericClassLoader.java:283)
     at weblogic.utils.classloaders.GenericClassLoader.findClass(GenericClassLoader.java:256)
     at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
     at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
     at weblogic.utils.classloaders.GenericClassLoader.loadClass(GenericClassLoader.java:176)I cannot replicate the same VisitingScholarDetails class in both projects as it will lead to duplication.
Please let me know how to include the VisitingScholarDetails class in the ejb-jar without replicating it in the Model and View Controller projects.
Thanks for your time and help.
Edited by: user10376431 on Jan 24, 2010 6:25 AM

Welcome User in OTN,
to make two projects can access its classes you should goto the project property ---> Dependencies then add the other project.
in your case:
try to goto you Model project property ----> Dependencies ---> Edit Dependencies .
you will find your ViewController project. Expand it thin check to Build Output.
you can make this for ViewContoller project also as:
goto you ViewContoller project property ----> Dependencies ---> Edit Dependencies .
you will find your Model project. Expand it thin check to Build Output.
Sameh Nassar

Similar Messages

  • How to share one variable across multiple JVMs?

    Hi,
    How to share one string value across two applications, which are there in two different JVMs.
    Requirement is, If I update one value(static) in first server through jsp, it should update second server static value too apart from first server.
    I am using WebLogic 8.1, is there any MBean to access other application's static value?
    Please suggest!
    Thanks,
    Murthy P

    Welcome User in OTN,
    to make two projects can access its classes you should goto the project property ---> Dependencies then add the other project.
    in your case:
    try to goto you Model project property ----> Dependencies ---> Edit Dependencies .
    you will find your ViewController project. Expand it thin check to Build Output.
    you can make this for ViewContoller project also as:
    goto you ViewContoller project property ----> Dependencies ---> Edit Dependencies .
    you will find your Model project. Expand it thin check to Build Output.
    Sameh Nassar

  • How to share a session across multiple jws?

    Hi!
    I have this problem.
    I'm looking for a way to have shared sessions, available across multiple JWS with WLW 8.1
    I try to get a session with this code:
    WebServiceContext wsContext = WebServiceContext.currentContext(); WebServiceSession session = (WebServiceSession)wsContext.getSession();
    but it throws COntextNotFoundException....
    I added the session descriptor in weblogic.xml to set the param CookiesEnabled to true, because I read that using this code works but requires that the client support cookies to keep the HttpSession object around.
    But it's not works!
    How can I get to HTTP session from a JWS?
    And....it's possible to share a session accross multiple JWS?
    Thanks a lot!

    You may be interested (& probably discouraged at the end) in this discussion http://forum.java.sun.com/thread.jspa?threadID=619170
    cheers,
    ram.

  • How  to reuse common code across multiple work repositories

    Hi Experts,
    I have a ruqirements from our customer side. we have a one master repository attached with three work repositories(wk1,wk2,2k3). Customer want to place some common code into wk1 workrepository and want to reuse across multiple workrepositories(wk2,wk3).
    Generally we can reuse code in same work repositories like knowmodules and interfaces.
    Is it possible to use across mutiple workrepositories?
    Thanks in Advance
    Siri

    You can't hare the same instance of the code across multiple work repositories. You have to have a seperate instance in each work repository. However you can manage it as if it was shared through ODI's versioning capability i.e. all changes to the common code are only ever made in one work repository i.e. Wk1 and then deployed to the other 2 which is as simple as getting the latest version from the Master repository. You could even set up security in Wk2 and Wk3 to make sure that your developers/users do not have permission to edit the common code in those repositories.

  • How to define common segments across multiple SOB's

    We are considering an implementation approach with multiple SOBs for the various entities under the umbrella organization, since each manages itself differently. However, we still need to define a SOB for consolidating the data from the entities. Other than reporting needs, what factors should be considered for determining accounting flexfield segments that are common across the entities, and therefore should be in each SOB? Any other considerations?

    Hi Shelia!
    This is a broad question. The main thing to keep in mind is that each set of books should have a unique balancing segment value defined for it and defined at the set of books level when defining the accounts in your Set of Books form.
    For example, if you have 3 companies that all share the same chart of accounts structure, the Balancing Segment (Company Segment) should be somethig like:
    01 for Company 1
    02 for Company 2
    03 for Company 3
    Then, when you define each company's set of books, make sure you use the corresponding segment value for each.
    So, the Retained Earning Account would be 01-3500----- for Company 1's set of books and Retained Earnings will be 02-3500 for Company 2's set of books.
    If all of you sets of books reside on a single database instance, and they all share the same chart of accounts, you will NOT need to define a separate consolidation set of books. You can create FSG reports to consolidate the data across sets of books on a single instance.
    --Theresa                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • How to share Global Page across multiple applications

    Hi,
    I have APEX 4.2 via pl/sql gateway, Oracle 11gr2 DB and using theme 24.
    I have about 40 applications in 1 workspace and I need to create a global page that is going to be the same for each app. One way of doing this is I can manually do the change 40 times but I'm looking for an easier way.
    If you look at the packaged app "Dynamic Sample" you would notice a left sidebar which acts like a menu. Basically I want to do the same but just image each item on the sidebar belongs to a separate application.
    I have app1 which has the login and left sidebar navigation. Each option on the sidebar list would call a page on app2 to app40 but I need to retain the sidebar when displaying the page from a different app.
    If I tried to imp a global page I get an error that the application ID is different.
    If I tried to copy the global page to another app it changes the type to a navigation form which prevents the list from coming up for every page on the app.
    Thanks in advance!

    kvsinfo wrote:
    Hi,
    I have APEX 4.2 via pl/sql gateway, Oracle 11gr2 DB and using theme 24.
    I have about 40 applications in 1 workspace and I need to create a global page that is going to be the same for each app. One way of doing this is I can manually do the change 40 times but I'm looking for an easier way.Does the page have to be secure? If not can you create a new application without a login, put the "global" page there, and link to it from the other applications? Is there another way to put a generic page somewhere you can get to it outside Apex?
    >
    If you look at the packaged app "Dynamic Sample" you would notice a left sidebar which acts like a menu. Basically I want to do the same but just image each item on the sidebar belongs to a separate application.
    I have app1 which has the login and left sidebar navigation. Each option on the sidebar list would call a page on app2 to app40 but I need to retain the sidebar when displaying the page from a different app.
    If I tried to imp a global page I get an error that the application ID is different.
    If I tried to copy the global page to another app it changes the type to a navigation form which prevents the list from coming up for every page on the app.
    Thanks in advance!

  • How can I share a *.java source file across multiple projects in NetBeans?

    I'm sure this simple and a pretty common operation but how can I share a *.java source file across multiple projects in NetBeans? Right now I keep cut, coping and pasting the same source file between multiple projects to re-use the same code. But I could I make this source file a library file or something like that so that I could access it from any project. I assume this would be a generic operation but I mentioned NetBeans for clarity. Thanks.

    fiebigc wrote:
    I know I mentioned NetBeans but I'm most interested in the generic method for creating a library of source files that I can call into whatever program I am developing. I've done such a thing in C using header files and such but I'm trying to get a direction on how this is accomplished in Java. I'm sorry if I could edit the title I would. If anyone wants to be specific about NetBeans I welcome that too.
    Edited by: fiebigc on Jun 20, 2008 5:57 PM
    >I know I mentioned NetBeans but I'm most interested in the generic method for creating a library of source files that I can call into whatever program I am developing. I've done such a thing in C using header files and such but I'm trying to get a direction on how this is accomplished in Java. I'm sorry if I could edit the title I would. If anyone wants to be specific about NetBeans I welcome that too.
    Edited by: fiebigc on Jun 20, 2008 5:57 PM
    Create a class library.
    Write your code, compile it to .class files, put those class files in a .jar file and include the jar file in the classpath whenever you want to compile a project against it.

  • How do you share Aperture file across multiple users on same Mac?

    How do you share Aperture file across multiple users on same Mac? Seems this should be a preferences choice.

    When you share your library between users, you may run into permission and ownership problems, if both users are editing the Aperture library and not only reading it. To avoid that, it helps to put the Aperture library onto a separate disk or a separate partion of your hard drive. For s separate partition or disk you can enable the "ignore ownership on this volume" flag. Then all users can access the library as owners of this library.
    You might try to put the aperture library into a shared folder on your mac, but that has caused problems recently, i.e. when the library also contains video files.
    Regards
    Léonie

  • How to identify a user across multiple pages

    Hi,
    I'm doing a homebanking and I would like to know how to identify a user across multiple pages.
    I have already take a look at HTTPSESSION, but I didn't understand.
    Can someone help me.
    I'm send the servlet Logon.
    import java.io.*;
    import java.sql.*;
    import java.util.Date;
    import java.util.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class Cons_logon extends HttpServlet
         private Connection conexao = null;
         Login1 login1;
         public void init (ServletConfig cfg) throws ServletException
              super.init(cfg);
              try
                   Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
                   conexao = DriverManager.getConnection("jdbc:odbc:bank");
              catch (Exception e)
                   System.out.println(e.getMessage());
         public void doPost (HttpServletRequest req,
    HttpServletResponse res)
    throws ServletException, IOException
              String Suser, Spassword;
         PrintWriter out;
              res.setContentType("text/html");
    out = res.getWriter();
    String opcao = req.getParameter("log");
    Thanks

    I would recommend using the authentication mechanism that's guaranteed by the servlet spec. If you do that, you can just call
    request.getRemoteUser()
    to get the user name across multiple pages.
    If you want to use your own login scheme, you can create a new session object and map it to a user name somewhere in your app. Or you can just put the name of the user on the session. But the preferred way is to use the default authentication scheme defined by the spec.

  • How to add a class in a project?

    Hello!
    i'm a beginner in developing and i don't know how to add a class in a project in Sun Java Wireless toolkit 2.5.2...
    The name of my project is essai2 and i already put a class, LogoMIDlet and now i want to put my new class ComBasique, how can i do that?
    and do you know if there is a program for bluetooth in order to connect my Nokia 6680 to another device that have a bluetooth?
    thanks a lot for your answer!
    Sophie

    how to change the class name after the project is created.In NetBeans, right click the class name either in the declaration or constructor, select Refactor --> Rename... and follow the dialog.
    You can refactor --> rename anything that is not in a guarded block. For those, there are options via the properties window.
    db

  • Share http session across multiple EARs

    I am curious to know the following:-
    --> is it possible to share http session across multiple EARs running on same Weblogic application server.
    i.e weblogic server/Jboss
    --> is it possible to share http session across multiple EARs running on different Weblogic application server.
    i.e weblogic server/Jboss
    Please share the steps/way to acheive the same.

    What are you trying to achieve / accomplish by splitting it up?
    e.g. Clean Build in workshop will be faster for multiple EAR's , but unless you have all your application level libraries as shared libraries you might increase your runtime footprint. or you might want independent deploy/redeploy for your apps etc.
    If however you need the session to be shared , that these aren't really independent web-applications and shouldn't be separate ear's. In most cases though you dont actually need the session as shared (e.g. a user's data is fetched from the database , you dont really need the session shared, you need a single shared sign on). So when you say is the session shared, what is the data that you need shared? should it be in the session in the first place?
    And finally are these webapp's really independent (functionally ) or not?
    Edited by: deepshet on Oct 13, 2009 2:09 PM

  • How to share dependant jars across rars & ears / avoid classcast exceptions

    <b>How can one share dependant jars between a ear application and a resource adapter and avoid getting a ClassCastException? </b>
    <P>
    In some appservers(such as Oracle) the resource adapter is the parent of your ear classloader, so a single instance multiple classloader problem doesn't occur. But in some appservers such as BEA Weblogic this isn't the case. Not sure why BEA decided to make resource adapter class loader seperate and not the parent of ear loader...
    <P>
    If I bundle the resource adapter specific classes in the corresponding module archive file, I will get a class cast exception, becos I will have a <i>single instance and multiple class loader situation</i> (assuming resource adapters uses its own classloader).
    <P>
    Second question related to the above: Web logic documentation recommends that we bundle the common files in APP-INF direcotory for embedded resource adapter apps. If I start bundling the resource adapter in an ear file, for every ear app we will have a rar bundled. What about the JNDI names? won't you have to rename the resource adapter differently for each ear so that there is no jndi name clash? Doesn't this defeat the purpose of having one common connector for all apps?
    <P>
    Here is a detailed description of what I want:
    Let say you have a ear file. Let's say there is a common.jar shared between your ear application (say the ejb module uses it), and your resource adapter.
    <P>
    In the case of Oracle's OC4J I can see there won't be any problem of having this common.jar part of the resource adapter(RA). When the RA class loader loads the rar, it makes sure the common.jar files are accessible in the chain of all class loaders it is a parent of. So, the ear loader, ejb loader etc...will have visibility -> hence no class cast exception.
    <p>
    But what do clients do when they want to have their ear deployable across multiple appservers not just oc4j. BEA recently changed their class loader structure...their resource loader is no longer parent of the ear, so the ejb app in the ear doesn't have visibility into common.jar packaged with rar. So, the only solution was to bundle the common.jar file with the ear. But this causes problems, because we can have a situation where certain object instances (that are not serialized or copied) can be shared across class loaders. This ends up in the single instance multiple class loader situation->hence classcastexception.
    <p>
    The only solution I found was to make the common.jar file a shared library. That way only one copy of the class files are there for both the rar and the ear and its visibility is there not only for rar but for ear since it is loaded by the system class loader or shared library class loader (if ther eis one such).
    <P>
    Please convey best practise recommendation.
    Sudhakar

    Pete <[email protected]> wrote:
    Is there a way to have a non-EJB jar at the EJB classloader level ? Sure, just add it to the Class-Path: manifest entry in your ejb.jar.
    Dimitri

  • Using LabView class in multiple projects

    Hello,
    I have created a LabView class that I'd like to use in multiple projects while using source control (we use Serena for this) with the source files of the class in a centralized location (not seperately for each project as I don't want the code of the class to diverge in the different projects). Now I'm wondering what is the best way to accomplish this. I see a couple of different possibilities:
    - Have the class VIs at a certain location in the repository and link to all the files from the other projects in the repository. This will mean I will have all the files in all the project folders on disk but only one archive in the repository for them as they all link to the same location. Problem: Serena cannot create links to folders, so every VI has to be linked and if the structure of the class changes or VIs, the links have to be updated in each project -> not very nice
    - Have the class VIs at a certain location in the repository that will be checked out to a certain path on the local hard drive and add the class VIs to the projects from this fixed path. Problem: it's not guaranteed that the path will be the same on all computers. Some team members might check out to a different location -> bad solution
    - Use a .llb file that is also in the repository and create links to it from the different projects, i.e. the source files will only exist at one location on the hard drive but in every project folder there will be an .llb-file that will come from a single archive in the repository -> actually my favourite solution. Problem: I use the VI Server to call VIs by relative path inside the class and this works differently inside the .llb, since there seems to be no folder structure anymore. If there was a good workaround for this, this might be the best solution
    Does anybody have experiences on how to do something like this? Are there other possibilities to do it?
    Thanks,
    Tobias

    Hi,
    thanks for your reply.
    I think I have to make my question a little clearer. Say I have a class ClassA that uses some VIs that are in the same folder (or subfolders) as the class file. Now I put all of this in an SCC repository at the path /SCC/ClassA/. Now I have two projects that use this class and are located in the SCC repository at /SCC/Project1/ and /SCC/Project2/. Now some people might check out /SCC/ to c:/Projects, other people might check it out to d:/SCC so the absolute paths of the resulting files on the disks could be different. This makes it hard to add ClassA to both projects because on one computer the path to it would be c:/Projects/ClassA/<ClassName> on the other it would be d:/SCC/ClassA/<ClassName>. A common solution for this that we use for C++ projects is to create links inside the SCC, link the source files or a DLL inside the SCC to the /SCC/Project1/ and /SCC/Project2/ folders. This will create multiple copies of the DLL on the harddisk, one in the Project1 folder and one in the Project2 folder.
    Another solution might be the one you proposed, to have the sharde files inside the <LabVIEW> folder. However there are a couple of downsides to this, as far as I can see:
    - It won't work for people who don't have local admin rights (and actually having to change the files inside the "Program files" folder for development is not a good idea, imho)
    - It makes it quite hard to guarantee that both the projects and the shared files are always the same version (for example if I want to build an older version of Project1 I might need an older version of the ClassA, too. If I have it all inside one project in SCC, I can just get an older label to some folder and build it. If I have the shared files in the <LabVIEW> directory, I will have to replace this. There is no way to have multiple versions (older and newer) parallely on the disk in different folders. 
    Tobias

  • How to create java classes when multiple xsd files with same root element

    Hi,
    I got below error
    12/08/09 16:26:38 BST: [ERROR] Error while parsing schema(s).Location []. 'resultClass' is already defined
    12/08/09 16:26:38 BST: [ERROR] Error while parsing schema(s).Location []. (related to above error) the first definition appears here
    12/08/09 16:26:38 BST: Build errors for viafrance; org.apache.maven.lifecycle.LifecycleExecutionException: Internal error in the plugin manager executing goal 'org.jvnet.jaxb2.maven2:maven-jaxb2-plugin:0.7.1:generate': Mojo execution failed.
    I tried genarate java classes from multiple xsd files, but getting above error, here in .xsd file i have the <xe: element="resultClass"> in all .xsd files.
    So I removed all .xsd files accept one, now genarated java classes correctly. but i want to genarte the java classes with diffrent names with out changing .xsd
    Can you please tell me any one how to resolve this one......
    regards
    prasad.nadendla

    Gregory:
    If you want to upload several Java classes in one script the solution is .sql file, for example:
    set define ?
    create or replace and compile java source named "my.Sleep" as
    package my;
    import java.lang.Thread;
    public class Sleep {
    public static void main(String []args) throws java.lang.InterruptedException {
    if (args != null && args.length>0) {
    int s = Integer.parseInt(args[0]);
    Thread.sleep(s*1000);
    } else
    Thread.sleep(1000);
    create or replace and compile java source named "my.App" as
    package my;
    public class App {
    public static void main(String []args) throws java.lang.InterruptedException {
    System.out.println(args[0]);
    exit
    Then the .sql file can be parsed using the SQLPlus, JDeveloper or SQLDeveloper tools.
    HTH, Marcelo.

  • How to share a session across applications?

    Hi
    I am developing a web application. There will be two web applications (including mine) running in one servlet container. The user can navigate from one application to other and vice versa. We need to know how can we share a session across these applications. Any inputs in this regard will be helpful!

    You may be interested (& probably discouraged at the end) in this discussion http://forum.java.sun.com/thread.jspa?threadID=619170
    cheers,
    ram.

Maybe you are looking for

  • Trying to convert to word. Half the text is missing and all the pictures. Please help ASAP

    Need help converting to word. Not showing text or images

  • EMPTY LINE IN MAIN WINDOW OF SMARTFORM

    Hi All! I am designing  a smartform in which i had included several windows.I have a query on the main window. My main window is displaying several line items through table one by one.Now my requirement is to put one blank line in between every line

  • Manual sync in iTunes

    Is it possible to do a manual sync and store my songs,pics,video, etc. on my iPod classic while removing them from the iTunes on my computer to save space on computer?

  • TinyMCE in WPC

    Hi, i would like to know if anyone managed to integrate the tinyMCE in WPC in such depth that you don´t have to copy the KM links when you e.g. insert a picture from KM or when you insert a link to a KM document. In more detail...does anyone manage t

  • HT201363 need your help badly

    guyz i need your help i forgot my answers to my security questions and i dont know what to do pls. help me i really need help and my account has been locked for 8 hours. any ideas on how can i reset my security questions pls reply thanks