Sending JMS Messages From WildFly Swarm To WebLogic 11g - jms

I'm trying to replicate in Wildfly Swarm the process of sending JMS messages from Wildfly 8 to Weblogic without using Camel (http://blog.eisele.net/2015/07/sending-jms-messages-from-wildfly-8-to-weblogic-with-camel.html) but without success.
The things that I have did tillnow are the following:
1) Module creation for wlthint3client.jar (src/main&resources/modules/custom/oracle/weblogic):
<module xmlns="urn:jboss:module:2.0" name="custom.oracle.weblogic">
<resources>
<resource-root path="wlthint3client.jar">
<filter>
<exclude-set>
<path name="javax.ejb"/>
<path name="javax.ejb.spi"/>
<path name="javax.transaction"/>
<path name="javax.jms"/>
<path name="javax.xml"/>
<path name="javax.xml.stream"/>
</exclude-set>
</filter>
</resource-root>
</resources>
<dependencies>
<module name="javax.api"/>
<module name="sun.jdk" export="false" services="import">
<exports>
<include-set>
<path name="sun/security/acl"/>
<path name="META-INF/services"/>
</include-set>
</exports>
</module>
<module name="com.sun.xml.bind" />
<module name="org.omg.api"/>
<module name="javax.ejb.api" export="false" />
<module name="javax.transaction.api" export="false" />
<module name="javax.jms.api" export="false" />
<module name="javax.xml.stream.api" export="false" />
<module name="org.picketbox" optional="true"/>
<module name="javax.servlet.api" optional="true"/>
<module name="org.jboss.logging" optional="true"/>
<module name="org.jboss.as.web" optional="true"/>
<module name="org.jboss.as.ejb3" optional="true"/>
<module name="org.hornetq" />
</dependencies>
</module>
Now, the problem is how translate the jms-bridge configuration into the project-stages.yml:
<jms-bridge name="wls-bridge" module="custom.oracle.weblogic">
<source>
<connection-factory name="java:/ConnectionFactory"/>
<destination name="java:/jms/sourceQ"/>
</source>
<target>
<connection-factory name="jms/WFMessagesCF"/>
<destination name="jms/WFMessages"/>
<context>
<property key="java.naming.factory.initial"
value="weblogic.jndi.WLInitialContextFactory"/>
<property key="java.naming.provider.url"
value="t3://127.0.0.1:7001"/>
</context>
</target>
<quality-of-service>AT_MOST_ONCE</quality-of-service>
<failure-retry-interval>2000</failure-retry-interval>
<max-retries>10</max-retries>
<max-batch-size>500</max-batch-size>
<max-batch-time>500</max-batch-time>
<add-messageID-in-header>true</add-messageID-in-header>
</jms-bridge>
Till now I was unabled to replicate it in the project-stages-yml file and see some information logged when I start my java project.
Someone would be kind to helpp me with this problem?
Thanks a lot.

You will need to create a section in project-defaults.yml that uses the keys mentioned here.
For example, the above would start like:
swarm:
messaging-activemq:
jms-bridges:
wls-bridge:
failure-retry-interval: 2000
max-batch-size: 500
max-batch-time: 500
source-connection-factory: java:/ConnectionFactory
source-destination: java:/jms/sourceQ
target-connection-factory: jms/WFMessagesCF
That's not the full list of settings, but should be enough to get you started in converting it to yaml.

Related

Tycho plugin for eclipse product is not creating launcher.ini file

