java.lang.NoSuchMethodError: EngineConfig.getLogRollingSize() - birt

I am a newbie in BIRT, have installed Eclipse Birt plugin 4.3 and downloaded OSGI birt-runtime-osgi-4_3_0,
i have a standalone program to open the sample report in the birt runtime envt. but i am getting error
at
conf = new EngineConfig();
conf.setEngineHome("C:/birt-runtime-osgi-4_3_0/ReportEngine");
//Create new Report engine based off of the configuration
eng = new ReportEngine( conf ); -----------> Error.
as
Exception in thread "main" java.lang.NoSuchMethodError: org.eclipse.birt.report.engine.api.EngineConfig.getLogRollingSize()I
at org.eclipse.birt.report.engine.api.impl.ReportEngine.intializeLogger(ReportEngine.java:220)
at org.eclipse.birt.report.engine.api.impl.ReportEngine.<init>(ReportEngine.java:134)
at org.eclipse.birt.report.engine.api.impl.ReportEngineFactory$1.run(ReportEngineFactory.java:18)
at org.eclipse.birt.report.engine.api.impl.ReportEngineFactory$1.run(ReportEngineFactory.java:1)
at java.security.AccessController.doPrivileged(Native Method)
at org.eclipse.birt.report.engine.api.impl.ReportEngineFactory.createReportEngine(ReportEngineFactory.java:14)
at org.eclipse.birt.report.engine.api.ReportEngine.<init>(ReportEngine.java:71)
at com.pg.o2.test.synch.ReportTest.main(ReportTest.java:33)
,
thought of running a stand alone pgm and start with JBOSS ,
please let me know if anything i have to download or missign jars.

It sounds like the jars in the runtime haven't been referenced in your eclipse project as described here. Are you running the application from eclipse or deploying it and getting these errors. If you're in eclipse go to the project settings and add the jars from the runtime to the build path. If you're getting these while deployed the jars need to go in your lib folder.

Related

Spring-boot app working in IDEA but crash when running jar - “Unable to resolve persistence unit"

Updated:
It's been days that I tried to accomodate some times in between then came back to this code-base, but still faced up the same issue.
I am frustrated that have a Spring Boot 1.5.12 application that worked in IDEA but failed when running executable jar in Unix box, and the stack trace follows this format that I needed to trim the stack trace for relevancy:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'xxxEntityManager' defined in class path resource [com.abc.persistence.ConfigClass]: Invocation of init method failed; nested exception is javax.persistence.PersistenceException: Unable to resolve persistence unit root URL
................. [Skipped the stack strace]
Caused by: java.io.FileNotFoundException: class path resource [] cannot be resolved to URL because it does not exist
at org.springframework.core.io.ClassPathResource.getURL(ClassPathResource.java:187)
at org.springframework.orm.jpa.persistenceunit.DefaultPersistenceUnitManager.determineDefaultPersistenceUnitRootUrl(DefaultPersistenceUnitManager.java:602)
... 48 common frames omitted
As per suggestion by Getting "Unable to resolve persistence unit" error when building jar without IDE, I tried this workaround of 2 changes but it doesn't work at all.
1)#EnableAutoConfiguration(exclude = HibernateJpaAutoConfiguration.class) to my application class
2)spring.data.jpa.repositories.enabled=false to my application.yml file in src/main/resource/ directory
Even with those two changes being added, it still shows the same error.
I hope someone can help me figure out this frustrating inconsistency occured between the run time behavior in IDEA and executable jar in console.
Edit:
I used Gradle build script with this build task applications to build the app jar executable whose jar pull everything of src files in package names and resource property configuration yaml files besides gradle build:
applications {
...
}
So I've been tried to crack the root cause that runs my life nuts, which is based on this possible mystery:
Can someone know about jar (JVM) process of how it processes to create jar artifacts that in the end when I face the extremely weird anomaly where Intellj has always been able to set the persistence unit URL to default, whereas running on jar doesn't accomodate this auto-configuration already coded in the app and property codes?

java.lang.NoClassDefFoundError: org.springframework.context.support.ClassPathXmlApplicationContext

What I am trying to achieve is to upload Temenos T24 Design Studio web services on Axis2.
Unfortunately, I am getting a Class not found error when uploading the service using "aar" (Axis2 archive) file.
I have already deployed Axis2 1.4.4 on IBM Websphere 9.
Note : There has been certain conflicts while deploying Axis2 application on IBM websphere JAX-WS, which I have used this guide to resolve them;
https://www-01.ibm.com/support/docview.wss?uid=swg21315686
Below is the error I am getting;
=================================
This Web axisService has deployment faults
Error: java.lang.NoClassDefFoundError: org.springframework.context.support.ClassPathXmlApplicationContext at com.temenos.services.designstudioinstaller.DesignStudioInstallerServiceSpringContext.loadServiceContext(DesignStudioInstallerServiceSpringContext.java:27)
You have to remove the following jar files from the t24lib directory:
t24-EB_ResourceProviderService-ejb.jar
t24-EB_ResourceProviderService-ProxyAdaptor.jar
t24-EB_ResourceProviderService-jws.aar
t24-EB_ResourceProviderService-provider.jar
t24-EB_ResourceProviderService-tafj-jws.aar
t24-EB_ResourceProviderService-tafj-provider.jar
For any service component such as EB_ResourceProviderService, only the below jars must be present within the t24lib directory:
EB_ResourceProviderService.jar
t24-EB_ResourceProviderService-Data.jar
t24-EB_ResourceProviderService-t24service.jar
Restart the application server after removing them and the axis2 should deploy successfully.
I had similar error deploying axis2.war inflated with Temenos aar files on JBoss EAP 7.1 and it was solved by removing the duplicated .jar and .aar files in t24lib:
[INFO] The t24-EB_ResourceProviderService-tafj-jws.aar service, which is not valid, caused java.lang.NoClassDefFoundError: org/springframework/context/support/ClassPathXmlApplicationContext
at com.temenos.services.resourceprovider.ResourceProviderServiceSpringContext.loadServiceContext(ResourceProviderServiceSpringContext.java:27)

