Load jndi.xml before beans.xml - spring

I have two files beans.xml and jndi.xml. We want to retrieve something in beans.xml that is put into JNDI through jndi.xml. Unfortunately, beans in beans.xml are created before jndi.xml is loaded, so when we try to do the JNDI lookup in beans.xml, nothing is in JNDI. Is there a way to get jndi.xml to be loaded before beans.xml?
beans.xml
...
<bean id="geronimoTransactionManager" class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiName" value="java:comp/UserTransaction" />
</bean>
...
jndi.xml
<beans>
<bean id="jndi"
class="org.apache.xbean.spring.jndi.SpringInitialContextFactory"
factory-method="makeInitialContext"
singleton="true">
<property name="entries" ref="jndiEntries" />
</bean>
<map id="jndiEntries">
<entry key="java:comp/UserTransaction" value-ref="geronimoTransactionManager" />
</map>
<bean id="jtaTransactionManager" class="org.springframework.transaction.jta.JtaTransactionManager">
<property name="userTransaction" ref="geronimoTransactionManager" />
</bean>
<bean id="geronimoTransactionManager" class="org.apache.geronimo.transaction.manager.TransactionManagerImpl" />
</beans>
Here is the log that makes me believe beans.xml is loaded before jndi.xml.
21:43:26,927 | INFO | l Console Thread | ultOsgiApplicationContextCreator | 72 - org.springframework.osgi.extender - 1.2.0 | Discovered configurations {osgibundle:/META-INF/spring/*.xml} in bundle [SWIM Prototype :: AqMqJDBC Pooling (camel-osgi-aqmq)]
21:43:26,939 | INFO | ExtenderThread-4 | OsgiBundleXmlApplicationContext | 61 - org.springframework.context - 3.0.5.RELEASE | Refreshing OsgiBundleXmlApplicationContext(bundle=camel-osgi-aqmq, config=osgibundle:/META-INF/spring/*.xml): startup date [Wed Apr 20 21:43:26 GMT+00:00 2011]; root of context hierarchy
21:43:26,939 | INFO | ExtenderThread-4 | OsgiBundleXmlApplicationContext | 61 - org.springframework.context - 3.0.5.RELEASE | Unpublishing application context OSGi service for bundle SWIM Prototype :: AqMqJDBC Pooling (camel-osgi-aqmq)
21:43:26,973 | INFO | ExtenderThread-4 | XmlBeanDefinitionReader | 59 - org.springframework.beans - 3.0.5.RELEASE | Loading XML bean definitions from URL [bundleentry://202.fwk22939763/META-INF/spring/beans.xml]
21:43:27,295 | INFO | ExtenderThread-4 | CamelNamespaceHandler | 75 - org.apache.camel.camel-spring - 2.6.0.fuse-01-09 | OSGi environment detected.
21:43:29,167 | INFO | ExtenderThread-4 | WaiterApplicationContextExecutor | 72 - org.springframework.osgi.extender - 1.2.0 | No outstanding OSGi service dependencies, completing initialization for OsgiBundleXmlApplicationContext(bundle=camel-osgi-aqmq, config=osgibundle:/META-INF/spring/*.xml)
21:43:29,283 | INFO | ExtenderThread-5 | DefaultListableBeanFactory | 59 - org.springframework.beans - 3.0.5.RELEASE | Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory#77e77a: defining beans [template,consumerTemplate,camel-1:beanPostProcessor,camel-1,required,jtaTransactionManager,geronimoTransactionManager,activeMQ,jmsConnectionFactory,jmsManagedConnectionFactory,jmsResourceAdapter,jencksConnectionManager,jencksPoolingSupport,requiredBeanForOracleAq,oracleQueue,oracleQueueCredentials,aqConnectionFactoryQueue,aqXADataSource,jdbcXADataSource,managedXADataSource,myTransform,preProps,org.springframework.beans.factory.config.PropertyPlaceholderConfigurer#0]; root of factory hierarchy
21:43:29,736 | INFO | ExtenderThread-5 | OsgiSpringCamelContext | 68 - org.apache.camel.camel-core - 2.6.0.fuse-01-09 | JMX enabled. Using ManagedManagementStrategy.
21:43:29,839 | INFO | ExtenderThread-5 | JtaTransactionManager | 74 - org.springframework.transaction - 3.0.5.RELEASE | Using JTA UserTransaction: org.apache.geronimo.transaction.manager.TransactionManagerImpl#1f07586
21:43:29,839 | INFO | ExtenderThread-5 | JtaTransactionManager | 74 - org.springframework.transaction - 3.0.5.RELEASE | Using JTA TransactionManager: org.apache.geronimo.transaction.manager.TransactionManagerImpl#1f07586
21:43:29,839 | INFO | ExtenderThread-5 | JtaTransactionManager | 74 - org.springframework.transaction - 3.0.5.RELEASE | Using JTA TransactionSynchronizationRegistry: org.apache.geronimo.transaction.manager.TransactionManagerImpl#1f07586
21:43:30,104 | INFO | ExtenderThread-5 | OsgiSpringCamelContext | 68 - org.apache.camel.camel-core - 2.6.0.fuse-01-09 | Apache Camel 2.6.0-fuse-01-09 (CamelContext: 202-camel-3) is starting21:43:30,430 | INFO | ExtenderThread-5 | Activator | 68 - org.apache.camel.camel-core - 2.6.0.fuse-01-09 | Found 13 #Converter classes to load
21:43:30,469 | INFO | ExtenderThread-5 | Activator | 68 - org.apache.camel.camel-core - 2.6.0.fuse-01-09 | Found 1 #Converter classes to load
21:43:30,473 | INFO | ExtenderThread-5 | Activator | 68 - org.apache.camel.camel-core - 2.6.0.fuse-01-09 | Found 1 #Converter classes to load
21:43:30,477 | INFO | ExtenderThread-5 | Activator | 68 - org.apache.camel.camel-core - 2.6.0.fuse-01-09 | Found 2 #Converter classes to load
21:43:34,173 | INFO | ExtenderThread-5 | OsgiSpringCamelContext | 68 - org.apache.camel.camel-core - 2.6.0.fuse-01-09 | Route: route1 started and consuming from: Endpoint[activeMQ://queue:BROKER2.QUEUE?concurrentConsumers=10]
21:43:34,194 | INFO | ExtenderThread-5 | OsgiSpringCamelContext | 68 - org.apache.camel.camel-core - 2.6.0.fuse-01-09 | Total 1 routes, of which 1 is started.
21:43:34,196 | INFO | ExtenderThread-5 | OsgiSpringCamelContext | 68 - org.apache.camel.camel-core - 2.6.0.fuse-01-09 | Apache Camel 2.6.0-fuse-01-09 (CamelContext: 202-camel-3) started in 4.089 seconds
21:43:34,204 | INFO | ExtenderThread-5 | OsgiBundleXmlApplicationContext | 61 - org.springframework.context - 3.0.5.RELEASE | Publishing application context as OSGi service with properties {org.springframework.context.service.name=camel-osgi-aqmq, Bundle-SymbolicName=camel-osgi-aqmq, Bundle-Version=4.3.0.fuse-03-00}
21:43:34,205 | INFO | ExtenderThread-5 | ContextLoaderListener | 72 - org.springframework.osgi.extender - 1.2.0 | Application context successfully refreshed (OsgiBundleXmlApplicationContext(bundle=camel-osgi-aqmq, config=osgibundle:/META-INF/spring/*.xml))
21:43:41,674 | INFO | tenerContainer-7 | SpringInitialContextFactory | 110 - org.apache.xbean.spring - 3.7 | Loading JNDI context from: class path resource [jndi.xml]
21:43:41,685 | INFO | tenerContainer-7 | XBeanXmlBeanDefinitionReader | 59 - org.springframework.beans - 3.0.5.RELEASE | Loading XML bean definitions from class path resource [jndi.xml]

In jndi.xml, you should try :
<beans>
<import resource="beans.xml"/>
(...)

Related

Archiva does not mirror maven central repository

Archiva does not mirror maven central repository.
I have installed stand alone Archiva 2.2.9
All settings are default.
Browse Repository section is empty:
My settings
Maven version:
$ mvn -v
Apache Maven 3.5.2 (138edd61fd100ec658bfa2d307c43b76940a5d7d; 2017-10-18T07:58:13Z)
Maven home: /usr/share/apache-maven
Java version: 1.8.0_332, vendor: Red Hat, Inc.
Java home: /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.332.b09-1.el7_9.x86_64/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "5.4.17-2136.306.1.3.el7uek.x86_64", arch: "amd64", family: "unix"
Log tail -f ~/archiva/logs/*:
==> /home/bob/archiva/logs/wrapper-20230217.log <==
INFO | jvm 1 | 2023/02/17 21:33:35 | 2023-02-17 21:33:35.716:INFO:/:Initializing Spring root WebApplicationContext
INFO | jvm 1 | 2023/02/17 21:33:49 | Feb 17, 2023 9:33:49 PM org.apache.tomcat.jdbc.pool.ConnectionPool init
INFO | jvm 1 | 2023/02/17 21:33:49 | WARNING: maxIdle is larger than maxActive, setting maxIdle to: 20
INFO | jvm 1 | 2023/02/17 21:34:04 | 2023-02-17 21:34:04.881:INFO:oejs.AbstractConnector:Started SelectChannelConnector#0.0.0.0:8082
STATUS | wrapper | 2023/02/17 23:40:54 | TERM trapped. Shutting down.
INFO | jvm 1 | 2023/02/17 23:40:55 | 2023-02-17 23:40:55.488:INFO:oejs.Server:Graceful shutdown SelectChannelConnector#0.0.0.0:8082
INFO | jvm 1 | 2023/02/17 23:40:55 | 2023-02-17 23:40:55.491:INFO:oejs.Server:Graceful shutdown o.e.j.w.WebAppContext{/,file:/home/bob/archiva/apps/archiva/},/home/bob/archiva/apps/archiva
INFO | jvm 1 | 2023/02/17 23:40:56 | 2023-02-17 23:40:56.598:INFO:/:Closing Spring root WebApplicationContext
INFO | jvm 1 | 2023/02/17 23:40:56 | 2023-02-17 23:40:56.600:INFO:oejsh.ContextHandler:stopped o.e.j.w.WebAppContext{/,file:/home/bob/archiva/apps/archiva/},/home/bob/archiva/apps/archiva
STATUS | wrapper | 2023/02/17 23:40:56 | <-- Wrapper Stopped
==> /home/bob/archiva/logs/wrapper-20230218.log <==
INFO | jvm 1 | 2023/02/18 09:42:45 | 2023-02-18 09:42:45.617:WARN:oejd.WebAppDeployer:WebAppDeployer is deprecated. Use WebAppProvider
INFO | jvm 1 | 2023/02/18 09:42:45 | 2023-02-18 09:42:45.752:INFO:oejs.Server:jetty-8.1.14.v20131031
INFO | jvm 1 | 2023/02/18 09:42:45 | 2023-02-18 09:42:45.773:INFO:oejs.NCSARequestLog:Opened /home/bob/archiva/logs/request-20230218.log
INFO | jvm 1 | 2023/02/18 09:42:45 | 2023-02-18 09:42:45.889:INFO:oejd.ContextDeployer:Deploy /home/bob/archiva/contexts/archiva.xml -> o.e.j.w.WebAppContext{/,null},/home/bob/archiva/apps/archiva
INFO | jvm 1 | 2023/02/18 09:42:50 | 2023-02-18 09:42:50.320:INFO:oejpw.PlusConfiguration:No Transaction manager found - if your webapp requires one, please configure one.
INFO | jvm 1 | 2023/02/18 09:42:50 | 2023-02-18 09:42:50.632:INFO:oejw.StandardDescriptorProcessor:NO JSP Support for /, did not find org.apache.jasper.servlet.JspServlet
INFO | jvm 1 | 2023/02/18 09:42:52 | 2023-02-18 09:42:52.886:INFO:/:Initializing Spring root WebApplicationContext
INFO | jvm 1 | 2023/02/18 09:43:08 | Feb 18, 2023 9:43:08 AM org.apache.tomcat.jdbc.pool.ConnectionPool init
INFO | jvm 1 | 2023/02/18 09:43:08 | WARNING: maxIdle is larger than maxActive, setting maxIdle to: 20
INFO | jvm 1 | 2023/02/18 09:43:18 | 2023-02-18 09:43:18.727:INFO:oejs.AbstractConnector:Started SelectChannelConnector#0.0.0.0:8082
==> /home/bob/archiva/logs/wrapper-20230219.log <==
INFO | jvm 1 | 2023/02/19 14:46:41 | 2023-02-19 14:46:41.776:WARN:oejd.WebAppDeployer:WebAppDeployer is deprecated. Use WebAppProvider
INFO | jvm 1 | 2023/02/19 14:46:41 | 2023-02-19 14:46:41.853:INFO:oejs.Server:jetty-8.1.14.v20131031
INFO | jvm 1 | 2023/02/19 14:46:41 | 2023-02-19 14:46:41.869:INFO:oejs.NCSARequestLog:Opened /home/bob/archiva/logs/request-20230219.log
INFO | jvm 1 | 2023/02/19 14:46:41 | 2023-02-19 14:46:41.909:INFO:oejd.ContextDeployer:Deploy /home/bob/archiva/contexts/archiva.xml -> o.e.j.w.WebAppContext{/,null},/home/bob/archiva/apps/archiva
INFO | jvm 1 | 2023/02/19 14:46:44 | 2023-02-19 14:46:44.117:INFO:oejpw.PlusConfiguration:No Transaction manager found - if your webapp requires one, please configure one.
INFO | jvm 1 | 2023/02/19 14:46:44 | 2023-02-19 14:46:44.216:INFO:oejw.StandardDescriptorProcessor:NO JSP Support for /, did not find org.apache.jasper.servlet.JspServlet
INFO | jvm 1 | 2023/02/19 14:46:45 | 2023-02-19 14:46:45.010:INFO:/:Initializing Spring root WebApplicationContext
INFO | jvm 1 | 2023/02/19 14:46:51 | Feb 19, 2023 2:46:51 PM org.apache.tomcat.jdbc.pool.ConnectionPool init
INFO | jvm 1 | 2023/02/19 14:46:51 | WARNING: maxIdle is larger than maxActive, setting maxIdle to: 20
INFO | jvm 1 | 2023/02/19 14:46:56 | 2023-02-19 14:46:56.124:INFO:oejs.AbstractConnector:Started SelectChannelConnector#0.0.0.0:8082
Check free space:
$ df -h /home/bob/archiva/
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/ol-root 36G 15G 21G 43% /
Was performed Archiva reboot.
Why I cannot Browse/Search the Central repository in Archiva?

How can I access the current ZonedDateTime (or Date) in a "route" when processing with a "timer" loop?

Background:
The "configure()" method, in the sample code below, loops at specified time interval at which time I wish to log the current "ZonedDateTime.now() value
Problem:
The ZonedDateTime.now() value is always the same value, despite the interval time difference.
Question:
What technique can I used to access the current ZonedDateTime.now() value at each interval?
(NOTE: I ultimately, wish to use this value as a parameter in a REST call)
Sample code:
package aaa.bbb.ccc.dateparmissue;
import java.time.ZonedDateTime;
import java.time.format.DateTimeFormatter;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.cdi.ContextName;
#ContextName("rest-dsl")
public class DateParmIssue extends RouteBuilder {
public DateParmIssue() {
}
private final String codeList = "AA,BB,CC";
private final int notifyTime = 10; //<==10 second interval
#Override
public void configure() throws Exception {
org.apache.log4j.MDC.put("app.name", "dateParmIssue");
System.getProperties().list(System.out);
onException(Exception.class)
.log("onException_processing_exception:" + this.exceptionMessage().toString() + "...send to_error_queue:" + body(String.class).toString())
.handled(true);
from("timer://foo?fixedRate=true&period=" + (notifyTime * 1000))
.setBody(constant(this.codeList))
.to("seda:node0");
from("seda:node0")
.split().tokenize(",")
.to("seda:node1");
from("seda:node1")
.log("seda:node1...body-code=${body}...zdt=" + simple(ZonedDateTime.now().format(DateTimeFormatter.ISO_OFFSET_DATE_TIME)));
}
}
Sample output...
2017-12-27 12:17:11,649 | INFO | 1 - seda://node1 | route3 | 232 - org.apache.camel.camel-core - 2.17.0.redhat-630187 | direct:node1...body-code=AA...zdt=Simple: 2017-12-27T12:17:10.306-05:00
2017-12-27 12:17:11,653 | INFO | 1 - seda://node1 | route3 | 232 - org.apache.camel.camel-core - 2.17.0.redhat-630187 | direct:node1...body-code=BB...zdt=Simple: 2017-12-27T12:17:10.306-05:00
2017-12-27 12:17:11,653 | INFO | 1 - seda://node1 | route3 | 232 - org.apache.camel.camel-core - 2.17.0.redhat-630187 | direct:node1...body-code=CC...zdt=Simple: 2017-12-27T12:17:10.306-05:00
2017-12-27 12:17:21,630 | INFO | 1 - seda://node1 | route3 | 232 - org.apache.camel.camel-core - 2.17.0.redhat-630187 | direct:node1...body-code=AA...zdt=Simple: 2017-12-27T12:17:10.306-05:00
2017-12-27 12:17:21,630 | INFO | 1 - seda://node1 | route3 | 232 - org.apache.camel.camel-core - 2.17.0.redhat-630187 | direct:node1...body-code=BB...zdt=Simple: 2017-12-27T12:17:10.306-05:00
2017-12-27 12:17:21,631 | INFO | 1 - seda://node1 | route3 | 232 - org.apache.camel.camel-core - 2.17.0.redhat-630187 | direct:node1...body-code=CC...zdt=Simple: 2017-12-27T12:17:10.306-05:00
2017-12-27 12:17:31,633 | INFO | 1 - seda://node1 | route3 | 232 - org.apache.camel.camel-core - 2.17.0.redhat-630187 | direct:node1...body-code=AA...zdt=Simple: 2017-12-27T12:17:10.306-05:00
2017-12-27 12:17:31,636 | INFO | 1 - seda://node1 | route3 | 232 - org.apache.camel.camel-core - 2.17.0.redhat-630187 | direct:node1...body-code=BB...zdt=Simple: 2017-12-27T12:17:10.306-05:00
2017-12-27 12:17:31,637 | INFO | 1 - seda://node1 | route3 | 232 - org.apache.camel.camel-core - 2.17.0.redhat-630187 | direct:node1...body-code=CC...zdt=Simple: 2017-12-27T12:17:10.306-05:00
It turns out that the "timer" inserts a "firedTime" property in the header that can be used (although it is currently as a java.util.Date object, rather than one of the newer Java 8 date objects - e.g., ZonedDateTime).
So, an alternative might be as follows - i.e., which shows the changing date...
from("seda:node1")
.process(new Processor(){
public void process(Exchange exchange) {
exchange.getIn().setHeader("code", exchange.getIn().getBody().toString());
exchange.getIn().setBody((new Date(exchange.getIn().getHeader("firedTime").toString()).toInstant()).atZone(ZoneId.systemDefault()).format(DateTimeFormatter.ISO_OFFSET_DATE_TIME));
}
})
.log("seda:node1...body-code=${in.header.code}...zdt=${body}");
...and date now changes...
2017-12-28 15:37:18,017 | INFO | 7 - seda://node1 | route17 | 232 - org.apache.camel.camel-core - 2.17.0.redhat-630187 | seda:node1...body-code=AA...zdt=2017-12-28T15:37:18-05:00
2017-12-28 15:37:18,019 | INFO | 7 - seda://node1 | route17 | 232 - org.apache.camel.camel-core - 2.17.0.redhat-630187 | seda:node1...body-code=BB...zdt=2017-12-28T15:37:18-05:00
2017-12-28 15:37:18,020 | INFO | 7 - seda://node1 | route17 | 232 - org.apache.camel.camel-core - 2.17.0.redhat-630187 | seda:node1...body-code=CC...zdt=2017-12-28T15:37:18-05:00
2017-12-28 15:37:28,017 | INFO | 7 - seda://node1 | route17 | 232 - org.apache.camel.camel-core - 2.17.0.redhat-630187 | seda:node1...body-code=AA...zdt=2017-12-28T15:37:28-05:00
2017-12-28 15:37:28,017 | INFO | 7 - seda://node1 | route17 | 232 - org.apache.camel.camel-core - 2.17.0.redhat-630187 | seda:node1...body-code=BB...zdt=2017-12-28T15:37:28-05:00
2017-12-28 15:37:28,018 | INFO | 7 - seda://node1 | route17 | 232 - org.apache.camel.camel-core - 2.17.0.redhat-630187 | seda:node1...body-code=CC...zdt=2017-12-28T15:37:28-05:00

grails webflow notserializableexception

Grails upgrade from 1.3.7 to Grails 2.1.0.
Grails run-app executed. No errors.
Call to webflow action throws GrailsExceptionResolver error. States a grails webflow object isn’t serializable. I have navigated all classes to ensure all have ‘implements serializable’.
Error not identifying object not being serialized, so unable to identify if a class field should be made transient to be ignored by serializable runtime.
Full Stacktrace:
2016-12-20 09:51:25,750 [http-bio-80-exec-1] DEBUG services.RpgService - ************
| Error 2016-12-20 09:51:26,450 [http-bio-80-exec-1] ERROR errors.GrailsExceptionResolver - NotSerializableException occurred when processing request: [GET] /…/…/order
org.codehaus.groovy.grails.commons.spring.GrailsWebApplicationContext. Stacktrace follows:
Message: Could not serialize flow execution; make sure all objects stored in flow or flash scope are serializable
Line | Method
->> 384 | doFilterInternal in org.jsecurity.web.servlet.JsecurityFilter
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 183 | doFilter in org.jsecurity.web.servlet.OncePerRequestFilter
| 886 | runTask . . . . in java.util.concurrent.ThreadPoolExecutor$Worker
| 908 | run in ''
^ 662 | run . . . . . . in java.lang.Thread
Caused by NotSerializableException: org.codehaus.groovy.grails.commons.spring.GrailsWebApplicationContext
->> 1164 | writeObject0 in java.io.ObjectOutputStream
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 1518 | defaultWriteFields in ''
| 1483 | writeSerialData in ''
| 1400 | writeOrdinaryObject in ''
| 1158 | writeObject0 . . in ''
| 1518 | defaultWriteFields in ''
| 1483 | writeSerialData in ''
| 1400 | writeOrdinaryObject in ''
| 1158 | writeObject0 . . in ''
| 330 | writeObject in ''
| 1001 | writeObject . . in java.util.HashMap
| 940 | invokeWriteObject in java.io.ObjectStreamClass
| 1469 | writeSerialData in java.io.ObjectOutputStream
| 1400 | writeOrdinaryObject in ''
| 1158 | writeObject0 . . in ''
| 1518 | defaultWriteFields in ''
Found the resolution.
My controller service was calling sessionFactory which also needed to be transient.
code change:
def sessionFactory => transient sessionFactory.
Did not need make any domain class variables transient directly.
fixed the issue.

Entity class loading issue in karaf OSGI

I am working a project which is using
spring 3.2.5.RELEASE
hibernate 4.2.15.Final
karaf 3.0.x
when i install my custom bundle (contain all entity classes), throwing PersistentClass name cannot be converted into a Class exception
please find below my karaf bundle lists
ID | State | Lvl | Version | Name
-------------------------------------------------------------------------------------
84 | Active | 80 | 2.7.7.5 | Apache ServiceMix :: Bundles :: antlr
85 | Active | 80 | 1.8.2.2 | Apache ServiceMix :: Bundles :: ant
86 | Active | 80 | 1.6.1.5 | Apache ServiceMix :: Bundles :: dom4j
87 | Active | 80 | 1.14.1.1 | Apache ServiceMix :: Bundles :: serp
88 | Active | 80 | 1.1.0 | ClassMate
89 | Active | 80 | 3.18.1.GA | Javassist
90 | Active | 80 | 1.0.2.Final | JACC 1.4 API
91 | Active | 80 | 1.2.2.Final | Java Annotation Indexer
92 | Active | 80 | 3.1.4.GA | JBoss Logging 3
93 | Active | 80 | 4.0.4.Final | hibernate-commons-annotations
94 | Active | 100 | 4.2.15.Final | hibernate-core
95 | Active | 100 | 4.2.15.Final | hibernate-entitymanager
96 | Active | 100 | 4.2.15.Final | hibernate-osgi
294 | Active | 80 | 3.2.5.RELEASE | Spring Context
295 | Active | 80 | 3.2.5.RELEASE | Spring Core
296 | Active | 80 | 3.2.5.RELEASE | Spring Expression Language
297 | Active | 80 | 3.2.5.RELEASE | Spring Transaction
298 | Active | 80 | 1.2.17 | Apache Log4j
299 | Active | 80 | 1.7.5 | slf4j-api, Fragments: 300
300 | Resolved | 80 | 1.7.5 | slf4j-log4j12, Hosts: 299
302 | Active | 80 | 0 | wrap_mvn_org.springframework.amqp_spring-amqp_1.2.2.RELEASE
303 | Active | 80 | 0 | wrap_mvn_org.springframework.amqp_spring-rabbit_1.2.2.RELEASE
304 | Active | 80 | 3.2.5.RELEASE | Spring ORM
305 | Active | 80 | 1.0.0 | AOP Alliance API
306 | Active | 80 | 3.2.5.RELEASE | Spring JDBC
307 | Active | 80 | 8.3.603 | PostgreSQL JDBC3 Driver
308 | Active | 80 | 0.9.1.2 | c3p0 Connection Pool
309 | Active | 80 | 2.0.0 | Java Persistence API
310 | Active | 80 | 0 | wrap_mvn_antlr_antlr_2.7.7
311 | Active | 80 | 3.1.0.GA | JBoss Logging 3
312 | Active | 80 | 0 | wrap_mvn_dom4j_dom4j_1.6.1
313 | Active | 80 | 1.0.1.Final | Java Transaction API
314 | Active | 80 | 0 | wrap_mvn_org.hibernate.javax.persistence_hibernate-jpa-2.0-api_1.0.1.Final
315 | Active | 80 | 4.0.2.Final | Hibernate Commons Annotations
316 | Active | 80 | 3.0.0 | Expression Language 3.0 API
317 | Active | 80 | 1.2 | javax.interceptor API
318 | Active | 80 | 0 | wrap_mvn_javax.inject_javax.inject_1
319 | Active | 80 | 1.2.0 | CDI APIs
320 | Active | 80 | 1.5.3 | Apache Commons Pool
321 | Active | 80 | 1.7.2.RELEASE | AspectJ Runtime
322 | Active | 80 | 1.7.1.RELEASE | AspectJ Weaver
323 | Active | 80 | 1.1.0 | Java Transaction API
324 | Active | 80 | 2.6.0 | Apache Commons Lang
325 | Active | 80 | 1.3.1 | MaxMind GeoIP Legacy API
326 | Active | 80 | 3.2.1 | Apache Commons Collections
327 | Active | 80 | 3.4.0 | Apache Commons Lang
328 | Active | 80 | 2.3.2 | Jackson-annotations
329 | Active | 80 | 0 | wrap_mvn_commons-collections_commons-collections_3.2
330 | Active | 80 | 1.0.1 | soautil
331 | Active | 80 | 0 | wrap_mvn_logkit_logkit_1.0.1
332 | Active | 80 | 0 | wrap_mvn_javax.servlet_servlet-api_2.3
333 | Active | 80 | 0 | wrap_mvn_commons-logging_commons-logging_1.1
334 | Active | 80 | 3.2.5.RELEASE | Spring AOP
335 | Active | 80 | 3.2.5.RELEASE | Spring Beans
336 | Active | 80 | 3.2.5.RELEASE | Spring Web
337 | Active | 80 | 0 | wrap_mvn_org.springframework_spring-remoting_2.0.8
339 | Active | 80 | 1.2.16 | Apache Log4J
340 | Active | 80 | 2.3.18 | Freemarker Templating Engine
341 | Active | 80 | 1.0.1 | utils-spring
342 | Active | 80 | 5.0.0.201203141902 | osgi.core
343 | Active | 80 | 1.2.1 | spring-osgi-io
344 | Active | 80 | 1.2.1 | spring-osgi-core
345 | Active | 80 | 1.2.1 | spring-osgi-extender
346 | Active | 80 | 5.0.0.201305092017 | osgi.cmpn
347 | Active | 80 | 0.5.4 | FasterXML ClassMate
348 | Active | 80 | 1.0.1 | MyServiceBundle
Find below exceptions
2016-03-26 01:04:41,934 | DEBUG | ExtenderThread-2 | OsgiBundleXmlApplicationContext | 294 - org.springframework.context - 3.2.5.RELEASE | Post refresh error
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'geoService': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: com.sample.repository.sampleRepository com.sample.impl.GeoServiceImpl.sampleRepository; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sampleRepository': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: protected org.hibernate.SessionFactory com.sample.repository.sampleRepository.sessionFactory; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in URL [bundle://348.0:0/spring-data.xml]: Invocation of init method failed; nested exception is org.hibernate.AssertionFailure: PersistentClass name cannot be converted into a Class
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:289)[335:org.springframework.beans:3.2.5.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1146)[335:org.springframework.beans:3.2.5.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)[335:org.springframework.beans:3.2.5.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:458)[335:org.springframework.beans:3.2.5.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:296)[335:org.springframework.beans:3.2.5.RELEASE]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223)[335:org.springframework.beans:3.2.5.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:293)[335:org.springframework.beans:3.2.5.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)[335:org.springframework.beans:3.2.5.RELEASE]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:628)[335:org.springframework.beans:3.2.5.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:932)[294:org.springframework.context:3.2.5.RELEASE]
at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.access$1600(AbstractDelegatedExecutionApplicationContext.java:69)[344:org.springframework.osgi.core:1.2.1]
at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext$4.run(AbstractDelegatedExecutionApplicationContext.java:355)[344:org.springframework.osgi.core:1.2.1]
at org.springframework.osgi.util.internal.PrivilegedUtils.executeWithCustomTCCL(PrivilegedUtils.java:85)[344:org.springframework.osgi.core:1.2.1]
at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.completeRefresh(AbstractDelegatedExecutionApplicationContext.java:320)[344:org.springframework.osgi.core:1.2.1]
at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor$CompleteRefreshTask.run(DependencyWaiterApplicationContextExecutor.java:132)[345:org.springframework.osgi.extender:1.2.1]
at java.lang.Thread.run(Thread.java:745)[:1.7.0_71]
Caused by: org.springframework.beans.factory.BeanCreationException: Could not autowire field: com.sample.repository.sampleRepository com.sample.impl.GeoServiceImpl.sampleRepository; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sampleRepository': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: protected org.hibernate.SessionFactory com.sample.repository.sampleRepository.sessionFactory; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in URL [bundle://348.0:0/spring-data.xml]: Invocation of init method failed; nested exception is org.hibernate.AssertionFailure: PersistentClass name cannot be converted into a Class
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:517)[335:org.springframework.beans:3.2.5.RELEASE]
at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:87)[335:org.springframework.beans:3.2.5.RELEASE]
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:286)[335:org.springframework.beans:3.2.5.RELEASE]
... 15 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sampleRepository': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: protected org.hibernate.SessionFactory com.sample.repository.sampleRepository.sessionFactory; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in URL [bundle://348.0:0/spring-data.xml]: Invocation of init method failed; nested exception is org.hibernate.AssertionFailure: PersistentClass name cannot be converted into a Class
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:289)[335:org.springframework.beans:3.2.5.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1146)[335:org.springframework.beans:3.2.5.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)[335:org.springframework.beans:3.2.5.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:458)[335:org.springframework.beans:3.2.5.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:296)[335:org.springframework.beans:3.2.5.RELEASE]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223)[335:org.springframework.beans:3.2.5.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:293)[335:org.springframework.beans:3.2.5.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)[335:org.springframework.beans:3.2.5.RELEASE]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:912)[335:org.springframework.beans:3.2.5.RELEASE]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:855)[335:org.springframework.beans:3.2.5.RELEASE]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:770)[335:org.springframework.beans:3.2.5.RELEASE]
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:489)[335:org.springframework.beans:3.2.5.RELEASE]
... 17 more
Caused by: org.springframework.beans.factory.BeanCreationException: Could not autowire field: protected org.hibernate.SessionFactory com.sample.repository.sampleRepository.sessionFactory; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in URL [bundle://348.0:0/spring-data.xml]: Invocation of init method failed; nested exception is org.hibernate.AssertionFailure: PersistentClass name cannot be converted into a Class
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:517)[335:org.springframework.beans:3.2.5.RELEASE]
at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:87)[335:org.springframework.beans:3.2.5.RELEASE]
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:286)[335:org.springframework.beans:3.2.5.RELEASE]
... 28 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in URL [bundle://348.0:0/spring-data.xml]: Invocation of init method failed; nested exception is org.hibernate.AssertionFailure: PersistentClass name cannot be converted into a Class
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1512)[335:org.springframework.beans:3.2.5.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:521)[335:org.springframework.beans:3.2.5.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:458)[335:org.springframework.beans:3.2.5.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:296)[335:org.springframework.beans:3.2.5.RELEASE]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223)[335:org.springframework.beans:3.2.5.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:293)[335:org.springframework.beans:3.2.5.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)[335:org.springframework.beans:3.2.5.RELEASE]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:912)[335:org.springframework.beans:3.2.5.RELEASE]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:855)[335:org.springframework.beans:3.2.5.RELEASE]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:770)[335:org.springframework.beans:3.2.5.RELEASE]
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:489)[335:org.springframework.beans:3.2.5.RELEASE]
... 30 more
Caused by: org.hibernate.AssertionFailure: PersistentClass name cannot be converted into a Class
at org.hibernate.cfg.BinderHelper.getPropertyOverriddenByMapperOrMapsId(BinderHelper.java:816)[94:org.hibernate.core:4.2.15.Final]
at org.hibernate.cfg.AnnotationBinder.processElementAnnotations(AnnotationBinder.java:2097)[94:org.hibernate.core:4.2.15.Final]
at org.hibernate.cfg.AnnotationBinder.processIdPropertiesIfNotAlready(AnnotationBinder.java:895)[94:org.hibernate.core:4.2.15.Final]
at org.hibernate.cfg.AnnotationBinder.bindClass(AnnotationBinder.java:728)[94:org.hibernate.core:4.2.15.Final]
at org.hibernate.cfg.Configuration$MetadataSourceQueue.processAnnotatedClassesQueue(Configuration.java:3568)[94:org.hibernate.core:4.2.15.Final]
at org.hibernate.cfg.Configuration$MetadataSourceQueue.processMetadata(Configuration.java:3522)[94:org.hibernate.core:4.2.15.Final]
at org.hibernate.cfg.Configuration.secondPassCompile(Configuration.java:1379)[94:org.hibernate.core:4.2.15.Final]
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1784)[94:org.hibernate.core:4.2.15.Final]
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1868)[94:org.hibernate.core:4.2.15.Final]
at org.springframework.orm.hibernate4.LocalSessionFactoryBuilder.buildSessionFactory(LocalSessionFactoryBuilder.java:247)[304:org.springframework.orm:3.2.5.RELEASE]
at org.springframework.orm.hibernate4.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:373)[304:org.springframework.orm:3.2.5.RELEASE]
at org.springframework.orm.hibernate4.LocalSessionFactoryBean.afterPropertiesSet(LocalSessionFactoryBean.java:358)[304:org.springframework.orm:3.2.5.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1571)[335:org.springframework.beans:3.2.5.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1509)[335:org.springframework.beans:3.2.5.RELEASE]
... 40 more
Caused by: java.lang.ClassNotFoundException: com.sample.model.Country not found by org.hibernate.core [94]
at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1532)[org.apache.felix.framework-4.2.1.jar:]
at org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:75)[org.apache.felix.framework-4.2.1.jar:]
at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1955)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)[:1.7.0_71]
at java.lang.Class.forName0(Native Method)[:1.7.0_71]
at java.lang.Class.forName(Class.java:274)[:1.7.0_71]
at org.hibernate.annotations.common.util.ReflectHelper.classForName(ReflectHelper.java:60)[93:org.hibernate.common.hibernate-commons-annotations:4.0.4.Final]
at org.hibernate.annotations.common.reflection.java.JavaReflectionManager.classForName(JavaReflectionManager.java:138)[93:org.hibernate.common.hibernate-commons-annotations:4.0.4.Final]
at org.hibernate.cfg.BinderHelper.getPropertyOverriddenByMapperOrMapsId(BinderHelper.java:812)[94:org.hibernate.core:4.2.15.Final]
... 53 more
i guess, entity classes are not scanning properly. This is my configuration
<bean id="sessionFactory"
class="org.springframework.orm.hibernate4.LocalSessionFactoryBean">
<property name="dataSource" ref="dataSource"/>
<property name="hibernateProperties" ref="hibernateProperties"/>
<property name="annotatedClasses">
<list>
<value>com.sample.model.Country</value>
<value>com.sample.model.Location</value>
</list>
</property>
</bean>
<bean id="transactionManager"
class="org.springframework.orm.hibernate4.HibernateTransactionManager">
<property name="sessionFactory" ref="sessionFactory"/>
</bean>
EDITED :
Please find below manifest header entries
Manifest-Version = 1.0
Bnd-LastModified = 1458957186000
Tool = Bnd-2.4.0.201411031534
Spring-Context = /spring.xml
Created-By = 1.7.0_71 (Oracle Corporation)
Bundle-Vendor = demo
Bundle-Name = MyServiceBundle
Bundle-Description = MyService Bundle to create Amqp services
Bundle-SymbolicName = com.sample.MyServiceBundle
Bundle-Version = 1.0.1
Bundle-ManifestVersion = 2
Require-Capability =
osgi.ee;filter:=(&(osgi.ee=JavaSE)(version=1.7))
Import-Package =
com.maxmind.geoip;version="[1.3,2)",
javax.persistence;version="[2.0,3)",
org.hibernate;version="[4.2,5)",
org.hibernate.annotations;version="[4.2,5)",
org.hibernate.criterion;version="[4.2,5)",
org.slf4j;version="[1.7,2)",
org.springframework.beans.factory.annotation;version="[3.2,4)",
org.springframework.context.support;version="[3.2,4)",
org.springframework.stereotype;version="[3.2,4)",
org.springframework.transaction.annotation;version="[3.2,4)",
com.sample.api;version="[1.0,2)",
com.sample.utils.soa.exception;version="[1.0,2)",
org.springframework.amqp.rabbit.core,
org.springframework.orm.hibernate4;version="[3.2,4)",
com.mchange.v2.c3p0;version="[0.9,1)",
org.springframework.aop;version="[3.2,4)",
org.springframework.aop.framework;version="[3.2,4)",
org.springframework.cglib.proxy;version="[3.2,4)",
org.springframework.cglib.core;version="[3.2,4)",
org.aopalliance.aop;version="[1.0,2)",
org.springframework.amqp.rabbit.listener.adapter,
org.springframework.amqp.remoting.service,
com.sample.utils.spring;version="[1.0,2)",
org.springframework.remoting.support;version="[3.2,4)",
org.springframework.amqp.rabbit.transaction,
org.springframework.cglib.reflect;version="[3.2,4)",
org.springframework.jmx.export.annotation;version="[3.2,4)",
org.springframework.amqp.support.converter,
org.springframework.core.type;version="[3.2,4)",
org.springframework.context;version="[3.2,4)",
org.apache.felix.service.command,
org.apache.felix.gogo.commands,
org.apache.karaf.shell.console,
org.apache.karaf.shell.commands,
org.hibernate.cfg;version="[4.2,5)",
org.hibernate.service;version="[4.2,5)",
org.hibernate.proxy;version="[4.2,5)",
javassist.util.proxy;version="[3.18,4)",
com.sample.model;version="[1.0,2)"
Export-Package =
com.sample;uses:=com.sample.utils.soa.exception;version=1.0.1,
com.sample.repository;
uses:="org.hibernate,
org.springframework.beans.factory.annotation,
org.springframework.stereotype,
org.springframework.transaction.annotation,
com.sample.api,
com.sample.model,
com.sample.utils.soa.exception";
version=1.0.1,
com.sample.impl;uses:="org.springframework.stereotype,com.sample.api,com.sample.utils.soa.exception";version=1.0.1,
com.sample.model;uses:=javax.persistence;version=1.0.1
I cannot solve this problem. If anyone get idea please share with me
Thank you,
gopy
Edited : 4-april-2016
Still i am unable to solve .....
Now i upgraded spring to
Apache ServiceMix :: Bundles 4.2.5.RELEASE_1 and
hibernate-core 4.3.6.Final
But again same issue.
Caused by: org.hibernate.AssertionFailure: PersistentClass name cannot
be converted into a Class at
org.hibernate.cfg.BinderHelper.getPropertyOverriddenByMapperOrMapsId(BinderHelper.java:817)
at
org.hibernate.cfg.AnnotationBinder.processElementAnnotations(AnnotationBinder.java:2169)
at
org.hibernate.cfg.AnnotationBinder.processIdPropertiesIfNotAlready(AnnotationBinder.java:963)
at
org.hibernate.cfg.AnnotationBinder.bindClass(AnnotationBinder.java:796)
at
org.hibernate.cfg.Configuration$MetadataSourceQueue.processAnnotatedClassesQueue(Configuration.java:3788)
at
org.hibernate.cfg.Configuration$MetadataSourceQueue.processMetadata(Configuration.java:3742)
at
org.hibernate.cfg.Configuration.secondPassCompile(Configuration.java:1410)
at
org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1844)
at
org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1928)
at
org.springframework.orm.hibernate4.LocalSessionFactoryBuilder.buildSessionFactory(LocalSessionFactoryBuilder.java:372)
at
org.springframework.orm.hibernate4.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:454)
at
org.springframework.orm.hibernate4.LocalSessionFactoryBean.afterPropertiesSet(LocalSessionFactoryBean.java:439)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1637)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1574)
Same bundle able to deploy in virgo osgi server. So i am sure hibernate configuration is not an issue. Some supporting libs are missing.
If anyone using karaf 3.x with hibernate please share your
bundle:list
i will compare with mine.
thank you in advance.
This seems to be the root cause:
Caused by: java.lang.ClassNotFoundException: com.sample.model.Country not found by org.hibernate.core [94]
Without seeing the manifest, or the output from
karaf> headers $bundleId
there isn't much else to go on.
Most likely, you are missing an Import-Package entry for com.sample.model

I get 404 Not found | Install war project in Karaf 3 from userguide

I can install a war but not to test it , why ????
From Karaf tuto I have done :
karaf#root()> bundle:install -s "webbundle:http://tomcat.apache.org/tomcat-7.0-doc/appdev/sample/sample.war?Bundle-SymbolicName=tomcat-sample&Web-ContextPath=/sample"
Bundle ID: 150
karaf#root()> list |grep tom
150 | Active | 80 | 0 | tomcat-sample
karaf#root()> web:list
ID | State | Web-State | Level | Web-ContextPath | Name
123 | Active | Deployed | 80 | /sample | tomcat-sample (0)
When I go to [http://loxcalhost:8181/sample] it's not working , why ???
The sample war doesn't contain a welcome section in it's web.xml and therefore nothing happens if you call localhost:8181/sample you have to go for localhost:8181/sample/hello as that's the registered servlet for this web-application.
If you issue a http:list command you'll get the following listing:
karaf#root()> http:list
ID | Servlet | Servlet-Name | State | Alias | Url
---------------------------------------------------------------------------------------------------------------------------
103 | JspServletWrapper | jsp | Deployed | | [*.jsp, *.jspx, *.jspf, *.xsp, *.JSP, *.JSPX, *.JSPF, *.XSP]
103 | ResourceServlet | default | Deployed | / | [/]
103 | | HelloServlet | Deployed | | [/hello]

Resources