I am in the process of Maven-izing an existing Eclipse plugin product build, using Tycho. Unfortunately, it is not packaging the launcher ini file.
However, this is present when I export the product from Eclipse.
Is there any configuration in the pom or elsewhere that I need to mention something?
Product File
<?xml version="1.0" encoding="UTF-8"?>
<?pde version="3.5"?>
<product name="Eclipse Product" uid="Product" id="prod-plugin.Product1" application="org.eclipse.ui.ide.workbench" version="4.0.0" useFeatures="false" includeLaunchers="true">
<aboutInfo>
<image path="/prod-plugin/icons/prod128.png"/>
<text>
An Eclipse Application
</text>
</aboutInfo>
<configIni use="default">
</configIni>
<launcherArgs>
<programArgs>-consoleLog-Xss512m
</programArgs>
<vmArgs>-Xms1G -Xmx3G -Xss1G -Dfile.encoding=UTF-8
</vmArgs>
</launcherArgs>
<windowImages i16="/prod-plugin/icons/prod16.png" i32="/prod-plugin/icons/prod32.png" i48="/prod-plugin/icons/prod48.png" i64="/prod-plugin/icons/prod64.png" i128="/prod-plugin/icons/prod128.png" i256="/prod-plugin/icons/prod256.png"/>
<splash
location="prod-plugin"
startupProgressRect="2,277,655,10"
startupMessageRect="7,259,590,18"
startupForegroundColor="FFFFFF" />
<launcher name="prod">
<win useIco="false">
<bmp/>
</win>
</launcher>
<vm>
<windows include="true">org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8</windows>
</vm>
<plugins>
<plugin id="prod-plugin"/>
.....
</plugins>
<configurations>
<plugin id="org.apache.felix.scr" autoStart="true" startLevel="2" />
<plugin id="org.eclipse.core.runtime" autoStart="true" startLevel="2" />
<plugin id="org.eclipse.felix.common" autoStart="true" startLevel="2" />
<plugin id="org.eclipse.felix.event" autoStart="true" startLevel="3" />
<plugin id="org.eclipse.felix.simpleconfigurator" autoStart="true" startLevel="1" />
</configurations>
<preferencesInfo>
<targetfile overwrite="false"/>
</preferencesInfo>
<cssInfo>
</cssInfo>
</product>

org.apache.jasper.JasperException lost in logback, but written to tomcat9 localhost.log

