Can't seem to integrate spring-cloud-sleuth into spring boot application - spring-cloud

Appreciate if someone can provide ideas on how to debug this....
I am trying to integrate spring cloud sleuth with zipkin into one of our microservice. I have the following in the pom.xml and in properties with debug. There are none of the usual messages from spring-cloud-sleuth or spring-cloud-sleuth zipkin in the log. Almost as if spring-cloud-sleuth has not been loaded or started. However I am getting the following debug message:
2021-06-24 13:38:39 DEBUG o.s.w.s.h.BeanNameUrlHandlerMapping - Rejected bean name 'org.springframework.cloud.sleuth.zipkin2.ZipkinAutoConfiguration$DefaultEndpointLocatorConfiguration': no URL paths identified
2021-06-24 13:38:39 DEBUG o.s.w.s.h.BeanNameUrlHandlerMapping - Rejected bean name 'zipkinEndpointLocator': no URL paths identified
2021-06-24 13:38:39 DEBUG o.s.w.s.h.BeanNameUrlHandlerMapping - Rejected bean name 'org.springframework.cloud.sleuth.zipkin2.ZipkinAutoConfiguration$RefreshScopedProbabilityBasedSamplerConfiguration': no URL paths identified
2021-06-24 13:38:39 DEBUG o.s.w.s.h.BeanNameUrlHandlerMapping - Rejected bean name 'scopedTarget.defaultTraceSampler': no URL paths identified
2021-06-24 13:38:39 DEBUG o.s.w.s.h.BeanNameUrlHandlerMapping - Rejected bean name 'defaultTraceSampler': no URL paths identified
2021-06-24 13:38:39 DEBUG o.s.w.s.h.BeanNameUrlHandlerMapping - Rejected bean name 'org.springframework.cloud.sleuth.zipkin2.sender.ZipkinRestTemplateSenderConfiguration$DiscoveryClientZipkinUrlExtractorConfiguration$ZipkinClientLoadBalancedConfiguration': no URL paths identified
2021-06-24 13:38:39 DEBUG o.s.w.s.h.BeanNameUrlHandlerMapping - Rejected bean name 'loadBalancerClientZipkinLoadBalancer': no URL paths identified
2021-06-24 13:38:39 DEBUG o.s.w.s.h.BeanNameUrlHandlerMapping - Rejected bean name 'org.springframework.cloud.sleuth.zipkin2.sender.ZipkinRestTemplateSenderConfiguration$DiscoveryClientZipkinUrlExtractorConfiguration': no URL paths identified
2021-06-24 13:38:39 DEBUG o.s.w.s.h.BeanNameUrlHandlerMapping - Rejected bean name 'org.springframework.cloud.sleuth.zipkin2.sender.ZipkinRestTemplateSenderConfiguration': no URL paths identified
2021-06-24 13:38:39 DEBUG o.s.w.s.h.BeanNameUrlHandlerMapping - Rejected bean name 'restTemplateSender': no URL paths identified
2021-06-24 13:38:39 DEBUG o.s.w.s.h.BeanNameUrlHandlerMapping - Rejected bean name 'zipkinUrlExtractor': no URL paths identified
2021-06-24 13:38:39 DEBUG o.s.w.s.h.BeanNameUrlHandlerMapping - Rejected bean name 'spring.zipkin.sender-org.springframework.cloud.sleuth.zipkin2.sender.ZipkinSenderProperties': no URL paths identified
2021-06-24 13:38:39 DEBUG o.s.w.s.h.BeanNameUrlHandlerMapping - Rejected bean name 'org.springframework.cloud.sleuth.zipkin2.ZipkinAutoConfiguration': no URL paths identified
2021-06-24 13:38:39 DEBUG o.s.w.s.h.BeanNameUrlHandlerMapping - Rejected bean name 'zipkinRestTemplateCustomizer': no URL paths identified
2021-06-24 13:38:39 DEBUG o.s.w.s.h.BeanNameUrlHandlerMapping - Rejected bean name 'sleuthReporterMetrics': no URL paths identified
2021-06-24 13:38:39 DEBUG o.s.w.s.h.BeanNameUrlHandlerMapping - Rejected bean name 'spring.zipkin-org.springframework.cloud.sleuth.zipkin2.ZipkinProperties': no URL paths identified
2021-06-24 13:38:39 DEBUG o.s.w.s.h.BeanNameUrlHandlerMapping - Rejected bean name 'spring.sleuth.sampler-org.springframework.cloud.sleuth.sampler.SamplerProperties': no URL paths identified
2021-06-24 13:38:39 DEBUG o.s.w.s.h.BeanNameUrlHandlerMapping - Rejected bean name 'org.springframework.cloud.sleuth.log.SleuthLogAutoConfiguration$Slf4jConfiguration': no URL paths identified
2021-06-24 13:38:39 DEBUG o.s.w.s.h.BeanNameUrlHandlerMapping - Rejected bean name 'org.springframework.cloud.sleuth.log.SleuthLogAutoConfiguration': no URL paths identified
2021-06-24 13:38:39 DEBUG o.s.w.s.h.BeanNameUrlHandlerMapping - Rejected bean name 'org.springframework.cloud.sleuth.autoconfig.TraceAutoConfiguration': no URL paths identified
The following is what's in my pom and properties files
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.0.7.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<properties>
<java.version>1.8</java.version>
<spring-cloud.version>Finchley.RELEASE</spring-cloud.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<sonar.junit.reportsPath>target/surefire-reports</sonar.junit.reportsPath>
<sonar.clover.reportPath>target/site/clover/clover.xml</sonar.clover.reportPath>
</properties>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-zipkin</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-sleuth-zipkin</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-sleuth</artifactId>
</dependency>
spring.application.name=xxxx
spring.sleuth.sampler.percentage=100.0
spring.sleuth.enabled=true
spring.zipkin.baseUrl=http://dev.zipkin.cloud.xxxxxx.com:9411/
spring.zipkin.sender.type=web
endpoints.enabled=true
logging.level.org.springframework.cloud.sleuth=DEBUG

