Nullpointer on standalone .jar org.apache.cxf.wsdl11.WSDLServiceFactory - cxf

I have a grpc's micronaut project and I have a gradle task to generate java classes from a wsdl.
The build is success but when I launch the grpc server and call a method that uses one of the generated classes I get the following error:
Caused by: java.lang.NullPointerException: null
at org.apache.cxf.wsdl11.WSDLServiceFactory.<init>(WSDLServiceFactory.java:85)
at org.apache.cxf.jaxws.ServiceImpl.initializePorts(ServiceImpl.java:218)
at org.apache.cxf.jaxws.ServiceImpl.initialize(ServiceImpl.java:161)
at org.apache.cxf.jaxws.ServiceImpl.<init>(ServiceImpl.java:129)
at org.apache.cxf.jaxws.spi.ProviderImpl.createServiceDelegate(ProviderImpl.java:99)
at javax.xml.ws.Service.<init>(Service.java:77)
Here is my build.gradle
plugins {
id "io.spring.dependency-management" version "1.0.6.RELEASE"
id "com.google.protobuf" version "0.8.5"
id "java"
id "net.ltgt.apt-eclipse" version "0.21"
id "net.ltgt.apt-idea" version "0.21"
id "com.github.johnrengelman.shadow" version "4.0.2"
id "application"
id "no.nils.wsdl2java" version "0.10"
id "net.ltgt.apt" version "0.8"
id "groovy"
id "jacoco"
}
version "1.0.0"
group "com.myproject"
repositories {
mavenCentral()
maven { url "https://jcenter.bintray.com" }
}
dependencyManagement {
imports {
mavenBom 'io.micronaut:micronaut-bom:1.1.4'
}
}
configurations {
// for dependencies that are needed for development only
developmentOnly
}
dependencies {
compileOnly 'org.projectlombok:lombok:1.18.2'
annotationProcessor "org.projectlombok:lombok:1.18.2"
annotationProcessor "io.micronaut:micronaut-inject-java"
annotationProcessor "io.micronaut:micronaut-validation"
compile "io.micronaut.grpc:micronaut-grpc-runtime"
compile "io.micronaut:micronaut-inject"
compile "io.micronaut:micronaut-validation"
compile "io.micronaut:micronaut-runtime"
runtime "ch.qos.logback:logback-classic:1.2.3"
compile "org.mapstruct:mapstruct:1.3.0.Final"
annotationProcessor "org.mapstruct:mapstruct-processor:1.3.0.Final"
compile group: 'org.apache.cxf', name: 'cxf-rt-bindings-soap', version: '3.3.2'
compile group: 'org.apache.cxf', name: 'cxf-rt-frontend-jaxws', version: '3.0.2'
compile group: 'org.apache.cxf', name: 'cxf-rt-transports-http', version: '3.3.2'
compile group: 'org.apache.cxf', name: 'cxf-rt-ws-security', version: '3.1.11'
testCompileOnly platform("io.micronaut:micronaut-bom:$micronautVersion")
testImplementation("org.spockframework:spock-core") {
exclude group: "org.codehaus.groovy", module: "groovy-all"
}
testImplementation "io.micronaut:micronaut-inject-groovy"
testImplementation "io.micronaut.test:micronaut-test-spock"
testImplementation "io.micronaut.test:micronaut-test-junit5"
testRuntimeOnly "org.junit.vintage:junit-vintage-engine:5.5.0"
}
test.classpath += configurations.developmentOnly
mainClassName = "com.myproject.Application"
ext {
protocVersion="3.5.1"
grpcVersion="1.18.0"
}
sourceSets {
main {
java {
srcDirs 'build/generated/source/proto/main/grpc'
srcDirs 'build/generated/source/proto/main/java'
}
}
}
protobuf {
protoc { artifact = "com.google.protobuf:protoc:${protocVersion}" }
plugins {
grpc { artifact = "io.grpc:protoc-gen-grpc-java:${grpcVersion}" }
}
generateProtoTasks {
all()*.plugins { grpc {} }
}
}
// use JUnit 5 platform
test {
useJUnitPlatform()
}
tasks.withType(JavaCompile){
options.encoding = "UTF-8"
options.compilerArgs.add('-parameters')
}
shadowJar {
mergeServiceFiles()
}
wsdl2java{
wsdlsToGenerate = [
['-exsh', 'true','-p','com.myproject',
'-autoNameResolution',
"-b", "$projectDir/src/main/resources/wsdl/bindings.xml",
"$projectDir/src/main/resources/wsdl/v1_1.wsdl"]
]
wsdlDir = file("$projectDir/src/main/resources/wsdl")
locale = Locale.getDefault()
}
wsdl2javaExt {
cxfVersion = "3.3.2"
}
run.classpath += configurations.developmentOnly
run.jvmArgs('-noverify', '-XX:TieredStopAtLevel=1', '-Dcom.sun.management.jmxremote')
tasks.withType(JavaCompile){
options.encoding = "UTF-8"
options.compilerArgs.add('-parameters')
}
jacocoTestReport {
reports {
html {
enabled true
}
}
afterEvaluate {
classDirectories.from = files(classDirectories.files.collect {
fileTree(dir: it, exclude: ['**/Application*',
'com/myproject/**'])
})
}
}
task buildWithCoverage {
dependsOn 'clean'
dependsOn 'cleanTest'
dependsOn 'test'
dependsOn 'jacocoTestReport'
tasks.findByName('cleanTest').mustRunAfter 'clean'
tasks.findByName('test').mustRunAfter 'cleanTest'
tasks.findByName('jacocoTestReport').mustRunAfter 'test'
}
Any help?

Related

React/Vite Build Error causing a Reducer to be wrongly exported

