servicemix 4.5 NoInitialContextException - java

We have the osgi application that perfectly worked on Servicemix 5. But for some reasons we must migrate to Servicemix 4.5. I tried it and got this
Error parsing SQL Mapper Configuration. Cause:
org.apache.ibatis.builder.BuilderException: Error parsing SQL MapperConfiguration. Cause: org.apache.ibatis.datasource.DataSourceException: There was an error configuring JndiDataSourceTransactionPool. Cause: javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial
What does it need?

Install the Aries JNDI feature?
features:install jndi

Related

Error When Updating HikariCP with JTDS and Spring Boot 1.5

APPLICATION FAILED TO START
Description:
Binding to target HikariDataSource (HikariPool-1) failed:
Property: spring.datasource.hikari.connectionTestQuery
Value: SELECT 1
Reason: Property 'connectionTestQuery' threw exception; nested exception is java.lang.IllegalStateException: The configuration of the pool is sealed once started. Use HikariConfigMXBean for runtime changes.
As per Hikari documentation, you may not required to set this property if you use latest JDBC drivers. This property is for legacy JDBC drivers (<JDBC4).
You can try running your application without setting this property. Moreover, if still issue persists, please share hikari bean definition; I will update my answer based on that.
After upgrading the application to the below version of the spring boot, the application started with no errors
<parent>
<groupId>com.accurate.boot</groupId>
<artifactId>accurate-spring-starter-parent</artifactId>
<version>1.5.22.RELEASE</version>

Spring cloud config server not able to read property file

My Spring cloud config server is throwing below error when trying to access the property file content using http://localhost:8080/application/default
There was an unexpected error (type=Internal Server Error, status=500).
Could not construct context for config=application profile=default label= includeOrigin=false; nested exception is java.lang.IllegalStateException: ConfigFileApplicationListener [org.springframework.boot.context.config.ConfigFileApplicationListener] is deprecated and can only be used as an EnvironmentPostProcessor
org.springframework.cloud.config.server.environment.FailedToConstructEnvironmentException: Could not construct context for config=application profile=default label= includeOrigin=false; nested exception is java.lang.IllegalStateException: ConfigFileApplicationListener [org.springframework.boot.context.config.ConfigFileApplicationListener] is deprecated and can only be used as an EnvironmentPostProcessor
at org.springframework.cloud.config.server.environment.NativeEnvironmentRepository.findOne(NativeEnvironmentRepository.java:161)
at org.springframework.cloud.config.server.environment.AbstractScmEnvironmentRepository.findOne(AbstractScmEnvironmentRepository.java:59)
at org.springframework.cloud.config.server.environment.MultipleJGitEnvironmentRepository.findOne(MultipleJGitEnvironmentRepository.java:187)
at org.springframework.cloud.config.server.environment.CompositeEnvironmentRepository.findOne(CompositeEnvironmentRepository.java:58)
at org.springframework.cloud.config.server.environment.EnvironmentEncryptorEnvironmentRepository.findOne(EnvironmentEncryptorEnvironmentRepository.java:61)
at org.springframework.cloud.config.server.environment.EnvironmentController.getEnvironment(EnvironmentController.java:136)
at org.springframework.cloud.config.server.environment.EnvironmentController.defaultLabel(EnvironmentController.java:108)
at sun.reflect.GeneratedMethodAccessor68.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
My application.properties in config server looks like this
spring.cloud.config.server.git.uri=/Users/joe/MyProgs/Java/spring-ws/config and I even tried with this spring.cloud.config.server.git.uri=${HOME}/MyProgs/Java/spring-ws/config
Content of the property file in the local git repository is
martin:
name: Martin D'vloper
job: Developer
skill: Elite
Please let me know what I am doing wrong.
It looks like this deprecation message was added just a couple of weeks ago in this issue. These changes are not even released yet (marked for release in a future milestone version of Spring Boot 2.4.0-M2).
What version of Spring Boot are you using? I suppose you have a SNAPSHOT dependency somewhere in your build configuration.

JBAS011843: Failed instantiate InitialContextFactory com.ibm.websphere.naming.WsnInitialContextFactory

I'm migrating one application from Websphere to jboss EAP 6.0. I've made the Datasources on Jboss console. But in my code I've referring this way:
but while hitting the application from Jboss, it's giving the below error:
FATAL http-/135.155.175.224:8080-1 dbconn.DBAccess - getDatasource():
CRITICAL ERROR: JDBC Naming service exception: JBAS011843: Failed
instantiate InitialContextFactory
com.ibm.websphere.naming.WsnInitialContextFactory from classloader
ModuleClassLoader for Module "deployment.UPMSSSO.ear.UPMSSSO.war:main"
from Service Module Loader
Could anyone please hint the error. Is there any other in for JBoss?
Since you are migrating to Jboss from WebSphere and you are using "com.ibm.websphere.naming.WasInitialContextFactory" class, which is WAS specific class, that's why you are getting this error.
Change that to "org.jboss.naming.remote.client.InitialContextFactory" and then try again. That should resolve your issue.
UPDATE
All you should have to do is new InitialContext(), without any argument. JNDI is pre-configured with the appropriate properties for you by the app server unless you are looking for remote objects on any other server.