Springboot Strange Resource Loading Behavior

I'm working on a springboot 1.5.1 application that I'm trying to load a WSDL included in my resources directory in the wsdl directory. Depending on where my application executes I'm getting different results (command line, intellij, cloud foundry) and I can't seem to get all three to work at the same time.
I've tried several ways of locating the resource:
From prior to the migration to springboot we had this (worked in IntelliJ but not java -jar myboot.jar):
this.getClass().getResource("/wsdl/my.wsdl");
I switched it to the typically more correct version and got it to work in IntelliJ and java -jar but not Cloud Foundry:
this.getClass().getClassLoader().getResource("/wsdl/my.wsdl");
I switched it to use the Spring Resource Loader version and it worked in IntelliJ and CloudFoundry but not java -jar:
#Value("classpath:/wsdl/my.wsdl")
private Resource wsdlResource;
wsdlResource.getURL();
On the command line what I've noticed is that it seems to be thinking that BOOT-INF/classes is a JAR file (Note the ! after classes):
Caused by: javax.xml.ws.WebServiceException: Failed to access the WSDL at: jar:file:/C:/dev/redacted/build/libs/redacted.jar!/BOOT-INF/classes!/wsdl/my.wsdl. It failed with:
JAR entry BOOT-INF/classes!/wsdl/my.wsdl not found in C:\dev\redacted\build\libs\redacted.jar.
From looking at IntelliJ's URL, it's referring to the actual source folder which explains why it seems to always work.
What is causing this and how might I universally load these class path resources successfully with springboot?

Grails - How to add Oracle jdbc jar to classpath without placing in /lib?

I am attempting to get my grails application running locally with tomcat, but without placing ojdbc6.jar in /lib. My grails application is deployed to Glassfish and works fine on the server (because the ojdbc6.jar is available there). As expected the error is:
Could not load JDBC driver class [oracle.jdbc.driver.OracleDriver]
(Failed) Approach #1
I first customized my GGTS run-configuration to include the VM arguments:
-cp :/somelocalpath/oracle-jdbc-drivers
However the error persisted.
(Failed) Approach #2
I'm currently looking to use the jvmArgs to point to a local version of the jar.
grails.tomcat.jvmArgs = ["-cp:/somelocalpath/oracle-jdbc-drivers/ojdbc6.jar"]
However a run-war results in:
| Error Server failed to start: tomcat exited prematurely with code '1' (error output: 'Unrecognized option: -cp:/apps/glassfish3/oracle-jdbc-drivers/ojdbc6.jar
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
')
I should clarify my main focus - I do not want the jar to be included in the final war.
Any help would be appreciated. Thanks!
From the documentation:
grails.war.resources lets you do any extra processing you want
before the WAR file is finally created.
In your case, you need to add something like that to your build config to exclude the Jar of the final WAR.
grails.war.resources = { stagingDir ->
delete(file:"${ stagingDir }/WEB-INF/lib/yourJarFile.jar")
}

TOMCAT 7 not deploying war

I have developed a Dynamic Java Project with Eclipse which involves web services(RESTful). After completion I tried to run my project Tomcat 7 runtime of Eclipse IDE, it works fine. I am able to access all my web services.
But, when I created a WAR file out of my project by right-clicking on project and exporting it to WAR file and placed .war file in Tomcat 7's webapps folder. Started the tomcat by running startup.bat, it throws below exceptions and I am not able t access any web service:
I have placed all the required jar files in lib folder of Tomcat.
Exception fixing docBase for context [/Books] (Books is my war file name)
Failed to create work directory [{CATALINA_HOME}\work\Catalina\localhost\Books]
Failed to create destination directory to copy resources.
Could anyone please let me know what I am missing??
Thanks in advance.
Regards,
Piyush
The failed to create "work directory" error can occur if the work folder does not exist in the tomcat7 folder.
Also this error can be caused by tomcat not having sufficient permissions to read, write and execute in the tomcat7 directory.
The issue is because, tomcat is not finding your web.xml location in the classpath.
Do below steps:
Right click on web project-->Properties-->Deployment Assembly--> Add your classpath to web.xml(src/main/webapp) in my case.

Resources