Hi I'm having a very weird error during build process of a React application with Vite.
When I run Vite as a dev server on local machine it works well, but during the build process there is an error on the resultant code.
The problem is actually with one reducer, which is not being exported as it should be, causing an error on the components that depends on that slice.
This is the generated source relating to the reducer causing issues:
var m = (0,
e.createSlice)({
name: "form",
initialState: {
list: {}
},
reducers: {
generateForm: function(q, j) {
var L = j.payload
, K = L.id
, U = L.fields
, W = L.values
, X = L.baseUrl
, ae = (0,
t.normalizeFields)(U);
q.list[K] = {
fields: ae,
values: W || null,
baseUrl: X || null
}
}
}
}
});
de.formSlice = m;
var E = m.actions,
h = E.generateForm;
de.generateForm = h;
var V = m.reducer;
return de.default = V,
de
While all other reducers work as intended, and build correctly, they look like this one for example:
var Wc = (0,
HE.createSlice)({
name: "datatable",
initialState: {
list: {}
},
reducers: {
clear: function(r, t) {
var n = t.payload.id;
delete r.list[n]
}
}
});
St.clear= Wc;
var Ml = Wc.actions
, GE = Ml.clear;
var sh = St.clear = GE
, XE = Wc.reducer
, ch = St.default = XE
, xt = {}
, Il = {};
Notice that the reducer that is failing is somehow returning both the entire slice object and the default export, while all other reducers simply assign the reducer to the default export.
The weird thing is that if I go with react-scripts all builds correctly, but I'd like to know why and If I'm missing a plugin or something.
My vite config looks like this:
export default defineConfig(({ mode }) => {
process.env = {
...process.env,
...process.env.development,
...loadEnv(mode, process.cwd())
};
return {
base: process.env.VITE_APP_BASENAME,
server: {
port: 3000
},
plugins: [
react({
babel: {
babelrc: true,
parserOpts: {
plugins: ["decorators-legacy"]
}
}
}),
EnvironmentPlugin("all", { prefix: "REACT_APP_" }),
istanbul({
include: ["src"],
exclude: ["node_modules", "test/", "cypress/"],
extension: [".js", ".jsx"]
})
],
build: {
rollupOptions: {
output: {
manualChunks: {
"react-venders": ["react", "react-dom"]
}
},
external: ["#vitjs/runtime"]
},
chunkSizeWarningLimit: 700
}
};
});
My .babelrc config is the following:
{
"presets": ["#babel/react"]
}
Also is pretty rare that in local serve mode (npm start) which runs Vite it does works well. It only fails during build process, and specifically on that Reducer (form).
Appreciate any help! Thanks

Grails 3.3.9 No Session found for current thread