Deploy war to JBOSS

I tried to deploy a Vaadin hello world application in JBOSS. The application is as simple as it can be.
My development environment is eclipse for java EE + tomcat
java.lang.RuntimeException: Error configuring property: includeWebInfInClasspath for WarClassLoaderDeployer
at org.jboss.kernel.plugins.dependency.ConfigureAction.dispatchSetProperty(ConfigureAction.java:112)
at org.jboss.kernel.plugins.dependency.ConfigureAction.setAttributes(ConfigureAction.java:85)
(...)
Caused by: java.lang.IllegalArgumentException: No such property includeWebInfInClasspath for bean org.jboss.web.tomcat.service.deployers.WarClassLoaderDeployer available [java2ClassLoadingCompliance, parentFirst, requiredInputs, filteredPackages, allInputs, deploymentRegistry, class, stage, wantComponents, componentsOnly, input, inputs, relativeOrder, output, useUnitName, outputs, topLevelOnly]
I have tried to google this error with no success.
Does anyone have any clues?
Is it a web server configuration or my *.war is missing something?
EDIT:
This error occur when I start the server after placing my *.war in the folder.
My JBOSS version is 5
I guess, you're using an old JBoss 5.
The WarClassLoaderDeployer is configured in the file server/default/deployers/jbossweb.deployer/META-INF/war-deployers-jboss-beans.xml. (The 'default' directory should be changed to whatever you passed as -c parameter) Open the file, find the WarClassLoaderDeployer bean and drop the line defining the property with name includeWebInfInClasspath.

Apache Camel web console's scalate servlet fails in WebLogic

I've found a similar issue described in detail in the scala mailing list (also here). It seems to be related to this change in classpath management when creating scala interpretation environments.
In my case both scala-library and scala-compiler are included in the war being deployed to WebLogic 10.3 (camel version: 2.8.0, jvm: oracle 1.6).
The exception is shown below:
com.sun.jersey.api.container.ContainerException: org.fusesource.scalate.TemplateException: object scala not found.
at org.fusesource.scalate.jersey.ScalateTemplateProcessor.writeToUsingServletTemplateEngine(ScalateTemplateProcessor.scala:190)
at org.fusesource.scalate.jersey.ScalateTemplateProcessor.writeTo(ScalateTemplateProcessor.scala:136)
at org.fusesource.scalate.jersey.ScalateTemplateProcessor.writeTo(ScalateTemplateProcessor.scala:44)
at com.sun.jersey.spi.template.ResolvedViewable.writeTo(ResolvedViewable.java:103)
at com.sun.jersey.server.impl.template.ViewableMessageBodyWriter.writeTo(ViewableMessageBodyWriter.java:83)
Truncated. see log file for complete stacktrace
Caused By: org.fusesource.scalate.TemplateException: object scala not found.
at org.fusesource.scalate.TemplateEngine.compileAndLoad(TemplateEngine.scala:784)
at org.fusesource.scalate.TemplateEngine.compileAndLoadEntry(TemplateEngine.scala:643)
at org.fusesource.scalate.TemplateEngine.liftedTree1$1(TemplateEngine.scala:374)
at org.fusesource.scalate.TemplateEngine.load(TemplateEngine.scala:368)
at org.fusesource.scalate.TemplateEngine.load(TemplateEngine.scala:426)
Truncated. see log file for complete stacktrace
Caused By: scala.tools.nsc.MissingRequirementError: object scala not found.
at scala.tools.nsc.symtab.Definitions$definitions$.getModuleOrClass(Definitions.scala:653)
at scala.tools.nsc.symtab.Definitions$definitions$.getModule(Definitions.scala:603)
at scala.tools.nsc.symtab.Definitions$definitions$.ScalaPackage(Definitions.scala:145)
at scala.tools.nsc.symtab.Definitions$definitions$.ScalaPackageClass(Definitions.scala:146)
at scala.tools.nsc.symtab.Definitions$definitions$.AnyClass(Definitions.scala:176)
The question: is it possible to make camel web-console work in this environment?
No its a problem with WebLogic. Scalaete needs to add special support for WebLogic, as WebLogic does classloading a bit differently, than the usual practice.

Categories