How to identify the missing JBoss EAP module - jboss6.x

I have a module that lists as dependencies,
--dependencies=javax.servlet.api,javax.security.jacc.api,org.jboss.logging,org.picketbox,org.picketlink.federation,org.picketlink.federation.bindings,org.jboss.as.web
but eap complains about a missing class,
Caused by: java.lang.ClassNotFoundException:
javax.servlet.http.HttpServletResponse from [Module
"com.td.cbaw.oauthlogin:main" from local module loader #16f65612
(finder: local module finder #311d617d (roots:
/opt/jboss/EAP-6.4.0/modules,/opt/jboss/EAP-6.4.0/modules/system/layers/base))]
The javax.servlet.api module contains the class in question
...
81 javax/servlet/http/HttpServlet.class
82 javax/servlet/http/LocalStrings_es.properties
83 javax/servlet/http/HttpSessionContext.class
84 javax/servlet/http/NoBodyOutputStream.class
85 javax/servlet/http/HttpServletResponse.class <====
86 javax/servlet/http/HttpUtils.class
87 javax/servlet/http/HttpSessionListener.class
88 javax/servlet/http/HttpSessionActivationListener.class
....
How does one root cause this kind of problem?
This is the sum total of information I have found on the subject, Find_the_JBoss_Module_Dependency, essentially useless docs.
Thanks.

Looking at logs seems you are missing jboss-servlet-api_3.0 JBoss module. To fix that, follow below steps:
Step 1: Create directory javax/servlet/api/main, as EAP-6.4.0/modules/system/layers/base/javax/servlet/api/main
Step 2: Create module.xml inside the directory created with below content:
EAP-6.4.0/modules/system/layers/base/javax/servlet/api/main/module.xml
<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="urn:jboss:module:1.1" name="javax.servlet.api">
<resources>
<resource-root path="jboss-servlet-api_3.0_spec-1.0.2.Final-redhat-2.jar"/>
<!-- Insert resources here -->
</resources>
</module>
Step 3: Download jboss-servlet-api_3.0_spec-1.0.2.Final-redhat-2 from https://mvnrepository.com/artifact/org.jboss.spec.javax.servlet/jboss-servlet-api_3.0_spec and put it inside EAP-6.4.0/modules/system/layers/base/javax/servlet/api/main directory and restart the server.

Solved the problem: ID10T error. My preprocessor of the cli file was not replacing the actual cli file that was being sent to jboss. I forgot to force copy the template over the cli. The template I'm using has ${} variables to be substituted, which I am forced to due with sed, because the jboss-cli parser does not perform variable substution on the "module" command. So, my hack around a bug in jboss-cli was the root cause.

Related

module named 'app' already exists on Android Studio

