views:

155

answers:

2

Fatal Error: no matching class connection

index.php

<?php
   import database.connection;
   $connection = connection::get()->getPersistenceManager(); // ***ERROR HERE***
?>

connection.java

package database;

import javax.jdo.JDOHelper;
import javax.jdo.PersistenceManagerFactory;

public final class connection {
    private static final PersistenceManagerFactory pmfInstance =
        JDOHelper.getPersistenceManagerFactory("transactions-optional");

    private connection() {}

    public static PersistenceManagerFactory get() {
        return pmfInstance;
    }
}

Quercus is otherwise configured fine, PHP implementation works smoothly on GAE. But when I try to initialize classes, PHP can't find them. What am I doing wrong?

+1  A: 

I only discovered that Quercus existed due to you posting this question!

My guess would be that Quercus cannot instantiate the object because the class "connection" has a private constructor.

Looking at the documentation, something like java_class("database.connection") can be used to access static methods in classes which cannot be instantiated.

Mark McLaren
+1  A: 

Your class connection needs to extends AbstractQuercusModule as explained here

chrisnfoneur