I'm using grails 3.3.9 with a sql server db. I'm using default scaffold-ed code for my domain class. When I hit the index page, I get the No Session found for current thread error. For using the default scaffold-ed code, I'm a bit stumped as to why this is happening. In Grails 2.x once I scaffold the app just works. Anyway here is my code and hopefully someone can shed some light on what I don't obviously know:
application.yml
hibernate:
cache:
queries: false
use_second_level_cache: false
use_query_cache: false
dataSource:
pooled: true
jmxExport: true
driverClassName: org.h2.Driver
username: sa
password: ''
environments:
development:
dataSource:
dbCreate: create-drop
url: jdbc:h2:mem:devDb;MVCC=TRUE;LOCK_TIMEOUT=10000;DB_CLOSE_ON_EXIT=FALSE
dataSources:
tst:
dbCreate: update
url: jdbc:sqlserver://TESTSERVER;databaseName=Technician;useNTLMv2=true
driverClassName: com.microsoft.sqlserver.jdbc.SQLServerDriver
dialect: org.hibernate.dialect.SQLServer2012Dialect
pooled: true
username: user
password: 'pass'
formatSql: true
logSql: true
test:
dataSource:
dbCreate: update
url: jdbc:h2:mem:testDb;MVCC=TRUE;LOCK_TIMEOUT=10000;DB_CLOSE_ON_EXIT=FALSE
production:
dataSource:
dbCreate: none
url: jdbc:h2:./prodDb;MVCC=TRUE;LOCK_TIMEOUT=10000;DB_CLOSE_ON_EXIT=FALSE
properties:
jmxEnabled: true
initialSize: 5
maxActive: 50
minIdle: 5
maxIdle: 25
maxWait: 10000
maxAge: 600000
timeBetweenEvictionRunsMillis: 5000
minEvictableIdleTimeMillis: 60000
validationQuery: SELECT 1
validationQueryTimeout: 3
validationInterval: 15000
testOnBorrow: true
testWhileIdle: true
testOnReturn: false
jdbcInterceptors: ConnectionState
defaultTransactionIsolation: 2 # TRANSACTION_READ_COMMITTED
build.gradle
buildscript {
repositories {
mavenLocal()
maven { url "https://repo.grails.org/grails/core" }
}
dependencies {
classpath "org.grails:grails-gradle-plugin:$grailsVersion"
classpath "org.grails.plugins:hibernate5:${gormVersion-".RELEASE"}"
classpath "com.bertramlabs.plugins:asset-pipeline-gradle:2.15.1"
}
}
version "0.1"
group "tstsupport"
apply plugin:"eclipse"
apply plugin:"idea"
apply plugin:"war"
apply plugin:"org.grails.grails-web"
apply plugin:"asset-pipeline"
apply plugin:"org.grails.grails-gsp"
repositories {
mavenLocal()
maven { url "https://repo.grails.org/grails/core" }
}
dependencies {
compile "org.springframework.boot:spring-boot-starter-logging"
compile "org.springframework.boot:spring-boot-autoconfigure"
compile "org.grails:grails-core"
compile "org.springframework.boot:spring-boot-starter-actuator"
compile "org.springframework.boot:spring-boot-starter-tomcat"
compile "org.grails:grails-web-boot"
compile "org.grails:grails-logging"
compile "org.grails:grails-plugin-rest"
compile "org.grails:grails-plugin-databinding"
compile "org.grails:grails-plugin-i18n"
compile "org.grails:grails-plugin-services"
compile "org.grails:grails-plugin-url-mappings"
compile "org.grails:grails-plugin-interceptors"
compile "org.grails.plugins:cache"
compile "org.grails.plugins:async"
compile "org.grails.plugins:scaffolding"
compile "org.grails.plugins:events"
compile "org.grails.plugins:hibernate5"
compile "org.hibernate:hibernate-core:5.1.16.Final"
compile "org.grails.plugins:gsp"
console "org.grails:grails-console"
profile "org.grails.profiles:web"
runtime "org.glassfish.web:el-impl:2.1.2-b03"
runtime "com.h2database:h2"
runtime "org.apache.tomcat:tomcat-jdbc"
runtime "com.bertramlabs.plugins:asset-pipeline-grails:2.15.1"
runtime "com.microsoft.sqlserver:mssql-jdbc:7.2.1.jre8"
testCompile "org.grails:grails-gorm-testing-support"
testCompile "org.grails.plugins:geb"
testCompile "org.grails:grails-web-testing-support"
testRuntime "org.seleniumhq.selenium:selenium-htmlunit-driver:2.47.1"
testRuntime "net.sourceforge.htmlunit:htmlunit:2.18"
}
bootRun {
jvmArgs('-Dspring.output.ansi.enabled=always')
addResources = true
String springProfilesActive = 'spring.profiles.active'
systemProperty springProfilesActive, System.getProperty(springProfilesActive)
}
assets {
minifyJs = true
minifyCss = true
}
Domain class: TST_Customer.groovy
package TSTSupport
class TST_Technician {
String techCode
String techName
boolean tec990Flag
boolean tecCCFlag
Date tecCreateDate
String tecCreatedBy
Date tecModifyDate
String tecModifiedBy
boolean tecActiveFlag
static constraints = {
techCode shared: "techCode"
techName blank: false, maxSize: 75
tecCreatedBy blank: false, maxSize: 35
tecModifyDate nullable: true
tecModifiedBy blank: false, maxSize: 35
}
static mapping = {
datasource "tst"
table name: "lkp_Technician", schema: "dbo", catalog: "Technician"
version false
id generator: 'assigned', name: 'techCode', type: 'string'
techCode column: '[TechnicianCode]'
techName column: '[TechnicianName]'
tec990Flag column: '[Tech990Flag]'
tecCCFlag column: '[TechCCFlag]'
tecCreateDate column: '[TechCreateDate]'
tecCreatedBy column: '[TechCreatedBy]'
tecModifyDate column: '[TechModifyDate]'
tecModifiedBy column: '[TechModifiedBy]'
tecActiveFlag column: '[TechActiveFlag]'
}
}
Controller
package TSTSupport
import grails.validation.ValidationException
import static org.springframework.http.HttpStatus.*
class TST_CustomerController {
TST_CustomerService TST_CustomerService
static allowedMethods = [save: "POST", update: "PUT", delete: "DELETE"]
def index(Integer max) {
params.max = Math.min(max ?: 10, 100)
respond TST_CustomerService.list(params), model:[TST_CustomerCount: TST_CustomerService.count()]
}
def show(Long id) {
respond TST_CustomerService.get(id)
}
def create() {
respond new TST_Customer(params)
}
def save(TST_Customer TST_Customer) {
if (TST_Customer == null) {
notFound()
return
}
try {
TST_CustomerService.save(TST_Customer)
} catch (ValidationException e) {
respond TST_Customer.errors, view:'create'
return
}
request.withFormat {
form multipartForm {
flash.message = message(code: 'default.created.message', args: [message(code: 'TST_Customer.label', default: 'TST_Customer'), TST_Customer.id])
redirect TST_Customer
}
'*' { respond TST_Customer, [status: CREATED] }
}
}
def edit(Long id) {
respond TST_CustomerService.get(id)
}
def update(TST_Customer TST_Customer) {
if (TST_Customer == null) {
notFound()
return
}
try {
TST_CustomerService.save(TST_Customer)
} catch (ValidationException e) {
respond TST_Customer.errors, view:'edit'
return
}
request.withFormat {
form multipartForm {
flash.message = message(code: 'default.updated.message', args: [message(code: 'TST_Customer.label', default: 'TST_Customer'), TST_Customer.id])
redirect TST_Customer
}
'*'{ respond TST_Customer, [status: OK] }
}
}
def delete(Long id) {
if (id == null) {
notFound()
return
}
TST_CustomerService.delete(id)
request.withFormat {
form multipartForm {
flash.message = message(code: 'default.deleted.message', args: [message(code: 'TST_Customer.label', default: 'TST_Customer'), id])
redirect action:"index", method:"GET"
}
'*'{ render status: NO_CONTENT }
}
}
protected void notFound() {
request.withFormat {
form multipartForm {
flash.message = message(code: 'default.not.found.message', args: [message(code: 'TST_Customer.label', default: 'TST_Customer'), params.id])
redirect action: "index", method: "GET"
}
'*'{ render status: NOT_FOUND }
}
}
}
Service
package TSTSupport
import grails.gorm.services.Service
#Service(TST_Customer)
interface TST_CustomerService {
TST_Customer get(Serializable id)
List<TST_Customer> list(Map args)
Long count()
void delete(Serializable id)
TST_Customer save(TST_Customer TST_Customer)
}
I actually had to Google the answer (none of the suggestions given to me worked for me). Anyway, in the controller you prefix right above the classname
#Transactional("name of datasource")
Full example:
package TSTSupport
import grails.validation.ValidationException
import static org.springframework.http.HttpStatus.*
#Transactional("tst")
class TST_CustomerController {
TST_CustomerService TST_CustomerService
static allowedMethods = [save: "POST", update: "PUT", delete: "DELETE"]
def index(Integer max) {
params.max = Math.min(max ?: 10, 100)
respond TST_CustomerService.list(params), model:[TST_CustomerCount: TST_CustomerService.count()]
}
def show(Long id) {
respond TST_CustomerService.get(id)
}
def create() {
respond new TST_Customer(params)
}
def save(TST_Customer TST_Customer) {
if (TST_Customer == null) {
notFound()
return
}
try {
TST_CustomerService.save(TST_Customer)
} catch (ValidationException e) {
respond TST_Customer.errors, view:'create'
return
}
request.withFormat {
form multipartForm {
flash.message = message(code: 'default.created.message', args: [message(code: 'TST_Customer.label', default: 'TST_Customer'), TST_Customer.id])
redirect TST_Customer
}
'*' { respond TST_Customer, [status: CREATED] }
}
}
def edit(Long id) {
respond TST_CustomerService.get(id)
}
def update(TST_Customer TST_Customer) {
if (TST_Customer == null) {
notFound()
return
}
try {
TST_CustomerService.save(TST_Customer)
} catch (ValidationException e) {
respond TST_Customer.errors, view:'edit'
return
}
request.withFormat {
form multipartForm {
flash.message = message(code: 'default.updated.message', args: [message(code: 'TST_Customer.label', default: 'TST_Customer'), TST_Customer.id])
redirect TST_Customer
}
'*'{ respond TST_Customer, [status: OK] }
}
}
def delete(Long id) {
if (id == null) {
notFound()
return
}
TST_CustomerService.delete(id)
request.withFormat {
form multipartForm {
flash.message = message(code: 'default.deleted.message', args: [message(code: 'TST_Customer.label', default: 'TST_Customer'), id])
redirect action:"index", method:"GET"
}
'*'{ render status: NO_CONTENT }
}
}
protected void notFound() {
request.withFormat {
form multipartForm {
flash.message = message(code: 'default.not.found.message', args: [message(code: 'TST_Customer.label', default: 'TST_Customer'), params.id])
redirect action: "index", method: "GET"
}
'*'{ render status: NOT_FOUND }
}
}
}