My goal is to have all app-level logging go to my app log file. My problem is that while a lot of my debug/info/error messages make it to STDOUT/File etc... here is one error that only shows in my tomcat9 log:
4-Jun-2018 08:55:29.050 SEVERE [http-nio-82-exec-6] org.apache.catalina.core.ApplicationDispatcher.invoke Servlet.service() for servlet [jsp] threw exception
org.apache.jasper.JasperException: /WEB-INF/jsp/di_queue.jsp (line: [110], column: [8]) The function [isCurrentUser] cannot be located with the specified prefix
at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:42)
at org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:292)
at org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:115)
at org.apache.jasper.compiler.Validator$ValidateVisitor$1FVVisitor.visit(Validator.java:1603)
at org.apache.jasper.compiler.ELNode$Function.accept(ELNode.java:135)
I am using jdk 10, Spring 5.0.5, Hibernate 5.3, Logback 1.2.3
Here is my logback.xml
<configuration scan="true">
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<!-- encoders are assigned the type
ch.qos.logback.classic.encoder.PatternLayoutEncoder by default -->
<encoder>
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
</encoder>
</appender>
<logger name="org.directwebremoting" level="trace"
additivity="false">
<appender-ref ref="STDOUT" />
</logger>
<logger name="org.apache.tiles" level="info"
additivity="false">
<appender-ref ref="STDOUT" />
</logger>
<logger name="org.apache.jasper.compiler" level="info"
additivity="false">
<appender-ref ref="STDOUT" />
</logger>
<root level="error">
<appender-ref ref="STDOUT" />
</root>
</configuration>
Here is my ivy.xml
<ivy-module version="2.0">
<info organisation="org.apache" module="ews" />
<configurations defaultconfmapping="default">
<conf name="default" />
<conf name="compile" description="compile dependencies" extends="default" />
<conf name="runtime" description="runtime dependencies" extends="default" />
<conf name="test" description="test dependencies" extends="default" />
</configurations>
<dependencies>
<dependency org="org.hibernate" name="hibernate-core" rev="5.3.0.Final">
</dependency>
<dependency org="org.hibernate" name="hibernate-jcache"
rev="5.3.0.Final" />
<!-- just for ehcahce 2? -->
<!-- <dependency org="org.hibernate" name="hibernate-ehcache" rev="5.3.0.Final"
/> -->
<!-- needed or whole hibernate spring config does not start -->
<dependency org="org.springframework.boot" name="spring-boot-starter-cache"
rev="2.0.2.RELEASE" />
<dependency org="javax.cache" name="cache-api" rev="1.1.0" />
<dependency org="org.ehcache" name="ehcache" rev="3.5.2" />
<dependency org="org.springframework" name="spring-orm"
rev="5.0.6.RELEASE" />
<dependency org="org.springframework" name="spring-core"
rev="5.0.6.RELEASE" />
<dependency org="ch.qos.logback" name="logback-access" rev="1.2.3" />
<dependency org="org.springframework" name="spring-webmvc"
rev="5.0.6.RELEASE" />
<dependency org="org.springframework" name="spring-web"
rev="5.0.6.RELEASE" />
<dependency org="org.springframework" name="spring-context"
rev="5.0.6.RELEASE" />
<dependency org="org.springframework.boot" name="spring-boot-starter-logging"
rev="2.0.2.RELEASE" />
<!-- https://mvnrepository.com/artifact/org.directwebremoting/dwr rev="2.0.1"
rev="3.0.2-RELEASE" -->
<dependency org="org.directwebremoting" name="dwr"
rev="3.0.2-RELEASE" />
<dependency org="dom4j" name="dom4j" rev="1.6.1" />
<dependency org="net.sf.jasperreports" name="jasperreports"
rev="3.6.1" /><!-- 6.6.0 -->
<dependency org="jstl" name="jstl" rev="1.2" />
<dependency org="javax.servlet" name="servlet-api" rev="2.5" />
<dependency org="net.sf.supercsv" name="super-csv-dozer"
rev="2.4.0" />
<!-- <dependency org="org.slf4j" name="jcl-over-slf4j" rev="1.7.22" />
<dependency org="org.apache.logging.log4j" name="log4j-slf4j-impl" rev="2.7"
/> <dependency org="org.apache.logging.log4j" name="log4j-api" rev="2.7"
/> <dependency org="org.apache.logging.log4j" name="log4j-core" rev="2.7"
/> -->
<!-- for the ant classes remove after ant jrc working -->
<!-- <dependency org="commons-logging" name="commons-logging" rev="1.2"
/> <dependency org="org.codehaus.groovy" name="groovy-all" rev="1.5.5" />
<dependency org="org.eclipse.jdt.core.compiler" name="ecj" rev="4.6.1" /> -->
<dependency org="org.apache.tiles" name="tiles-jsp" rev="3.0.8" />
<dependency org="org.apache.tiles" name="tiles-core" rev="3.0.8" />
<dependency org="org.apache.tiles" name="tiles-api" rev="3.0.8" />
<dependency org="org.apache.tiles" name="tiles-servlet"
rev="3.0.8" />
<dependency org="commons-fileupload" name="commons-fileupload"
rev="1.3.3" />
<dependency org="javax.mail" name="javax.mail-api" rev="1.6.1" />
<dependency org="com.mchange" name="c3p0" rev="0.9.5.2" />
<dependency org="org.json" name="json" rev="20180130" />
<dependency org="javax.json" name="javax.json-api" rev="1.1.2" />
<dependency org="commons-validator" name="commons-validator"
rev="1.6" />
<dependency org="org.mozilla" name="rhino" rev="1.7R1" />
<!-- <dependency org="org.acegisecurity" name="acegi-security" rev="1.0.4"
/> -->
<dependency org="org.springframework.security" name="spring-security-web"
rev="5.0.5.RELEASE" />
<dependency org="org.springframework.security" name="spring-security-config"
rev="5.0.5.RELEASE" />
<dependency org="com.lowagie" name="itext" rev="2.1.7" />
<dependency org="org.apache.tomcat" name="tomcat-catalina"
rev="9.0.8" />
<dependency org="com.microsoft.sqlserver" name="mssql-jdbc"
rev="6.4.0.jre9" />
<!-- https://www.concretepage.com/forum/thread?qid=531 -->
<dependency org="javax.xml.bind" name="jaxb-api" rev="2.3.0" />
<dependency org="oro" name="oro" rev="2.0.8" />
<dependency org="org.apache.commons" name="commons-lang3"
rev="3.7" />
<dependency org="commons-fileupload" name="commons-fileupload"
rev="1.3.3" />
</dependencies>
</ivy-module>
Seems like JSP/view/tiles/dwr errors are the ones I am missing in STDOUT
This Servlet related exception logs are handled by Tomcat internal logging library which is a customised java.util.logging.
According to this :
The calls to javax.servlet.ServletContext.log(...) to write log
messages are handled by internal Tomcat logging. Such messages are
logged to the category named
org.apache.catalina.core.ContainerBase.[${engine}].[${host}].[${context}]
To overwrite the global Tomcat logging configuration , try to put a java.util.logging 's properties file logging.properties in /WEB-INF/classes/ and configure the above logger log to a file handler , somethings like this:
handlers =java.util.logging.FileHandler
java.util.logging.FileHandler.level = INFO
java.util.logging.FileHandler.formatter = org.apache.juli.OneLineFormatter
java.util.logging.FileHandler.pattern = /temp/app.log
org.apache.catalina.core.ContainerBase.[Catalina].[localhost].level = INFO
org.apache.catalina.core.ContainerBase.[Catalina].[localhost].handlers = java.util.logging.FileHandler