You're using ancient versions of Spring Boot and Spring Cloud. Please upgrade to the latest version. You can go to start.spring.io and generate a project that uses Boot and Sleuth.

Related

SpringBoot: Cannot load driver class: org.postgresql.Driver

I have just created a new SpringBoot application (Java11) and am trying to connect to a Postgres database.
When I start the SpringBoot application, there is an error trying to connect to the database. The error reports that it Cannot load driver class: org.postgresql.Driver.
Question
How do I change my configuration below to get the SpringBoot application to connect to the database?
database version
PostgreSQL 12.6 on x86_64-apple-darwin16.7.0, compiled by Apple LLVM
version 8.1.0 (clang-802.0.42), 64-bit
pom.xml
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
</dependency>
application.properties
# pims datasource
spring.datasource.url=jdbc:postgresql://localhost:5432/pims
spring.datasource.username=postgres
spring.datasource.password=
spring.datasource.driverClassName=org.postgresql.Driver
#spring.datasource.driver-class-name=org.postgresql.Driver
#spring.jpa.database-platform=postgres
spring.jpa.show-sql=true
spring.datasource.dbcp2.test-while-idle=true
spring.datasource.dbcp2.validation-query=select 1
#spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect
spring.jpa.hibernate.naming.implicit-strategy=org.hibernate.boot.model.naming.ImplicitNamingStrategyLegacyHbmImpl
spring.jpa.hibernate.naming.physical-strategy=org.springframework.boot.orm.jpa.hibernate.SpringPhysicalNamingStrategy
When I run the #SpringBootApplication class, SpringBoot starts to start up as expected, but gets the following error.
error
Error starting ApplicationContext. To display the conditions report
re-run your application with 'debug' enabled. 2021-06-15 11:58:51.770
ERROR 68967 --- [ main] o.s.boot.SpringApplication
: Application run failed
org.springframework.beans.factory.UnsatisfiedDependencyException:
Error creating bean with name 'dataSourceScriptDatabaseInitializer'
defined in class path resource
[org/springframework/boot/autoconfigure/sql/init/DataSourceInitializationConfiguration.class]:
Unsatisfied dependency expressed through method
'dataSourceScriptDatabaseInitializer' parameter 0; nested exception is
org.springframework.beans.factory.BeanCreationException: Error
creating bean with name 'dataSource' defined in class path resource
[org/springframework/boot/autoconfigure/jdbc/DataSourceConfiguration$Hikari.class]:
Bean instantiation via factory method failed; nested exception is
org.springframework.beans.BeanInstantiationException: Failed to
instantiate [com.zaxxer.hikari.HikariDataSource]: Factory method
'dataSource' threw exception; nested exception is
java.lang.IllegalStateException: Cannot load driver class:
org.postgresql.Driver
If I remove the following entry (i.e. don't define the driver in application.properties and just have the pom dependency):
spring.datasource.driverClassName=org.postgresql.Driver
I then get the following error:
Failed to load driver class org.postgresql.Driver in either of HikariConfig class loader or Thread context classloader
When I expend the external dependency tree, I didn't find any jar for postgressql. After reimport maven dependency, it is added correctly and problem is gone. It is fine now.
You do not need any specific configuration to connect database unless your repository and entity packages are not pulled from another dependency.
I would suggest you to check your connection between your computer and maven repository. You should be missing your postgre dependecy somehow.
(You also would try providing specific version of postgresql artifact)

JHipster registry : build error

I try to build and run jhipster registry, but I get an error :
mvn package -Pprod
I get following errors in test :
Tests in error:
SwaggerBasePathRewritingFilterTest.<init>:20 » Unresolved compilation problem...
SwaggerBasePathRewritingFilterTest.<init>:20 » Unresolved compilation problem...
SwaggerBasePathRewritingFilterTest.<init>:20 » Unresolved compilation problem...
SwaggerBasePathRewritingFilterTest.<init>:20 » Unresolved compilation problem...
AccountResourceTest.setup:33 » NoClassDefFound HttpServletRequest
AccountResourceTest.setup:33 » NoClassDefFound HttpServletRequest
AccountResourceTest.setup:33 » NoClassDefFound HttpServletRequest
AccountResourceTest.setup:33 » NoClassDefFound HttpServletRequest
UserJWTControllerTest.setup:39 » NoClassDefFound HttpServletResponse
UserJWTControllerTest.setup:39 » NoClassDefFound HttpServletResponse
UserJWTControllerTest.setup:39 » NoClassDefFound HttpServletResponse
ExceptionTranslatorTest.setup:37 » NoClassDefFound HttpServletRequest
ExceptionTranslatorTest.setup:37 » NoClassDefFound HttpServletRequest
ExceptionTranslatorTest.setup:37 » NoClassDefFound HttpServletRequest
ExceptionTranslatorTest.setup:37 » NoClassDefFound HttpServletRequest
ExceptionTranslatorTest.setup:37 » NoClassDefFound HttpServletRequest
If I skip tests, build is ok, but I got same error when I launch :
./mvnw -Pdev
2018-02-16 17:52:22.011 WARN 5354 --- [ restartedMain] ationConfigEmbeddedWebApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.context.ApplicationContextException: Unable to start embedded container; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'undertowEmbeddedServletContainerFactory' defined in class path resource [org/springframework/boot/autoconfigure/web/EmbeddedServletContainerAutoConfiguration$EmbeddedUndertow.class]: Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'webConfigurer' defined in file [/home/denis/ngworkspace/jhipster-registry/target/classes/io/github/jhipster/registry/config/WebConfigurer.class]: Bean instantiation via constructor failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [io.github.jhipster.registry.config.WebConfigurer$$EnhancerBySpringCGLIB$$a8d0938a]: Constructor threw exception; nested exception is java.lang.Error: Unresolved compilation problems:
The import io.undertow.UndertowOptions cannot be resolved
ServletContext cannot be resolved to a type
ServletException cannot be resolved to a type
DispatcherType cannot be resolved to a type
DispatcherType cannot be resolved to a variable
DispatcherType cannot be resolved to a variable
DispatcherType cannot be resolved to a variable
The type io.undertow.Undertow$Builder cannot be resolved. It is indirectly referenced from required .class files
This lambda expression refers to the missing type Undertow$Builder
UndertowOptions cannot be resolved to a variable
ServletContext cannot be resolved to a type
DispatcherType cannot be resolved to a type
FilterRegistration cannot be resolved to a type
ServletContext cannot be resolved to a type
DispatcherType cannot be resolved to a type
FilterRegistration cannot be resolved to a type
ServletRegistration cannot be resolved to a type
2018-02-16 17:52:22.032 ERROR 5354 --- [ restartedMain] o.s.boot.SpringApplication : Application startup failed
org.springframework.context.ApplicationContextException: Unable to start embedded container; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'undertowEmbeddedServletContainerFactory' defined in class path resource [org/springframework/boot/autoconfigure/web/EmbeddedServletContainerAutoConfiguration$EmbeddedUndertow.class]: Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'webConfigurer' defined in file [/home/denis/ngworkspace/jhipster-registry/target/classes/io/github/jhipster/registry/config/WebConfigurer.class]: Bean instantiation via constructor failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [io.github.jhipster.registry.config.WebConfigurer$$EnhancerBySpringCGLIB$$a8d0938a]: Constructor threw exception; nested exception is java.lang.Error: Unresolved compilation problems:
The import io.undertow.UndertowOptions cannot be resolved
ServletContext cannot be resolved to a type
ServletException cannot be resolved to a type
...
Strangely, when I execute
mvn clean package -Pprod
build is ok, but it does not launch (same error).
I use registry in version 3.2.4, cloned from github, on Linux.
How build registry without error ? Do I forget something ?
Thanks, Denis
I found the solution. I added these dependencies in pom.xml :
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-undertow</artifactId>
<scope>provided</scope>
</dependency>
and all work. These dependencies were nevertheless obtained transitively, and I don't known why I have to add explicitly. Anybody has the response ?
Denis
If you were running with Eclipse:
in Eclipse select Project Properties->Maven->Active Maven Profiles (comma separated), and make it dev
That triggers a maven update of the project and everything compiles
No need to put dependencies in the pom
Do that is work
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-undertow</artifactId>
<scope>provided</scope>
</dependency>
#Atatorus

Error when using serve modules without publishing in eclipse

I am getting this error when "serve modules without publishing" is checked in the application server (Tomcat) inside eclipse
When its not checked - the application is running with no issue,
The problem is that every change I make eclipse will deploy and restart tomcat,
Do I need to do anything else besides checking "serve modules without publishing"?
HTTP Status 500 - The absolute uri: http://java.sun.com/jsp/jstl/core cannot be resolved in either web.xml or the jar files deployed with this application
type Exception report
message The absolute uri: http://java.sun.com/jsp/jstl/core cannot be resolved in either web.xml or the jar files deployed with this application
description The server encountered an internal error that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException: The absolute uri: http://java.sun.com/jsp/jstl/core cannot be resolved in either web.xml or the jar files deployed with this application
org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:56)
org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:278)
org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:76)
org.apache.jasper.compiler.TagLibraryInfoImpl.generateTldResourcePath(TagLibraryInfoImpl.java:242)
org.apache.jasper.compiler.TagLibraryInfoImpl.<init>(TagLibraryInfoImpl.java:124)
org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:411)
org.apache.jasper.compiler.Parser.parseDirective(Parser.java:469)
org.apache.jasper.compiler.Parser.parseElements(Parser.java:1430)
org.apache.jasper.compiler.Parser.parse(Parser.java:139)
org.apache.jasper.compiler.ParserController.doParse(ParserController.java:227)
org.apache.jasper.compiler.ParserController.parse(ParserController.java:100)
org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:199)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:356)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:336)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:323)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:564)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:357)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:396)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:340)
javax.servlet.http.HttpServlet.service(HttpServlet.java:725)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
org.springframework.web.servlet.view.InternalResourceView.renderMergedOutputModel(InternalResourceView.java:209)
org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:267)
org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1221)
org.springframework.web.servlet.DispatcherServlet.processDispatchResult(DispatcherServlet.java:1005)
org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:952)
org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:870)
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:961)
org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:852)
javax.servlet.http.HttpServlet.service(HttpServlet.java:618)
org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:837)
javax.servlet.http.HttpServlet.service(HttpServlet.java:725)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
com.xerox.infrastructure.filters.LoginInterceptor.doFilter(LoginInterceptor.java:58)
org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
note The full stack trace of the root cause is available in the Apache Tomcat/8.0.15 logs.

