Checkstyle Can't Generate Report With Custom Check - checkstyle

I am trying to create my own custom check for Checkstyle. I created an artifact and gave it on the classpath (dependency in the POM). Then included it in my configuration.xml file. I am getting the following error:
An error has occurred in Checkstyle report generation.: Failed during checkstyle configuration: cannot initialize module TreeWalker - Unable to instantiate 'com.lft.cos.checkstyle.custom.MethodsOrderCheck' class.
Can someone point me to what I am doing wrong?

Related

java.lang.No classDefFound error while using PEXML for android in Libgx

I am using PEXML library for giving physics to bodies in my game. It worked very well in desktop but when I ran in android it is giving me error at code
playerPhysics = new PEXML(Gdx.files.internal("data/physics.xml").file());
and showing error
java.lang.NoClassDefFoundError: Failed resolution of: Ljavax/xml/bind/JAXBContext; at com.hi5dev.box2d_pexml.PEXML.loadXML(PEXML.java:124) at com.hi5dev.box2d_pexml.PEXML.(PEXML.java:24)
Caused by: java.lang.ClassNotFoundException: Didn't find class "javax.xml.bind.JAXBContext" on path: DexPathList[[dex file "/data/data/com.myplayer.football/files/instant-run/dex/slice-slice_9...
Google search shows javax.xml.bind.JAXBContext is in the file javax.xml.bind.jar
Java needs to find this file at runtime. It looks for it in your Java classpath ( set of directories ).
You need this Jar to be in your runtime classpath
The error you wrote about shows you the classpath.
You can either
put javax.xml.bind.jar in the current classpath
or
Modify the classpath to include the location of javax.xml.bind.jar
Lookup how to modify the Java classpath for your operating system.

JBPM: Add MySQL connector dependency to kie workbench [ver 6.2]

I'm trying to add mysql connector dependency to kie workbench. I added it by uploading the jar to the artifact repository and adding the dependency by going to project settings. When the service task that uses the connector executes, it's not able to load the mysql's Driver class. Here's more detail on how I'm using the service task - Service task using Hibernate
When the service task execute I get this message on the workbench - Unexpected error encountered : [com.sample.bpmn.hello:36 - GetData:3] -- Unable to build entity manager factory
When I look at wildfly's server.log, it seems the jar didn't get added properly - java.lang.ClassNotFoundException: Could not load requested class : com.mysql.jdbc.Driver
When I add the dependency on the workbench, I see the following warnings. I'm not able to figure out what they mean -
Verification of class com.mysql.jdbc.integration.c3p0.MysqlConnectionTester failed and will not be available for authoring. Please check the necessary external dependencies for this project are configured correctly.
Verification of class com.mysql.jdbc.integration.jboss.ExtendedMysqlExceptionSorter failed and will not be available for authoring. Please check the necessary external dependencies for this project are configured correctly.
Verification of class com.mysql.jdbc.integration.jboss.MysqlValidConnectionChecker failed and will not be available for authoring. Please check the necessary external dependencies for this project are configured correctly.
Please let me know if more info is needed.
Much appreciated.
[PS] - I must say that I just got started with hibernate as well with no prior experience. So it could be a basic thing I'm missing there.

EF Code First Migrations - two assemblies - looking at wrong config file

I have an MVC5 project with EF6 and I am using two assemblies, one for the main website "Goods" with controllers membership stuff and the other, separate assembly "Goods.Models" with business domain and business logic, which is also using EF6 and connecting to the same MySQL database.
When I try to create a migration in the second assembly I get error:
System.TypeInitializationException:
The type initializer for 'System.Data.Entity.Migrations.DbMigrationsConfiguration`1' threw an exception. ---> System.InvalidOperationException:
The DbConfiguration type 'Goods.Setup.MySqlConfiguration, Goods' specified in the application config file could not be loaded.
Make sure that the assembly-qualified name is used and that the assembly is available to the running application. See http://go.microsoft.com/fwlink/?LinkId=260883 for more information. --->
OK so it can't find "Goods.Setup.MySqlConfiguration, Goods"
I have the config files in both assemblies, one from the main front end assembly "Goods":
<entityFramework codeConfigurationType="Goods.Setup.MySqlConfiguration, Goods">...
And the other in the "Goods.Models" assembly:
<entityFramework codeConfigurationType="Goods.Models.MySQLSetup.MySqlConfiguration, Goods.Models">...
I made sure I am selecting the Goods.Models assembly in the PM console, but the error indicates that the migration framework is looking at the config file of the "Goods" assembly.
How can I fix this.
Solved by adding -StartUpProjectName parameter like so:
add-migration -StartUpProjectName Goods.Models
It appears it's not enough to set the default project in PM console

Netbeans not responsing output & running any program create errors due to ant

I am getting this problem after running any program in netbeans7.2
my java path are as follows
C:\Program Files\Java\jdk1.6.0_23\bin
my netbeans install in C:\Program Files\NetBeans 7.2 Beta
The following error occurred while executing this line:
jar:file:/C:/Program%20Files/NetBeans%207.2%20Beta/java/ant/lib/ant.jar!/org/apache/tools/ant/antlib.xml:37: Problem: failed to create task or type componentdef
Cause: The name is undefined.
Action: Check the spelling.
Action: Check that any custom tasks/types have been declared.
Action: Check that any <presetdef>/<macrodef> declarations have taken place.

Identifying CheckStyle Errors via Maven CLI

I build my projects via mvn on the command line.
Whenever a checkStyle error occurs, I see this type of output:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-checkstyle-
plugin:2.4:checkstyle (default) on project myProject-server:
An error has occurred in Checkstyle report generation.
There are 2 checkstyle errors. -> [Help 1]
How do I find out which code lines are causing these CheckStyle failures?
CheckStyle saves reports to target/checkstyle-result.xml (for non-modular project). So you may find out this file and examine it.
Another case is to configure maven-checkstyle-plugin to show all such warnings/error to console:
<consoleOutput>true</consoleOutput>