Infinispan/Wildfly: Cannot find a parser for element 'string-keyed-jdbc-store' in namespace

I am trying to configure a JDBC-backed Infinispan cache for storing Hibernate Search indices on Wildfly 10/JBoss EAP 7. I have installed the Infinispan 8.1.x Wildfly/JBoss modules from infinispan.org within my application server, and I've FINALLY gotten a basic infinispan.xml file working with file persistence, and now I am trying to change it over to use JDBC for persistence. My infinispan.xml file looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<infinispan xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="urn:infinispan:config:8.1 http://www.infinispan.org/schemas/infinispan-config-8.1.xsd
urn:infinispan:config:jdbc:8.0 http://www.infinispan.org/schemas/infinispan-cachestore-jdbc-config-8.0.xsd"
xmlns="urn:infinispan:config:8.1" xmlns:jdbc="urn:infinispan:config:store:jdbc:8.0">
<jgroups>
<stack-file name="default-jgroups-udp" path="default-configs/default-jgroups-udp.xml" />
</jgroups>
<cache-container name="HibernateSearch" default-cache="default"
statistics="false" shutdown-hook="DONT_REGISTER">
<transport stack="default-jgroups-udp" />
<jmx duplicate-domains="true" />
<!-- *************************************** -->
<!-- Cache to store Lucene's file metadata -->
<!-- *************************************** -->
<replicated-cache name="LuceneIndexesMetadata" mode="SYNC"
remote-timeout="25000">
<locking striping="false" acquire-timeout="10000"
concurrency-level="500" write-skew="false" />
<transaction mode="NONE" />
<eviction max-entries="-1" strategy="NONE" />
<expiration max-idle="-1" />
<persistence passivation="false">
<file-store preload="true" purge="true"
path="${jboss.server.temp.dir}/indexes" />
</persistence>
<indexing index="NONE" />
<state-transfer enabled="true" timeout="480000"
await-initial-transfer="true" />
</replicated-cache>
<!-- **************************** -->
<!-- Cache to store Lucene data -->
<!-- **************************** -->
<replicated-cache name="LuceneIndexesData" mode="SYNC"
remote-timeout="25000">
<locking striping="false" acquire-timeout="10000"
concurrency-level="500" write-skew="false" />
<transaction mode="NONE" />
<eviction max-entries="-1" strategy="NONE" />
<expiration max-idle="-1" />
<persistence passivation="false">
<string-keyed-jdbc-store xmlns="urn:infinispan:config:store:jdbc:8.0"
fetch-state="false" read-only="false" purge="false">
<data-source jndi-url="java:jboss/datasources/InfinispanCacheDS" />
<string-keyed-table drop-on-exit="false"
create-on-start="true" prefix="ISPN_STRING_TABLE">
<id-column name="ID_COLUMN" type="VARCHAR(255)" />
<data-column name="DATA_COLUMN" type="BINARY" />
<timestamp-column name="TIMESTAMP_COLUMN" type="BIGINT" />
</string-keyed-table>
</string-keyed-jdbc-store>
</persistence>
<!-- <persistence passivation="false"> <file-store preload="true" purge="true"
path="${jboss.server.temp.dir}/indexes" /> </persistence> -->
<indexing index="NONE" />
<state-transfer enabled="true" timeout="480000"
await-initial-transfer="true" />
</replicated-cache>
<!-- ***************************** -->
<!-- Cache to store Lucene locks -->
<!-- ***************************** -->
<replicated-cache name="LuceneIndexesLocking" mode="SYNC"
remote-timeout="25000">
<locking striping="false" acquire-timeout="10000"
concurrency-level="500" write-skew="false" />
<transaction mode="NONE" />
<eviction max-entries="-1" strategy="NONE" />
<expiration max-idle="-1" />
<persistence passivation="false">
<file-store preload="true" purge="true"
path="${jboss.server.temp.dir}/indexes" />
</persistence>
<indexing index="NONE" />
<state-transfer enabled="true" timeout="480000"
await-initial-transfer="true" />
</replicated-cache>
</cache-container>
</infinispan>
I am also using the following jboss-deployment-structure.xml file:
<?xml version="1.0" encoding="UTF-8"?>
<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.2">
<deployment>
<dependencies>
<!-- Core Java/Java EE Dependencies -->
<module name="javax.transaction.api" export="true" services="import" />
<!-- JPA/Hibernate Search Dependencies -->
<module name="javax.persistence.api" export="true" />
<module name="org.hibernate.search.engine" export="true"
services="import" slot="5.5" />
<module name="org.hibernate.search.orm" export="true"
services="import" slot="5.5" />
<module name="org.infinispan.hibernate-search.directory-provider"
slot="for-hibernatesearch-5.5" export="true" services="import" /><!--
<module name="org.apache.lucene" export="true" services="import" /> <module
name="org.infinispan.lucene-directory" slot="ispn-8.1" /> -->
<module name="org.infinispan.core" slot="ispn-8.1" services="import"
export="true" />
<module name="org.infinispan.persistence.jdbc" slot="ispn-8.1"
services="import" export="true" />
<module name="org.infinispan.persistence.remote" slot="ispn-8.1"
services="import" export="true" />
</dependencies>
</deployment>
</jboss-deployment-structure>
However, when I deploy my application I get the following exception:
ISPN000327: Cannot find a parser for element 'string-keyed-jdbc-store' in namespace 'urn:infinispan:config:store:jdbc:8.0'. Check that your configuration is up-to date for this version of Infinispan.
Everything works fine if I change persistence from JDBC to "file". However, once I put in the JDBC parameters I get the parsing error. I'm sure I'm doing something minor and stupid to cause this, but I can't for the life of me figure out what. Any help would be GREATLY appreciated!!
After trying to investigate this problem I ended opening a bug report:
https://issues.jboss.org/browse/ISPN-7572
The problem is that I expected the org.infinispan.core module to depend on its extensions, but this is not the case. I previously mentioned a wokraround, but editing the module XML files is not enough as there's no easy solution which would be able to maintain the isolation of different modules which need to be isolated.
The problem is fixed now, please upgrade to either Infinispan version 9.0.0.Final which will contain the fix, or get Infinispan 8.2.7.Final as I'll backport this fix as well.