Pug able to access a nested array from a mongo database Json

I am trying to output the array dependencies from the mongodb object. I have tried nearly everything but keep getting length of undefined.
I can output the whole object but I want the name version of each dependencies.
{ _id: 5c6eea28c6c23a15beb43419,
Repo_id: [ 1 ],
name: 'express-ibm',
version: '0.0.0',
dependencies:
[ { name: 'async', version: '2.6.1' },
{ name: 'body-parser#1.18.3', version: '1.18.3' },
{ name: 'cookie-parser#~1.4.3', version: '1.4.3' },
{ name: 'debug#~2.6.9', version: '2.6.9' },
{ name: 'express#~4.16.0', version: '4.16.4' },
{ name: 'http-errors#~1.6.2', version: '1.6.3' },
{ name: 'mongoose', version: '5.3.13' },
{ name: 'morgan#~1.9.0', version: '1.9.1' },
{ name: 'pug#2.0.0-beta11', version: '2.0.0-beta11' } ] }
// Display detail page for a specific Repo
exports.repo_search = function(req, res, next) {
Repo.findById(req.params.id).populate('repo').exec(function(err, repo) {
if (err) {
return next(err);
}
if (repo == null) {
// No results.
var err = new Error('Repo copy not found');
err.status = 404;
return next(err);
}
console.log(repo);
Repo.find().exec(function(err, list) {
if (err) {
return next(err);
}
res.render('repo_info_detail', {
title : 'Repo Detail',
repo : repo,
list : list
// repo_dependencies: results.repo_search
});
});
});
};
Pug:
extends layout
block content
p#demo
h1 #[Repository Name :] #{repo.name}
dd #[ IBM Github URL:]
a(href='/'+repo.url) #{repo.url}
dd #[ Repository ID:] #{repo._id}
dd #[ Language Type:] #{repo.filetype}
dd #[Repo ID :] #{repo.Repo_id}
//dd #[dependencies: ] #{repo.dependencies.name}
div(class='col')
div(class='col-sm-8')
p
button.hidediv Hide dependencies
button.showdiv Show dependencies
.divdemo
| Dependencies
.button
a#export(href='#', role='button')
| Click On This Here Link To Export The Table Data into a CSV File
div(class='col')
div(class='col-sm-3')
table
thead
tr: th Name
tbody
each d in repo
tr
td
dd #{repo}
repo is a javascript object, and you're correctly accessing its properties using dot syntax (e.g. repo.name or repo.dependencies). However, repo.dependencies is an array of objects. It doesn't have a name property that can accessed using dot syntax. Instead, you'll have to loop through the child objects and access each of their name properties in turn.
h1 Repository Name: #{repo.name}
dl
dt IBM Github URL:
dd #[a(href='/'+repo.url) #{repo.url}]
dt Repository ID
dd #{repo.Repo_id}
dt Dependencies
each dependency in repo.dependencies
dd #{dependency.name} (v#{dependency.version})
Have a look at the syntax for pug tab interpolation, it looks like you're using it incorrectly in your example.
Also, check out the documentation on the proper usage of dd elements and how they should be used with dt elements. They also must be children of a description list (dl) element: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/dl

React-native :app:transformDexArchiveWithExternalLibsDexMergerForDebug FAILED

