I am trying to add more functionality to a product i work on( it is web application) by using jboss modules, the product is a .ear file which contains a utility.jar (this jar is inside the lib folder inside .ear file). Now I am trying to add a single class file by using jboss modules, i have created a jar which contains the new class file and i am trying to add the dependency in module.xml since this new class needs lot of files/class from utility.jar's different packages (around 15 classes are used/imported to compile this new class). Is it possible to achieve this.
I am trying to do this way since product team is the owner for deployment and they don't want to touch/modify the .ear file,hence i can't ask them to just add the new class file in the utility.jar (which works perfectly by the way).
Content of the module.xml are given below.
Error message in jboss log is
Caused by: java.lang.ClassNotFoundException: com.xyx.mdm.wkflw.eng.activities.SqActInstImpl from [Module "com.xyx.mdm:main" from local module loader #5add5415 (roots: D:\project\jboss-as-7.1.1.Final\modules)]
<module xmlns="urn:jboss:module:1.1" name="com.xyx.mdm">
<resources><resource-root path="activity.jar" />
</resources>
<dependencies>
<system export="true">
<paths>
<path name="com/xyx/mdm/wkflw/eng/activities"/>
</paths>
</system>
</dependencies>
</module>
Related
I am writing a karaf bundle which depends on an external jar library. I understand I may import this bundle in my features.xml using wrap but this means it gets loaded into its own classloader.
What I want is for my bundle's classloader to load whatever I access in this jar file and I want to make direct method calls to the classes in this jar file. How can I do this?
I don't want a new bundle - just a library that I can link my application to.
Thanks,
You can try to embed the external jar when building your bundle as follow:
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<extensions>true</extensions>
<configuration>
<instructions>
<Export-Package>
...,
root_package_in_external_jar*,
...
</Export-Package>
<Import-Package>
...
</Import-Package>
<Embed-Dependency>your_external_jar</Embed-Dependency>
</instructions>
</configuration>
</plugin>
Added the following .jar files to TestNG suite
reportng-1.1.4.jar
velocity-dep-1.4.jar
guice-3.0.jar
turned off the default listeners of the same. But reportNG is not working. The results are shown by TestNG.
Add velocity-1.4.jar too.It is different from velocity-dep-1.4.jar.
Also add the listener for HTMLReporter in your xml file.
<listeners>
<listener class-name="org.uncommons.reportng.HTMLReporter" />
</listeners>
In case you wanted to know all the jars needed you can use maven dependency in a dummy project . This will download the jars on maven build and you can copy the jars from there for your project.
<dependency>
<groupId>org.uncommons</groupId>
<artifactId>reportng</artifactId>
<version>1.1.4</version>
</dependency>
I was trying to build and analyze a asp.net website project using maven
Command I used :
mvn sonar:sonar -e
I have single pom file in my root directory(same directory where website.sln is stored).
Directory structure:
|---Website (website project file)
|
|---website.sln
|---pom.xml
|
Result of executing command was : Build Error -Embedded error: Unable to execute maven plugin
I did same things and I could successfully build a web application project and console application project(which have visual studio project file). I thing reason for not working for website project is it does not have .csproj file inside website folder.
So how could successfully build and analyze a website project using maven.
Could someone please help me to fix this issue.
this is my pom file:
http://maven.apache.org/maven-v4_0_0.xsd">
<groupId>MindTree</groupId>
<artifactId>webbssite</artifactId>
<version>1.0</version>
<modelVersion>4.0.0</modelVersion>
<name>Maya</name>
<packaging>sln</packaging>
<url>http://maven.apache.org</url>
<properties>
<!--
NOTE : the versions and parameters may be defined as properties.
Prefer this option to the plugin configuration as it may be accessible to several plugins
-->
<!-- Name of the solution file, located in the same directory as the pom.xml -->
<visual.studio.solution>website.sln</visual.studio.solution>
<!-- Name pattern to recognize the test assemblies, so that unit tests are only launched on those,
and so that those are excluded from code coverage -->
<visual.test.project.pattern>*.Tests</visual.test.project.pattern>
<!-- Version of the .Net tools, which may be 2.0 or 3.5 only -->
<dotnet.tool.version>4.0</dotnet.tool.version>
<sonar.language>cs</sonar.language>
<msbuild.configurations>Debug</msbuild.configurations>
<maven.site.generateReports>false</maven.site.generateReports>
<sonar.dynamicAnalysis>false</sonar.dynamicAnalysis>
<sonar.cpd.skip>true</sonar.cpd.skip>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.sonar-plugins.dotnet</groupId>
<artifactId>maven-dotnet-plugin</artifactId>
<version>0.6</version>
<configuration>
<solutionName>website.sln</solutionName>
<language>cs</language>
<toolVersion>3.5</toolVersion>
<Platform>x86</Platform>
<buildConfigurations>Release,Debug</buildConfigurations>
<rebuild>true</rebuild>
</configuration>
<extensions>true</extensions>
</plugin>
</plugins>
</build>
You should rather send a mail to the user mailing list.
Anyway I have the feeling there is a misunderstanding between the "maven dotnet plugin" and the "sonar maven plugin".
The "maven dotnet plugin" provides the ability to build dotnet visual studio solution with maven. It relies mostly on msbuild.
The "sonar maven dotnet plugin" alows to bootstrap a sonar analysis with maven.
Check out the second pom example on the following page : Maven .NET Plugin
Both plugins need to be configured if you want to use maven to build and analyse your solution.
That being said, you should know that neither maven nor those two plugins are mandatory to analyse a C# project with sonar. You could use whatever build tool you want to compile your solution (i.e. msbuild, nant)and you could use the simple sonar java runner to trigger the analysis.
Check out the official wiki and feel free to ask questions to the user mailing list.
You can subscribe easily here : Support
I'm working on an implementation that will use a wsdl that I have gotten from a vendor. Our project is running on Spring and CXF, and I'd like to create a jar that will allow me to access this vendor's wsdl services, but I'm running into classpath issues.
Using CXF's wsdl2java I am able to generate code that acts like this:
WSDL_LOCATION = new URL("file:SomeService.wsdl");
The service requires the wsdl to be in the classpath, but I would like to bundle it in the jar so that it is distributable as a stand-alone jar. Using the wsdl2java tool, I am able to specify the string in the URL instantiation to whatever I would like. However, I have not found a combination of a custom string and wsdl file location inside the jar that works.
The only way I have gotten this to work as I want is to put the wsdl file in the same folder that the SomeService.class is and use the following line:
WSDL_LOCATION = TrackService.class.getResource("TrackService_v4.wsdl");
However, this has the downside of me having to manually edit the java code and compile it myself. This is undesirable because we would eventually like to make this process part of our maven build and have wsdl2java do the generation and compilation by itself automatically.
I am OK with the wsdl being anywhere in the jar, but I don't know what to pass in to wsdl2java to have it reference a file inside the jar.
Does anyone have any suggestions or experience doing this?
You need to specify the classpath wsdl location as follows to generate the stubs that uses ClassLoader to load this wsdl as classpath resource:
<plugin>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-codegen-plugin</artifactId>
<version>2.4.3</version>
<dependencies>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-bindings-soap</artifactId>
<version>2.4.3</version>
</dependency>
</dependencies>
<executions>
<execution>
<id>generate-sources</id>
<phase>generate-sources</phase>
<configuration>
<sourceRoot>${project.build.directory}/generated-sources/cxf
</sourceRoot>
<wsdlOptions>
<wsdlOption>
<wsdl>${basedir}/yourWSDL.wsdl</wsdl>
<extraargs>
<extraarg>**-wsdlLocation**</extraarg>
<extraarg>**classpath:yourWSDL.wsdl**</extraarg>
</extraargs>
</wsdlOption>
</wsdlOptions>
</configuration>
<goals>
<goal>wsdl2java</goal>
</goals>
</execution>
</executions>
</plugin>
I've run into the same issue - I've got the following workaround but I'm still searching for something cleaner.
Keep your wsdls in src/main/resources/wsdl
Do the following when you create your TrackService:
URL wsdlUrl = TrackService.class.getResource( "/wsdl/TrackService_v4.wsdl" );
TrackService service = new TrackService( wsdlUrl );
The ideal solution would be to pass the location as a <wsdlLocation/> element into the CXF wsdl2java plugin. Then your client code could call the default constructor. However the stub code that is generated does not allow you to specify a wsdl file that is on the classpath.
The CXF Documentation solves it in the same way:
URL wsdl = getClass().getResource("wsdl/greeting.wsdl");
SOAPService service = new SOAPService(wsdl, serviceName);
Another option provided is the JaxWsProxyFactoryBean:
JaxWsProxyFactoryBean proxyFactory = new JaxWsProxyFactoryBean();
proxyFactory.setServiceClass(MyService.class);
proxyFactory.setWsdlLocation("/wsdl/MyService.wsdl");
If you also need to adjust the endpoint URL then you could add:
proxyFactory.setAddress("http://192.168.0.2:6666/");
I've created an AIR application, but it uses an external SWF for extra functionality. I want that SWF to be included in the install, but currently it's not. Is there anyway I can get FlexBuilder or any other tool to include this extra file in the installer? I've tried manually adding the file (as a .air file is just a zip file in disguise), but there must be hash checks inside the file.
If you place the SWF file in your application's src directory it will give you the option to include in the installer (previously I tried putting it in the application's root folder).
If you are working in Flash, go to File>Adobe AIR 2.0 Settings. At the bottom of the dialgoue box is a list of included files. Add your SWF to that list.
What if you wanted to add a text file instead to the installer using Flex Builder? I tried to add it using the export release build wizard, but I don't see the text file generated in the application directory...any ideas?
I would add a custom builder, under project -> properties -> builders
I use something like the following for one of my projects that I want to package some mxml and as files with so that the compiler doesn't try to compile them on export. Save the xml below as something like copy_files.xml and add a new Ant Builder to your project. Under the targets tab of the builder I have mine set to run the copy-files target on every clean.
<?xml version="1.0" encoding="UTF-8"?>
<project name="SampleProject">
<target name="copy-files" description="Copy Source Files">
<copy todir="bin-debug/sources">
<fileset dir="sources" >
<include name="**/*.*" />
</fileset>
</copy>
<copy todir="bin-release/sources">
<fileset dir="sources" >
<include name="**/*.*" />
</fileset>
</copy>
</target>
</project>