Jump to content
We've recently updated our Privacy Statement, available here ×

No suitable Log constructor


xen0

Recommended Posts

I'm trying to create a web app with the php/Java bridge. In this problem, I'm trying to simply compile a report for starters, but receiving exceptions from the second line below:

Code:

$sJcm = new JavaClass("net.sf.jasperreports.engine.JasperCompileManager"«»);
$report = $sJcm->compileReport($reportsPath .$reportFileName.".jrxml"«»);

 

The exception reported follows:

 

java stack trace: [o(ByteArrayOutputStream):"java.lang.Exception: Invoke failed: [c(JasperCompileManager)]->compileReport((String)o(String)). Cause: org.apache.commons.logging.LogConfigurationException: org.apache.commons.logging.LogConfigurationException: No suitable Log constructor [Ljava.lang.Class;@17ed710 for org.apache.commons.logging.impl.Log4JLogger (Caused by java.lang.NoClassDefFoundError: org/apache/log4j/Logger) (Caused by org.apache.commons.logging.LogConfigurationException: No suitable Log constructor [Ljava.lang.Class;@17ed710 for org.apache.commons.logging.impl.Log4JLogger (Caused by java.lang.NoClassDefFoundError: org/apache/log4j/Logger)) Responsible VM: 1.6.0_03@http://java.sun.com/ at org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:543) at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:235) at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:370) at org.apache.commons.digester.Digester.(Digester.java:346) at net.sf.jasperreports.engine.xml.JRXmlDigester.(JRXmlDigester.java:62) at net.sf.jasperreports.engine.xml.JRXmlDigesterFactory.createDigester(JRXmlDigesterFactory.java:975) at net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader.java:203) at net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader.java:168) at net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader.java:152) at net.sf.jasperreports.engine.JasperCompileManager.compileReport(JasperCompileManager.java:151) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at php.java.bridge.JavaBridge.Invoke(JavaBridge.java:1114) at php.java.bridge.Request.handleRequest(Request.java:342) at php.java.bridge.Request.handleRequests(Request.java:388) at php.java.bridge.http.ContextRunner.run(ContextRunner.java:188) at php.java.bridge.BaseThreadPool$Delegate.run(BaseThreadPool.java:66) Caused by: org.apache.commons.logging.LogConfigurationException: org.apache.commons.logging.LogConfigurationException: No suitable Log constructor [Ljava.lang.Class;@17ed710 for org.apache.commons.logging.impl.Log4JLogger (Caused by java.lang.NoClassDefFoundError: org/apache/log4j/Logger) (Caused by org.apache.commons.logging.LogConfigurationException: No suitable Log constructor [Ljava.lang.Class;@17ed710 for org.apache.commons.logging.impl.Log4JLogger (Caused by java.lang.NoClassDefFoundError: org/apache/log4j/Logger)) ... 19 more Caused by: org.apache.commons.logging.LogConfigurationException: No suitable Log constructor [Ljava.lang.Class;@17ed710 for org.apache.commons.logging.impl.Log4JLogger (Caused by java.lang.NoClassDefFoundError: org/apache/log4j/Logger) at org.apache.commons.logging.impl.LogFactoryImpl.getLogConstructor(LogFactoryImpl.java:413) at org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:529) ... 18 more Caused by: java.lang.NoClassDefFoundError: org/apache/log4j/Logger at java.lang.Class.getDeclaredConstructors0(Native Method) at java.lang.Class.privateGetDeclaredConstructors(Unknown Source) at java.lang.Class.getConstructor0(Unknown Source) at java.lang.Class.getConstructor(Unknown Source) at org.apache.commons.logging.impl.LogFactoryImpl.getLogConstructor(LogFactoryImpl.java:410) ... 19 more "]

 

Does anyone have and ideas what this could be? I've experienced a similar problem with JdbcConnection... I had to include the jar into the lib and it solved the problem, however, with this error I have the logging jars in my lib.

 

Thanks in advance...

Link to comment
Share on other sites

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

I have fixed this issue...

 

I needed to install the following apache commons packages:

 

commons-1.1.1

commons-digester-1.8

commons-collections-3.2

 

and remove log4j-<VERSION>.jar, and commons-digester-1.7 from lib.

Link to comment
Share on other sites

  • 2 years later...
Code:
Please install tom cat first.
inside the tom cat auto deploy folder
put the JavaBridge.war
"Tomcat 7.0\webapps\"
It will automatically extract and create a folder of
"Tomcat 7.0\webapps\JavaBridge"
inside this folder you will get
"Tomcat 7.0\webapps\JavaBridge\WEB-INF\lib"
JavaBridge.jar run this file and select the port.
Finally please put the class files of the jasper report
inside this folder.
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...