when I did react-native run-android at 96% :app: transformDexArchiveWithExternalLibsDexMergerForDebug I get this error. I started to stop and I couldn't find the solution. Do you have any of these problems?
android {
compileSdkVersion 27
buildToolsVersion '27.0.3'
defaultConfig {
applicationId "com.ykstyt"
minSdkVersion 16
targetSdkVersion 26
versionCode 3
versionName "1.0.0"
ndk {
abiFilters "armeabi-v7a", "x86"
}
}
signingConfigs {
release {
if (project.hasProperty('MYAPP_RELEASE_STORE_FILE')) {
storeFile file(MYAPP_RELEASE_STORE_FILE)
storePassword MYAPP_RELEASE_STORE_PASSWORD
keyAlias MYAPP_RELEASE_KEY_ALIAS
keyPassword MYAPP_RELEASE_KEY_PASSWORD
}
}
}
splits {
abi {
reset()
enable enableSeparateBuildPerCPUArchitecture
universalApk false // If true, also generate a universal APK
include "armeabi-v7a", "x86"
}
}
buildTypes {
release {
minifyEnabled enableProguardInReleaseBuilds
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
signingConfig signingConfigs.release
}
}
applicationVariants.all { variant ->
variant.outputs.each { output ->
def versionCodes = ["armeabi-v7a":1, "x86":2]
def abi = output.getFilter(OutputFile.ABI)
if (abi != null) {
output.versionCodeOverride =
versionCodes.get(abi) * 1048576 + defaultConfig.versionCode
}
}
}
}
dependencies {
compile project(':react-native-text-input-mask')
compile project(':react-native-admob')
compile project(':react-native-onesignal')
compile project(':react-native-vector-icons')
compile project(':react-native-pdf')
compile project(':react-native-fetch-blob')
compile fileTree(dir: "libs", include: ["*.jar"])
compile "com.android.support:appcompat-v7:23.0.1"
compile "com.facebook.react:react-native:+"
implementation 'com.onesignal:OneSignal:[3.9.1, 3.99.99]'
}
task copyDownloadableDepsToLibs(type: Copy) {
from configurations.compile
into 'libs'
}
apply plugin: 'com.onesignal.androidsdk.onesignal-gradle-plugin'
Step 1 : Delete whole android folder
Run : react-native upgrade
accept y to finish.
After finish Run : react-native run-android
Thats All :D

JHipster Docker Build with UI Grid not showing fonts