Enunciate framework - Not working with Spring Restful project

I have integrated enunciate framework to generate the API document for the Spring RESTful project. I have followed the steps from https://github.com/stoicflame/enunciate/wiki/Executables and deployed the war created from the enunciate configuration in the tomcat server(http://localhost:8080/sample_enunciate) but its displaying the empty document. Here I have provided the configuration details used in the sample project.
NOTE: But the similar configuration is working with Jersey restful project. I really stuck here. Please let me know, is this bug with the enunciate framework integration with Spring project. Thanks in advance.
Project configuration:
java -1.7.0
tomcat -6.0 &7.0
ant -1.9.4
spring -4.0.5
enunciate -1.30
jars:
enunciate-core-1.30-RC1.jar
enunciate-core-annotations-1.30-RC1.j
enunciate-core-rt-1.30-RC1.jar
enunciate-java-client-1.30-RC1.jar
enunciate-docs-1.30-RC1.jar
enunciate-rt-1.30-RC1.jar
enunciate-spring-app-rt-1.30-RC1.jar
enunciate-spring-jaxws-rt-1.30-RC1.ja
spring-aop-4.0.5.RELEASE.jar
spring-beans-4.0.5.RELEASE.jar
spring-context-4.0.5.RELEASE.jar
spring-context-support-2.5.4.jar
spring-core-4.0.5.RELEASE.jar
spring-expression-4.0.5.RELEASE.jar
spring-jdbc-4.0.5.RELEASE.jar
spring-test-4.0.5.RELEASE.jar
spring-tx-4.0.5.RELEASE.jar
spring-web-4.0.5.RELEASE.jar
spring-webmvc-4.0.5.RELEASE.jar
This is my enunciate.xml.
enunciate.xml
<?xml version="1.0"?>
<api-classes>
<include pattern="com.sample.controller.*" />
</api-classes>
<modules>
<!-- Docs -->
<docs title="example" copyright="Example.com"/>
<webapp mergeWebXML="WebContent/WEB-INF/web.xml" />
<spring-app disabled="false" springVersion="4.0.5">
<springImport file="resources/dev/applicationContext.xml" />
<springImport file="WebContent/WEB-INF/rest-servlet.xml" />
</spring-app>
<c disabled="true" />
<csharp disabled="true" />
<java-client disabled="false" />
<cxf disabled="false" />
<gwt disabled="false" />
<jaxws-client disabled="true" />
<jaxws-ri disabled="true" />
<jaxws-support disabled="true" />
<jersey disabled="true" />
<xml disabled="false" />
<obj-c disabled="true" />
<rest disabled="false" />
</modules>
properties file for build.xml
enunciate_build.properties
JAVA_HOME=C:/Java/jdk1.7.0/
tomcat.home=D:/xampp/tomcat
This is my build.xml
build.xml
<?xml version="1.0" encoding="UTF-8"?>
<project default = "enunciate">
<property file ="enunciate_build.properties"/>
<property name="lib.dir" value="../libs" />
<property name="src.dir" value="src"/>
<target name = "enunciate">
<path id= "enunciate.classpath">
<fileset dir = "${lib.dir}">
<include name="*.jar"/>
</fileset>
<fileset dir ="${lib.dir}/modules/spring">
<include name="*.jar"/>
</fileset>
<fileset dir = "${JAVA_HOME}">
<include name = "lib/tools.jar"/>
</fileset>
</path>
<taskdef name="enunciate" classname = "org.codehaus.enunciate.main.EnunciateTask">
<classpath refid = "enunciate.classpath"/>
</taskdef>
<enunciate javacSourceVersion="1.7" javacTargetVersion="1.7" basedir = "${src.dir}" configFile="enunciate.xml">
<include name = "**/*.java"/>
<classpath refid= "enunciate.classpath"/>
<export artifactId="war.file" destination="${tomcat.home}/webapps/sample_enunciate.war"/>
</enunciate>
</target>
</project>
Enunciate only recognizes JAX-RS annotations right now. For further information follow this link.https://github.com/stoicflame/enunciate/issues/60