Importing External JAR to Websphere Liberty? [NoClassDefFoundError]

I want to use this JSON parser in my JAX-RS application that runs on Websphere Liberty.
I have done the following:
1) Right-click on Project -> Properties -> Java Build Path -> Add External Jar -> C:\javalib\quick-json.jar
2) Added C:\javalib to enviroment variable CLASSPATH
3) Added fileset xml to serverl.xml
<library id="ExternalLibs">
<fileset dir="C:\javalib" includes="*.jar"/>
</library>
4) Unchecked 'Enable project specific settings' in 'Java Compiler'
5) Cleaned the Project
[EDIT]
I was initially creating a new instance and then I turned it into an #ApplicationScoped bean and injected it. Now I get this error:
The JNDI lookup failed for JNDI name java:module/ConsoleREST with the following Exception CNTR4007E: An error occurred creating the websphere.jaxrs.service.ConsoleREST interface for the ConsoleREST enterprise bean in the WebApiConsole.war module in the WebApiConsole application. The enterprise bean look up failed using the java:module/ConsoleREST JNDI name. Exception: com/json/parsers/JsonParserFactory.
CNTR4007E: An error occurred creating the websphere.jaxrs.service.ConsoleREST interface for the ConsoleREST enterprise bean in the WebApiConsole.war module in the WebApiConsole application. The enterprise bean look up failed using the java:module/ConsoleREST JNDI name. Exception: com/json/parsers/JsonParserFactory
The first step was enough to get it to compile. Now I'm getting what I learned to be a runtime error. I would appreciate help!
You also need a <classloader> element in your application definition in the server.xml, which references the shared library. For example,
<application id="myapp" name="My App" type="war" location="somewhere.war">
<classloader commonLibraryRef="ExternalLibs" />
</application>
Alternatively, if your application is the only user of the library, you could package it in the WEB-INF/lib folder of your war. (Putting it in WebContent/lib in Eclipse should accomplish this.)