I am using JHipster 3.8 with UI-Grid i.e. ui-grid.info when i run the application locally its working fine. But when i deploy to Docker using this command
./gradlew bootRepackage -Pprod buildDocker
docker-compose -f src/main/docker/app.yml up
i can see below error in developer console regarding fonts
generated.js:174220 GET http://192.168.99.100:8585/content/css/ui-grid-f53764c7a4.woff
GET http://192.168.99.100:8585/content/css/ui-grid-c6fa199a3e.ttf
and the page display with some character instead of icon as below :-
i have got couple solution for UI Grid link1 link2, but its not working for me, because as per the error file name and location are different, as gulp making such changes.
Not sure how to fix this issue. Can some once guide me?
EDIT
My Gulp File:-
// Generated on 2016-09-20 using generator-jhipster 3.7.1
'use strict';
var gulp = require('gulp'),
expect = require('gulp-expect-file'),
es = require('event-stream'),
flatten = require('gulp-flatten'),
sass = require('gulp-sass'),
rev = require('gulp-rev'),
templateCache = require('gulp-angular-templatecache'),
htmlmin = require('gulp-htmlmin'),
imagemin = require('gulp-imagemin'),
ngConstant = require('gulp-ng-constant'),
rename = require('gulp-rename'),
eslint = require('gulp-eslint'),
argv = require('yargs').argv,
gutil = require('gulp-util'),
protractor = require('gulp-protractor').protractor,
del = require('del'),
runSequence = require('run-sequence'),
browserSync = require('browser-sync'),
KarmaServer = require('karma').Server,
plumber = require('gulp-plumber'),
changed = require('gulp-changed'),
gulpIf = require('gulp-if');
var handleErrors = require('./gulp/handle-errors'),
serve = require('./gulp/serve'),
util = require('./gulp/utils'),
copy = require('./gulp/copy'),
inject = require('./gulp/inject'),
build = require('./gulp/build');
var config = require('./gulp/config');
gulp.task('clean', function () {
return del([config.dist], { dot: true });
});
gulp.task('copy', ['copy:i18n', 'copy:fonts', 'copy:common']);
gulp.task('copy:i18n', copy.i18n);
gulp.task('copy:languages', copy.languages);
gulp.task('copy:fonts', copy.fonts);
gulp.task('copy:common', copy.common);
gulp.task('copy:swagger', copy.swagger);
gulp.task('copy:images', copy.images);
gulp.task('images', function () {
return gulp.src(config.app + 'content/images/**')
.pipe(plumber({errorHandler: handleErrors}))
.pipe(changed(config.dist + 'content/images'))
.pipe(imagemin({optimizationLevel: 5, progressive: true, interlaced: true}))
.pipe(rev())
.pipe(gulp.dest(config.dist + 'content/images'))
.pipe(rev.manifest(config.revManifest, {
base: config.dist,
merge: true
}))
.pipe(gulp.dest(config.dist))
.pipe(browserSync.reload({stream: true}));
});
gulp.task('sass', function () {
return es.merge(
gulp.src(config.sassSrc)
.pipe(plumber({errorHandler: handleErrors}))
.pipe(expect(config.sassSrc))
.pipe(changed(config.cssDir, {extension: '.css'}))
.pipe(sass({includePaths:config.bower}).on('error', sass.logError))
.pipe(gulp.dest(config.cssDir)),
gulp.src(config.bower + '**/fonts/**/*.{woff,woff2,svg,ttf,eot,otf}')
.pipe(plumber({errorHandler: handleErrors}))
.pipe(changed(config.app + 'content/fonts'))
.pipe(flatten())
.pipe(gulp.dest(config.app + 'content/fonts'))
);
});
gulp.task('copyAngularUiGridFonts', function() {
gulp.src(config.app + '/bower_components/angular-ui-grid/*.{ttf,woff,eof,svg}')
.pipe(gulp.dest(config.dist + 'content/css/'));
});
gulp.task('styles', ['sass'], function () {
return gulp.src(config.app + 'content/css')
.pipe(browserSync.reload({stream: true}));
});
gulp.task('inject', function() {
runSequence('inject:dep', 'inject:app');
});
gulp.task('inject:dep', ['inject:test', 'inject:vendor']);
gulp.task('inject:app', inject.app);
gulp.task('inject:vendor', inject.vendor);
gulp.task('inject:test', inject.test);
gulp.task('inject:troubleshoot', inject.troubleshoot);
gulp.task('assets:prod', ['images', 'styles', 'html', 'copy:swagger', 'copy:images'], build);
gulp.task('html', function () {
return gulp.src(config.app + 'app/**/*.html')
.pipe(htmlmin({collapseWhitespace: true}))
.pipe(templateCache({
module: 'dashboardApp',
root: 'app/',
moduleSystem: 'IIFE'
}))
.pipe(gulp.dest(config.tmp));
});
gulp.task('ngconstant:dev', function () {
return ngConstant({
name: 'dashboardApp',
constants: {
VERSION: util.parseVersion(),
DEBUG_INFO_ENABLED: true
},
template: config.constantTemplate,
stream: true
})
.pipe(rename('app.constants.js'))
.pipe(gulp.dest(config.app + 'app/'));
});
gulp.task('ngconstant:prod', function () {
return ngConstant({
name: 'dashboardApp',
constants: {
VERSION: util.parseVersion(),
DEBUG_INFO_ENABLED: false
},
template: config.constantTemplate,
stream: true
})
.pipe(rename('app.constants.js'))
.pipe(gulp.dest(config.app + 'app/'));
});
/*gulp.task('fonts:prod', function () {
return gulp.src($.mainBowerFiles())
.pipe($.filter(config.bower + 'angular-ui-grid/*.{eot,svg,ttf,woff,woff2}'))
.pipe($.flatten())
.pipe(gulp.dest(options.tmp + 'content/css/'));
});*/
// check app for eslint errors
gulp.task('eslint', function () {
return gulp.src(['gulpfile.js', config.app + 'app/**/*.js'])
.pipe(plumber({errorHandler: handleErrors}))
.pipe(eslint())
.pipe(eslint.format())
.pipe(eslint.failOnError());
});
// check app for eslint errors anf fix some of them
gulp.task('eslint:fix', function () {
return gulp.src(config.app + 'app/**/*.js')
.pipe(plumber({errorHandler: handleErrors}))
.pipe(eslint({
fix: true
}))
.pipe(eslint.format())
.pipe(gulpIf(util.isLintFixed, gulp.dest(config.app + 'app')));
});
gulp.task('test', ['inject:test', 'ngconstant:dev'], function (done) {
new KarmaServer({
configFile: __dirname + '/' + config.test + 'karma.conf.js',
singleRun: true
}, done).start();
});
/* to run individual suites pass `gulp itest --suite suiteName` */
gulp.task('protractor', function () {
var configObj = {
configFile: config.test + 'protractor.conf.js'
};
if (argv.suite) {
configObj['args'] = ['--suite', argv.suite];
}
return gulp.src([])
.pipe(plumber({errorHandler: handleErrors}))
.pipe(protractor(configObj))
.on('error', function () {
gutil.log('E2E Tests failed');
process.exit(1);
});
});
gulp.task('itest', ['protractor']);
gulp.task('watch', function () {
gulp.watch('bower.json', ['install']);
gulp.watch(['gulpfile.js', 'build.gradle'], ['ngconstant:dev']);
gulp.watch(config.sassSrc, ['styles']);
gulp.watch(config.app + 'content/images/**', ['images']);
gulp.watch(config.app + 'app/**/*.js', ['inject:app']);
gulp.watch([config.app + '*.html', config.app + 'app/**', config.app + 'i18n/**']).on('change', browserSync.reload);
});
gulp.task('install', function () {
runSequence(['inject:dep', 'ngconstant:dev'], 'sass', 'copy:languages', 'inject:app', 'inject:troubleshoot');
});
gulp.task('serve', ['install'], serve);
gulp.task('build', ['clean'], function (cb) {
runSequence(['copy','copyAngularUiGridFonts', 'inject:vendor', 'ngconstant:prod', 'copy:languages'], 'inject:app', 'inject:troubleshoot', 'assets:prod', cb);
});
gulp.task('default', ['serve']);
EDIT:-
buildscript {
repositories {
mavenLocal()
mavenCentral()
jcenter()
maven { url "http://repo.spring.io/plugins-release" }
maven { url "http://repo.spring.io/milestone" }
maven { url "https://plugins.gradle.org/m2/" }
}
dependencies {
classpath "org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:2.0.1"
classpath "net.ltgt.gradle:gradle-apt-plugin:0.6"
classpath "org.springframework.boot:spring-boot-gradle-plugin:${spring_boot_version}"
classpath "org.springframework.build.gradle:propdeps-plugin:0.0.7"
classpath "com.moowork.gradle:gradle-node-plugin:0.12"
classpath "com.moowork.gradle:gradle-gulp-plugin:0.12"
classpath "se.transmode.gradle:gradle-docker:1.2"
classpath "io.spring.gradle:dependency-management-plugin:0.5.6.RELEASE"
//jhipster-needle-gradle-buildscript-dependency - JHipster will add additional gradle build script plugins here
}
}
apply plugin: 'java'
sourceCompatibility=1.8
targetCompatibility=1.8
apply plugin: 'maven'
apply plugin: 'spring-boot'
apply plugin: 'war'
apply plugin: 'propdeps'
apply plugin: 'io.spring.dependency-management'
/* downgrade Hibernate to 4.3 */
ext['hibernate.version'] = '${hibernate_entitymanager_version}'
defaultTasks 'bootRun'
sourceSets {
generated {
java {
srcDirs = ['src/main/generated']
}
}
}
bootRepackage {
mainClass = 'com.equidity.dashboard.XboardApp'
}
war {
}
springBoot {
mainClass = 'com.equidity.dashboard.XboardApp'
executable = true
buildInfo()
}
bootRun {
addResources = false
}
apply from: 'gradle/yeoman.gradle'
apply from: 'gradle/sonar.gradle'
apply from: 'gradle/liquibase.gradle'
apply from: 'gradle/gatling.gradle'
apply from: 'gradle/mapstruct.gradle'
apply from: 'gradle/docker.gradle'
//jhipster-needle-gradle-apply-from - JHipster will add additional gradle scripts to be applied here
if (project.hasProperty('prod')) {
apply from: 'gradle/profile_prod.gradle'
} else {
apply from: 'gradle/profile_dev.gradle'
}
group = 'com.equidity.dashboard'
version = '0.0.1-SNAPSHOT'
description = ''
configurations {
providedRuntime
compile.exclude module: "spring-boot-starter-tomcat"
}
repositories {
mavenLocal()
mavenCentral()
jcenter()
maven { url 'http://repo.spring.io/milestone' }
maven { url 'http://repo.spring.io/snapshot' }
maven { url 'https://repository.jboss.org/nexus/content/repositories/releases' }
maven { url 'https://oss.sonatype.org/content/repositories/releases' }
maven { url 'https://oss.sonatype.org/content/repositories/snapshots' }
maven { url 'http://repo.maven.apache.org/maven2' }
}
dependencies {
compile "io.dropwizard.metrics:metrics-core"
compile "io.dropwizard.metrics:metrics-graphite:${dropwizard_metrics_version}"
compile "io.dropwizard.metrics:metrics-healthchecks:${dropwizard_metrics_version}"
compile "io.dropwizard.metrics:metrics-jvm:${dropwizard_metrics_version}"
compile "io.dropwizard.metrics:metrics-servlet:${dropwizard_metrics_version}"
compile "io.dropwizard.metrics:metrics-json:${dropwizard_metrics_version}"
compile ("io.dropwizard.metrics:metrics-servlets:${dropwizard_metrics_version}") {
exclude(module: 'metrics-healthchecks')
}
compile("net.logstash.logback:logstash-logback-encoder:${logstash_logback_encoder_version}") {
exclude(module: 'ch.qos.logback')
}
compile "com.fasterxml.jackson.datatype:jackson-datatype-json-org:${jackson_version}"
compile "com.fasterxml.jackson.datatype:jackson-datatype-hppc:${jackson_version}"
compile "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:${jackson_version}"
compile "com.fasterxml.jackson.datatype:jackson-datatype-hibernate4"
compile "com.fasterxml.jackson.core:jackson-annotations:${jackson_version}"
compile "com.fasterxml.jackson.core:jackson-databind:${jackson_version}"
compile ("com.ryantenney.metrics:metrics-spring:${metrics_spring_version}") {
exclude(module: 'metrics-core')
exclude(module: 'metrics-healthchecks')
}
compile "com.hazelcast:hazelcast:${hazelcast_version}"
compile "com.hazelcast:hazelcast-hibernate4:${hazelcast_version}"
compile "com.hazelcast:hazelcast-spring:${hazelcast_version}"
compile "com.hazelcast:hazelcast-wm:${hazelcast_version}"
compile "org.hibernate:hibernate-core:${hibernate_entitymanager_version}"
compile("com.zaxxer:HikariCP:${HikariCP_version}") {
exclude(module: 'tools')
}
compile "org.apache.commons:commons-lang3:${commons_lang_version}"
compile "commons-io:commons-io:${commons_io_version}"
compile "javax.inject:javax.inject:${javax_inject_version}"
compile "javax.transaction:javax.transaction-api"
compile "org.apache.geronimo.javamail:geronimo-javamail_1.4_mail:${geronimo_javamail_1_4_mail_version}"
compile "org.hibernate:hibernate-envers"
compile "org.hibernate:hibernate-validator"
compile ("org.liquibase:liquibase-core:${liquibase_core_version}") {
exclude(module: 'jetty-servlet')
}
compile "com.mattbertolini:liquibase-slf4j:${liquibase_slf4j_version}"
compile "org.springframework.boot:spring-boot-actuator"
compile "org.springframework.boot:spring-boot-autoconfigure"
compile "org.springframework.boot:spring-boot-loader-tools"
compile "org.springframework.boot:spring-boot-starter-logging"
compile "org.springframework.boot:spring-boot-starter-aop"
compile "org.springframework.boot:spring-boot-starter-data-jpa"
compile "org.springframework.boot:spring-boot-starter-data-elasticsearch"
// needed to get around elasticsearch stacktrace about jna not found
// https://github.com/elastic/elasticsearch/issues/13245
compile "net.java.dev.jna:jna:${jna_version}"
compile "org.springframework.boot:spring-boot-starter-security"
compile ("org.springframework.boot:spring-boot-starter-web") {
exclude module: 'spring-boot-starter-tomcat'
}
compile "org.springframework.boot:spring-boot-starter-undertow"
compile "org.springframework.boot:spring-boot-starter-websocket"
compile "org.springframework.boot:spring-boot-starter-thymeleaf"
compile "org.springframework.cloud:spring-cloud-cloudfoundry-connector"
compile "org.springframework.cloud:spring-cloud-spring-service-connector"
compile "org.springframework.cloud:spring-cloud-localconfig-connector"
compile ("org.springframework:spring-context-support") {
exclude(module: 'quartz')
}
compile "org.springframework.security:spring-security-config:${spring_security_version}"
compile "org.springframework.security:spring-security-data:${spring_security_version}"
compile "org.springframework.security:spring-security-web:${spring_security_version}"
compile "org.springframework.security:spring-security-messaging:${spring_security_version}"
compile("io.springfox:springfox-swagger2:${springfox_version}"){
exclude module: 'mapstruct'
}
compile "mysql:mysql-connector-java"
compile "fr.ippon.spark.metrics:metrics-spark-reporter:${metrics_spark_reporter_version}"
compile "org.mapstruct:mapstruct-jdk8:${mapstruct_version}"
compile "org.apache.httpcomponents:httpclient"
compile "org.springframework.social:spring-social-security"
compile "org.springframework.social:spring-social-google:${spring_social_google_version}"
compile "org.springframework.social:spring-social-facebook"
compile "org.springframework.social:spring-social-twitter"
testCompile "com.jayway.awaitility:awaitility:${awaility_version}"
testCompile "com.jayway.jsonpath:json-path"
testCompile "info.cukes:cucumber-junit:${cucumber_version}"
testCompile "info.cukes:cucumber-spring:${cucumber_version}"
testCompile "org.springframework.boot:spring-boot-starter-test"
testCompile "org.springframework.security:spring-security-test"
testCompile "org.springframework.boot:spring-boot-test"
testCompile "org.assertj:assertj-core:${assertj_core_version}"
testCompile "junit:junit"
testCompile "org.mockito:mockito-core"
testCompile "com.mattbertolini:liquibase-slf4j:${liquibase_slf4j_version}"
testCompile "org.hamcrest:hamcrest-library"
testCompile "io.gatling.highcharts:gatling-charts-highcharts:${gatling_version}"
testCompile "com.h2database:h2"
optional "org.springframework.boot:spring-boot-configuration-processor:${spring_boot_version}"
//jhipster-needle-gradle-dependency - JHipster will add additional dependencies here
compile "com.querydsl:querydsl-core:${queryDslVersion}"
compile "com.querydsl:querydsl-jpa:${queryDslVersion}"
compile "com.querydsl:querydsl-apt:${queryDslVersion}"
querydslapt "com.querydsl:querydsl-apt:${queryDslVersion}"
}
clean {
delete "target"
}
task cleanResources(type: Delete) {
delete 'build/resources'
}
task wrapper(type: Wrapper) {
gradleVersion = '3.1'
}
task stage(dependsOn: 'bootRepackage') {
}
compileJava.dependsOn processResources
processResources.dependsOn cleanResources,bootBuildInfo
bootBuildInfo.mustRunAfter cleanResources
EDIT :- Profile_prod.gradle
import org.apache.tools.ant.taskdefs.condition.Os
apply plugin: 'spring-boot'
apply plugin: 'com.moowork.node'
apply plugin: 'com.moowork.gulp'
ext {
logbackLoglevel = "INFO"
}
dependencies {
}
def profiles = 'prod'
if (project.hasProperty('no-liquibase')) {
profiles += ',no-liquibase'
}
if (project.hasProperty('swagger')) {
profiles += ',swagger'
}
bootRun {
args = []
}
task gulpBuildWithOpts(type: GulpTask) {
args = ["build", "--no-notification"]
}
war {
webAppDirName = 'build/www/'
}
processResources {
filesMatching('**/logback-spring.xml') {
filter {
it.replace('#logback.loglevel#', logbackLoglevel)
}
}
filesMatching('**/application.yml') {
filter {
it.replace('#spring.profiles.active#', profiles)
}
}
}
gulpBuildWithOpts.dependsOn 'npmInstall'
gulpBuildWithOpts.dependsOn 'bower'
processResources.dependsOn gulpBuildWithOpts
test.dependsOn gulp_test
bootRun.dependsOn gulp_test
As described in in the links that you provided, you need a task in gulpfile.js which copy the missing files. You can use the following code to your existing copy task e.g.:
gulp.src(config.app + '/bower_components/angular-ui-grid/*.{ttf,woff,eof,svg}')
.pipe(plumber({errorHandler: handleErrors}))
.pipe(changed(config.dist + 'content/css/'))
.pipe(flatten())
.pipe(rev())
.pipe(gulp.dest(config.dist + 'content/css/'))
.pipe(rev.manifest(config.revManifest, {
base: config.dist,
merge: true
}))
.pipe(gulp.dest(config.dist)),
i.e. your copy task is gone look like this:
gulp.task('copy', function () {
return es.merge(
gulp.src(config.app + 'i18n/**')
.pipe(plumber({errorHandler: handleErrors}))
.pipe(changed(config.dist + 'i18n/'))
.pipe(gulp.dest(config.dist + 'i18n/')),
gulp.src(config.bower + 'bootstrap/fonts/*.*')
.pipe(plumber({errorHandler: handleErrors}))
.pipe(changed(config.dist + 'content/fonts/'))
.pipe(rev())
.pipe(gulp.dest(config.dist + 'content/fonts/'))
.pipe(rev.manifest(config.revManifest, {
base: config.dist,
merge: true
}))
.pipe(gulp.dest(config.dist)),
gulp.src(config.app + '/bower_components/angular-ui-grid/*.{ttf,woff,eof,svg}')
.pipe(plumber({errorHandler: handleErrors}))
.pipe(changed(config.dist + 'content/css/'))
.pipe(flatten())
.pipe(rev())
.pipe(gulp.dest(config.dist + 'content/css/'))
.pipe(rev.manifest(config.revManifest, {
base: config.dist,
merge: true
}))
.pipe(gulp.dest(config.dist)),
gulp.src(config.app + 'content/**/*.{woff,woff2,svg,ttf,eot,otf}')
.pipe(plumber({errorHandler: handleErrors}))
.pipe(changed(config.dist + 'content/fonts/'))
.pipe(flatten())
.pipe(rev())
.pipe(gulp.dest(config.dist + 'content/fonts/'))
.pipe(rev.manifest(config.revManifest, {
base: config.dist,
merge: true
}))
.pipe(gulp.dest(config.dist)),
gulp.src([config.app + 'robots.txt', config.app + 'favicon.ico', config.app + '.htaccess'], { dot: true })
.pipe(plumber({errorHandler: handleErrors}))
.pipe(changed(config.dist))
.pipe(gulp.dest(config.dist))
);
});
Its looks like angular-grid-ui is expecting the *.{ttf,woff,eof,svg} files to be found under the content/css and not content/fonts

Resources