310 words

Source not found error after downloading ObjectDB 2.3.7_04

#1
2012-03-08 19:34


Code snippet:

Properties prop = new Properties();
 
prop.setProperty("javax.jdo.PersistenceManagerFactoryClass","com.objectdb.jdo.PMF");
 
prop.setProperty("javax.jdo.option.ConnectionUR","local.odb");
 
PersistenceManagerFactory pmf = JDOHelper.getPersistenceManagerFactory(prop);
PersistenceManager pm = pmf.getPersistenceManager();

I am getting an error Source attachment does not contain source for File PMF.class.

I had added the zip file jdo_2.2.zip as source.

Please help need to complete assg in 2 days

Pallavi
Pallavi's picture
Joined on 2012-03-08
User Post #1
#2
2012-03-08 20:09

You have to provide more details. What kind of error is it? Compilation? Debugging? Runtime?

If it is an exception - provide a full stack trace.

If it is a compilation error or an IDE error - provide a full error message and a screen shot of the IDE.

ObjectDB Support
ObjectDB - Fast Object Database for Java (JPA/JDO)
support
support's picture
Joined on 2010-05-03
User Post #966
#3
2012-03-08 20:15

When I am trying to debug code snippet mentioned above in Eclipse it asks me to provide source code at debug time. I provided the zip file mentioned above. But them it throws an error that source not found. 

Basically the PMF.class is compiled from PMF.java and in the source file I am not able to find any PMF.java class.

 

For setup I downloaded the ObjectDB zip file. Placed it in source code of my existing project. I added the Objectdb.jar file in build path. There were no compile time errors. I debugged following code

import java.util.Properties;
 
import javax.jdo.JDOHelper;
import javax.jdo.PersistenceManager;
import javax.jdo.PersistenceManagerFactory;
 
public class Main {
 
    /**
     * @param args
     */
    public static void main(String[] args) {
 
        Employee emp = new Employee("ALEX",0, "ABC.CORP");
 
        Properties prop = new Properties();
        prop.setProperty("javax.jdo.PersistenceManagerFactoryClass","com.objectdb.jdo.PMF");
        prop.setProperty("javax.jdo.option.ConnectionUR","local.odb");
 
        PersistenceManagerFactory pmf = JDOHelper.getPersistenceManagerFactory(prop);
        PersistenceManager pm = pmf.getPersistenceManager(); / <===
        try {
            pm.makePersistent(emp);
        }
        finally {
            pm.close();
        }
    }
}

When I reach above statement in RED it asks me to mention the source path so I added file

objectdb-2.3.7_04\objectdb-2.3.7_04\src\jdo_2.2.zip as source code.

But then it throws Source not found error.

Please tell me if I am doing correct setup.

Pallavi
Pallavi's picture
Joined on 2012-03-08
User Post #2
#4
2012-03-08 21:36

ObjectDB is not open source so the source code of PMF is not available.

But usually there is no reason for you to debug the PMF class (which is not your code). This error is not expected if you execute the line with Step Over (F6) rather than with Step Into (F5).

ObjectDB Support
ObjectDB - Fast Object Database for Java (JPA/JDO)
support
support's picture
Joined on 2010-05-03
User Post #967

Post Reply

Please read carefully the posting instructions - before posting to the ObjectDB website.

  • You may have to disable pop up blocking in order to use the toolbar (e.g. in Chrome).
  • Use ctrl + right click to open the browser context menu in the editing area (e.g. for using a browser spell checker).
  • To insert formatted lines (e.g. Java code, stack trace) - select a style in the toolbar and then insert the text in the new created block.
  • Avoid overflow of published source code examples by breaking long lines.
  • You may mark in paragraph code words (e.g. class names) with the code style (can be applied by ctrl + D).
  • Long stack traces (> 50 lines) and complex source examples (> 100 lines) should be posted as attachments.
Attachments:
Maximum file size: 32 MB
Cancel