Unable to run spring struts maven project on WebLogic 10.3.3 using Eclipse

If I build this project to war and deploy it on WebLogic, it works well, but if I run on server using Eclipse, i got this error:
Caused By: Bean type class com.opensymphony.xwork2.ObjectFactory
with the name xwork has already been loaded by bean -
zip:D:/Documents%20and%20Settings/admini/.m2/repository/org/apache/struts/struts2-core/2.3.12/struts2-core-2.3.12.jar!/struts-default.xml:29:72 - bean -
zip:H:/runtime/weblogic1033/user_projects/domains/crmFrameworkDomain/servers/AdminServer/tmp/_WL_user/_auto_generated_ear_/nefp93/war/WEB-INF/lib/struts2-core-2.3.12.jar!/struts-default.xml:29:72
stackTrace
<2013/4/20 下午06時59分34秒 CST> <Error> <HTTP> <BEA-101165> <Could not load user defined filter in web.xml: org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.
Unable to load configuration. - bean - zip:H:/runtime/weblogic1033/user_projects/domains/crmFrameworkDomain/servers/AdminServer/tmp/_WL_user/_auto_generated_ear_/nefp93/war/WEB-INF/lib/struts2-core-2.3.12.jar!/struts-default.xml:29:72
at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:485)
at org.apache.struts2.dispatcher.ng.InitOperations.initDispatcher(InitOperations.java:74)
at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.init(StrutsPrepareAndExecuteFilter.java:51)
at weblogic.servlet.internal.FilterManager$FilterInitAction.run(FilterManager.java:332)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
Truncated. see log file for complete stacktrace
Caused By: Unable to load configuration. - bean - zip:H:/runtime/weblogic1033/user_projects/domains/crmFrameworkDomain/servers/AdminServer/tmp/_WL_user/_auto_generated_ear_/nefp93/war/WEB-INF/lib/struts2-core-2.3.12.jar!/struts-default.xml:29:72
at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:70)
at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:429)
at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:473)
at org.apache.struts2.dispatcher.ng.InitOperations.initDispatcher(InitOperations.java:74)
at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.init(StrutsPrepareAndExecuteFilter.java:51)
Truncated. see log file for complete stacktrace
Caused By: Unable to load bean: type: class:com.opensymphony.xwork2.ObjectFactory - bean - zip:H:/runtime/weblogic1033/user_projects/domains/crmFrameworkDomain/servers/AdminServer/tmp/_WL_user/_auto_generated_ear_/nefp93/war/WEB-INF/lib/struts2-core-2.3.12.jar!/struts-default.xml:29:72
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.register(XmlConfigurationProvider.java:245)
at org.apache.struts2.config.StrutsXmlConfigurationProvider.register(StrutsXmlConfigurationProvider.java:102)
at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:226)
at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:67)
at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:429)
Truncated. see log file for complete stacktrace
Caused By: Bean type class com.opensymphony.xwork2.ObjectFactory with the name xwork has already been loaded by bean - zip:D:/Documents%20and%20Settings/admini/.m2/repository/org/apache/struts/struts2-core/2.3.12/struts2-core-2.3.12.jar!/struts-default.xml:29:72 - bean - zip:H:/runtime/weblogic1033/user_projects/domains/crmFrameworkDomain/servers/AdminServer/tmp/_WL_user/_auto_generated_ear_/nefp93/war/WEB-INF/lib/struts2-core-2.3.12.jar!/struts-default.xml:29:72
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.register(XmlConfigurationProvider.java:229)
at org.apache.struts2.config.StrutsXmlConfigurationProvider.register(StrutsXmlConfigurationProvider.java:102)
at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:226)
at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:67)
at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:429)
Truncated. see log file for complete stacktrace
I don't know why there's another struts2-core.2.3.12.jar in _auto_generated_ear
Is there any configuration of plugins should i change?
weblogic 10.3.3
jdk 1.6
eclipse juno
maven 3.0.5
and here is my eclipse project archive:
Loki.zip
I also faced the same issue.
In my case the one or more action classes configured in the struts.xml not defined on the package.
Once i defined the missing classes it worked fine.
please ensure all the action classes configured in struts.xml were defined in correct location.
struts.xml
<action name="welcome" class="com.vk.translate.action.DummyAction">
<result name="success">/login.jsp</result>
</action>
DummyAction is not defined in above code.
Once i defined it worked.