hibernatetools ant task - hbm2java - creates pojo without package statement

I'm exporting my mapping (hbm.xml) to pojo classes using ant task.
It generates the POJO files in the mapped directory. But the Classes miss the Package statement. It simply creates all files in default package
// default package
// Generated Aug 23, 2012 12:34:40 PM by Hibernate Tools 3.2.2.GA
Here is my ant build file for the task.
<project name="Hibernate Tools for Ant - hbm2java" default="gensrc">
<path id="tools">
<path location="lib/hibernate-tools-3.2.3.GA.jar"/>
<path location="lib/hibernate3.6.10.jar"/>
<path location="lib/freemarker-2.3.8.jar"/>
<path location="lib/hsqldb-2.2.4.jar"/>
<path location="lib/commons-logging.jar"/>
<path location="lib/dom4j-1.6.1.jar"/>
<path location="lib/slf4j-api-1.6.1.jar"/>
<path location="lib/hibernate-jpa-2.0-api-1.0.1.Final.jar"/>
</path>
<taskdef name="gen-src" classname="org.hibernate.tool.ant.HibernateToolTask"
classpathref="tools"/>
<target name="gensrc">
<gen-src destdir="src/main/java">
<configuration
configurationfile="src/main/resources/hibernate.cfg.xml">
<fileset dir="src/main/java/com/kee/example/domain/maps">
<include name="Event.hbm.xml"/>
</fileset>
</configuration>
<hbm2java destdir="src/main/java/com/kee/example/domain"/>
</gen-src>
</target>
</project>
the default Pojo.ftl (inside hibernate-tools.jar) has the declaration as below
${pojo.getPackageDeclaration()}
// Generated ${date} by Hibernate Tools ${version}
what should i be changing in order to have correct package declaration in the generated POJO.
Update:
Here is my Mapping file
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd">
<hibernate-mapping package="com.kee.example.domain">
<meta attribute="generated-class">EventBase</meta>
<meta attribute="implement-equals">true</meta>
<meta attribute="scope-field">protected</meta>
<class name="com.kee.example.domain.Event" table="event">
<id name="id" type="java.lang.Long">
<generator class="native"/>
</id>
<property name="eventDate" type="timestamp"/>
<property name="eventString" type="java.lang.String"/>
</class>
</hibernate-mapping>
I was getting the same problem in maven and not sure about the reason but it was resolved once I started using annotationconfiguration instead of jdbcconfiguration.
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>hibernate3-maven-plugin</artifactId>
<version>2.2</version>
<configuration>
<components>
<component>
<name>hbm2ddl</name>
<implementation>annotationconfiguration</implementation>
<outputDirectory>${db.src.dir}</outputDirectory>
</component>
<component>
<name>hbm2java</name>
<implementation>annotationconfiguration</implementation>
<outputDirectory>src/main/java</outputDirectory>
</component>
</components>
<componentProperties>
<drop>true</drop>
<create>true</create>
<export>false</export>
<format>true</format>
<jdk5>true</jdk5>
<ejb3>true</ejb3>
<outputfilename>${ddl.file}</outputfilename>
<templatepath>src/main/resources/hibernate-template</templatepath>
<delimiter>;</delimiter>
<configurationfile>src/main/resources/hibernate.cfg.xml</configurationfile>
</componentProperties>
</configuration>
<dependencies>
<dependency>
<groupId>${jdbc.groupId}</groupId>
<artifactId>${jdbc.artifactId}</artifactId>
<version>${jdbc.version}</version>
</dependency>
</dependencies>
</plugin>
I did not want the annotated pojo classes so I had commented codes in *.ftl files.

Resources