I did something wrong and I don't know what I did. But the module name has been changed to my-android-app.
And I am trying to get it back to app. The default name of single module.
I tried Rename Module. But I get.
in the drop down menu of build, there are my-android-app and app. But I just have one build.gradle of module from my-android-app.
In the project structure. I just have my-android-app. Nothing to delete.
How can I fix this problem?
You need to rename *.iml file(IntelliJ IDEA Module). This is the name of module. This file describes about the module.
Edit configuration if you see two.
Delete all except for app. And change Name to app if its name is different.
.idea >your-app.iml`
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/app/your-app.iml" filepath="$PROJECT_DIR$/app/your-app.iml" />
<module fileurl="file://$PROJECT_DIR$/app/app.iml" filepath="$PROJECT_DIR$/app/app.iml" />
</modules>
</component>
</project>
Delete one of them. (Maybe your-app.iml module tags.) Or if the location is incorrect then fix it.
File > Invalidate Caches & Restart.
Clean Build.

Could not read log4j.properties

We are having a module which contains log4j.properties and other files in it. And there is a separate module which is dependent on the 1st module(Realign). So we had made the 1st module as a jar file and placed it in the WEB-INF/lib folder of the second module(Reasign). We are running the modules in Liberty server. But still we are getting the File Not found exception as below,
log4j:ERROR Could not read configuration file
[file:/metlife/runtime/installed/wlp/usr/servers/bobr/apps/expanded/bobr.ear/BOBReassignmentWeb.war/WEB-INF/lib/Realignment.jar!/r_resources/log4j.properties].
[9/12/18 8:28:51:591 EDT] 000002de SystemErr R java.io.FileNotFoundException:
file:/metlife/runtime/installed/wlp/usr/servers/bobr/apps/expanded/bobr.ear/BOBReassignmentWeb.war/WEB-INF/lib/Realignment.jar!/r_resources/log4j.properties (No such file or directory)
It looks like your PropertiesConfigurator class is taking a file path (as a String). If you used a URL instead, I think that would work - that way, you would get a JAR URL which includes the path to the JAR (or WAR, EAR, etc.) archive and the path inside the JAR. If you have control over the PropertiesConfigurator code, then I would recommend changing it so that it loads the file via URL.
If that is not an option, then you could extract the properties files and put them on the file system directly. For example, you could create a directory in your server directory (for an example, we'll call it log4jProps). Then you could create a shared library in your server config (server.xml) like this:
<library id="log4j.props">
<fileset dir="${server.config.dir}/log4jProps" includes="r_resources/*properties"/>
</library>
then update your application configuration to use this library as a common shared library:
<application id="myApp" name="myApp" location="myApp.war"...>
<classloader commonLibraryRef ="log4j.props" />
</application>
For good measure, you should probably remove the properties file from your application archives - that way they won't be loaded from there, and then throw off the PropertiesConfigurator like it is now.
Hope this helps,
Andy

Jhipster generated code after the error, Mapper could not be found

2016-10-20 18:03:51.253 WARN 17216 --- [ restartedMain] .s.c.a.CommonAnnotationBeanPostProcessor : Invocation of destroy method failed on bean with name 'cacheConfiguration': java.lang.NullPointerException
2016-10-20 18:03:51.274 WARN 17216 --- [ restartedMain] o.s.boot.SpringApplication : Error handling failed (Error creating bean with name 'delegatingApplicationListener' defined in class path resource [org/springframework/security/config/annotation/web/configuration/WebSecurityConfiguration.class]: BeanPostProcessor before instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.cache.annotation.ProxyCachingConfiguration': Initialization of bean failed; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'org.springframework.context.annotation.ConfigurationClassPostProcessor.importRegistry' is defined)
2016-10-20 18:03:51.749 ERROR 17216 --- [ restartedMain] o.s.b.d.LoggingFailureAnalysisReporter :
APPLICATION FAILED TO START
Description:
Field countryMapper in com.bosheng.java.service.impl.CountryServiceImpl required a bean of type 'com.bosheng.java.service.mapper.CountryMapper' that could not be found.
Action:
Consider defining a bean of type 'com.bosheng.java.service.mapper.CountryMapper' in your configuration.
If you are using IDEA and Maven, you need to activate the IDE profile in IntelliJ. This is used for applying IDE-specific tweaks which currently only includes applying the MapStruct annotation processor.
Open the “Maven Projects” tool window (View -> Tool Windows), check the IDE maven profile to activate it
I had a similar problem, but using Maven and Eclipse. At the end I realized that I hadn't read well the bottom of the "Configuring your IDE" page from jHipster docs, which says about MapStruct, but I also had to add the target/generated-sources folder to my build path (as instructed on http://g00glen00b.be/mapstruct/ ).
I have tried all the above solutions and followed the jHipster IDE configuration and my problem still not fixed.
That's what solved my problem:
mvnw clean
mvnw compile
For Gradle:
gradlew clean
gradlew compileJava
then refresh the project in the IDE and run it.
I had this issue and it was only an issue with my pom.xml. I needed to add mapstruct to the maven compiler plugin like so:
...
<properties>
<mapstruct.version>1.1.0.Final</mapstruct.version>
<maven-compiler-plugin.version>3.6.0</maven-compiler-plugin.version>
</properties>
...
<dependencies>
<dependency>
<groupId>org.mapstruct</groupId>
<artifactId>mapstruct-jdk8</artifactId>
<version>${mapstruct.version}</version>
</dependency>
</dependencies>
...
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>${maven-compiler-plugin.version}</version>
<configuration>
<annotationProcessorPaths>
<path>
<groupId>org.mapstruct</groupId>
<artifactId>mapstruct-processor</artifactId>
<version>${mapstruct.version}</version>
</path>
</annotationProcessorPaths>
</configuration>
</plugin>
</plugins>
Please, next time, add the command line you use to build / launch your app and use code format, in order to have a good format for your question. ;o)
So, according to this log, I suggest you to use IDE and dev maven profil.
I am quite sure you don't use it, so mapstruct have the interface for bean but not generated the implementation classes.

Publish on TFS does not find the pubxml file for Node.js test project

I created a Node.js project for an protractor test environment using the Node.js Tools to test a web application on a team foundation server. The test project and the web application are in one solution file. However, if i want to deploy the Node.js project on the tfs, it is not able to find the pubxml file located in the web application project.
Error log:
12>CoreCompile:
Creating directory "bin".
Copying file from "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\Node.js Tools\Microsoft.NodejsTools.WebRole.dll" to "bin\Microsoft.NodejsTools.WebRole.dll".
ValidatePublishProfileSettings:
Validating PublishProfile(TestProfile) settings.
12>C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\Web\Microsoft.Web.Publishing.targets(4364,5): error : The value for PublishProfile is set to 'TestProfile', expected to find the file at '<PATH>\TestProject.Web.Protractor.Tests\__profiles\TestProfile.pubxml' but it could not be found. [<PATH>\TestProject.Web.Protractor.Tests.njsproj]
12>C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\Web\Microsoft.Web.Publishing.targets(4371,4): error : PublishProfile(TestProfile) is set. But the $(WebPublishMethod) does not have a valid value. Current Value is "". [<PATH>\TestProject.Web.Protractor.Tests.njsproj]
12>Done Building Project "<PATH>\TestProject.Web.Protractor.Tests.njsproj" (default targets) -- FAILED.
After analyzing the Microsoft.Web.Publishing.targets i found the PublishProfileRootFolder variable to change the search path for the pubxml file.
First i tried to place the variable inside the MSBuild arguments. However, this raised problems with other test projects and i was not able to use variables like the $(SolutionDir).
I ended trying to use the PublishProfileRootFolder variable inside the project file and this works now:
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
<PropertyGroup>
...
<PublishProfileRootFolder>$(SolutionDir)PathToWebApplication\Properties\PublishProfiles</PublishProfileRootFolder>
</PropertyGroup>
...
PS: Additionally you need a Web.config file, placed in the project root of the test project:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.web>
<customErrors mode="on"/>
<compilation debug="true"/>
</system.web>
</configuration>

Problem with Weblogic Upgrade

I'm currently in the process of upgrading my WebLogic version from 10.0 to 10.3.3.
I did manage to successfully create a new 10.3 domain, but when I try to start it, I get the following error:
<Critical> <WebLogicServer> <BEA-000362> <Server failed. Reason:
[Management:141266]Parsing Failure in config.xml: failed to load java
type corresponding to e=domain#http://xmlns.oracle.com/weblogic/domain>
Regardless to say, the server doesn't start.
I looked at my config.xml file and it looks harmless, the first few lines of it are as follows:
<?xml version="1.0" encoding="UTF-8"?>
<domain xsi:schemaLocation="http://xmlns.oracle.com/weblogic/security/wls http://xmlns.oracle.com/weblogic/security/wls/1.0/wls.xsd http://xmlns.oracle.com/weblogic/domain http://xmlns.oracle.com/weblogic/1.0/domain.xsd http://xmlns.oracle.com/weblogic/security http://xmlns.oracle.com/weblogic/1.0/security.xsd http://xmlns.oracle.com/weblogic/security/xacml http://xmlns.oracle.com/weblogic/security/xacml/1.0/xacml.xsd" xmlns="http://xmlns.oracle.com/weblogic/domain" xmlns:sec="http://xmlns.oracle.com/weblogic/security" xmlns:wls="http://xmlns.oracle.com/weblogic/security/wls" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
There is a namespace entry for the namespace given in the error message (default namespace - xmlns), but I don't have a clue why the config file can't be parsed.
Thanks in Advance
A similar issue here turned out to be a permissions problem for the user starting weblogic.
Have you installed the new Weblogic server instance with a different user id? Can you check permissions?

Resources