我已经安装了电子模块封装,用于在电子中实现标签,如下所示
的package.json
{
"name": "Backoffice",
"version": "1.0.0",
"description": "BackOffice application",
"main": "main.js",
"scripts": {
"start": "electron ."
},
"author": "Karthik",
"license": "ISC",
"devDependencies": {
"electron": "^2.0.8",
"electron-tabs": "^0.9.4"
}
}
Run Code Online (Sandbox Code Playgroud)
main.js
const electron = require("electron");
const app = electron.app;
const BrowserWindow = electron.BrowserWindow;
const Menu = electron.Menu;
const path = require("path");
const url = require("url");
const TabGroup = require("electron-tabs");
let win;
const tabGroup = new TabGroup();
function createWindow() {
win = new BrowserWindow();
win.loadURL(url.format({
pathname:path.join(__dirname,'index.html'),
protocol:'file',
slashes:true
}));
win.on('closed',()=>{
win …Run Code Online (Sandbox Code Playgroud) 我目前正在将GWT应用程序从JBoss 5.1迁移到JBoss 7.0 EAP服务器.
我在部署到服务器的战争中捆绑了gwt-servlet.jar
我收到以下错误.
05:11:49,068 ERROR [io.undertow.servlet] (default task-5) Exception while dispatching incoming RPC call: com.google.gwt.user.client.rpc.SerializationException: Type 'java.io.FileNotFoundException' was not included in the set of types which can be serialized by this SerializationPolicy or its Class object could not be loaded. For security
purposes, this type will not be serialized.: instance = java.io.FileNotFoundException
at com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter.serialize(ServerSerializationStreamWriter.java:667)
at com.google.gwt.user.client.rpc.impl.AbstractSerializationStreamWriter.writeObject(AbstractSerializationStreamWriter.java:130)
at com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter$ValueWriter$8.write(ServerSerializationStreamWriter.java:153)
at com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter.serializeValue(ServerSerializationStreamWriter.java:587)
at com.google.gwt.user.server.rpc.RPC.encodeResponse(RPC.java:605)
at com.google.gwt.user.server.rpc.RPC.encodeResponseForFailure(RPC.java:393)
at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:579)
at com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:265)
at com.google.gwt.user.server.rpc.RemoteServiceServlet.processPost(RemoteServiceServlet.java:305)
at com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet.doPost(AbstractRemoteServiceServlet.java:62)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
at …Run Code Online (Sandbox Code Playgroud) 我使用Jquery数据表将搜索结果导出到EXCEL和CSV,如下所示:
EmployeeList.html
<form name="officeForm" id="officeForm" method="post" action="EmployeeList.action">
<div class="pull-right">
<button class="btn btn-primary-outline btn-sm" type="submit">Search</button>
</div>
<table class="table table-form">
<tbody>
<tr>
<td class="control-label">Office</td>
<td>
<select id="officeId" name="office">
<option value="0">ALL</option>
<option value="108">Bangalore</option>
<option value="109">Mumbai</option>
<option value="110">Pune</option>
</select>
</td>
</tr>
<tr>
<td class="control-label">Department</td>
<td>
<select id="departmentId" name="department">
<option value="0">ALL</option>
<option value="118">IT</option>
<option value="119">HR</option>
<option value="120">Operations</option>
</select>
</td>
</tr>
</tbody>
</table>
</form>
<div class="content-wrapper">
<table class="table table-hover" id="employee-grid" >
<thead>
<tr>
<th>Employee Id</th>
<th>Name</th>
<th>Department</th>
<th>Joined date</th>
</tr>
</thead>
</table>
</div>
Run Code Online (Sandbox Code Playgroud)
Employee.js
var dt …Run Code Online (Sandbox Code Playgroud) Spring安全配置类
@Configuration
@EnableWebSecurity
public class SecurityConfig extends WebSecurityConfigurerAdapter{
@Autowired
private UserDetailsService userDetailsService;
@Bean
public PasswordEncoder getPasswordEncoder() {
return new BCryptPasswordEncoder();
}
@Override
protected void configure(HttpSecurity http) throws Exception {
http
.cors()
.and()
.authorizeRequests()
.antMatchers("/user", "/login").permitAll()
.antMatchers("/employee", "/insurance").hasRole("User")
.anyRequest()
.authenticated()
.and()
.httpBasic()
.and()
.csrf().disable();
}
protected void configureGlobal(AuthenticationManagerBuilder auth) throws Exception {
auth.userDetailsService(userDetailsService).passwordEncoder(getPasswordEncoder());
}
}
Run Code Online (Sandbox Code Playgroud)
UserDetailsService 实现类
@Service
public class UserDetailsServiceImpl implements UserDetailsService {
@Autowired
private UserService userService;
@Override
public UserDetails loadUserByUsername(String userName) throws UsernameNotFoundException {
User user = null;
Set<GrantedAuthority> …Run Code Online (Sandbox Code Playgroud) spring spring-security basic-authentication spring-boot spring-security-rest
我没有最新的源代码,但在服务器上部署了war(最新)文件.
请建议最好的方法
1)从war/ear中检索源代码
2)比较和合并/更新可用的源代码与war/ear中的代码但可用源代码中缺少(我使用的是ECLIPSE IDE)
提前致谢
我正在将我的应用程序从Weblogic 9迁移到12c.
连接池 - 为我的应用程序创建的cvSybasepool在Web逻辑9上正常工作.
我使用com.sybase.jdbc.SybDriver连接到Weblogic 9上的Sybase数据库.
在Weblogic 12c上复制连接池(cvSybasepool)后,出现以下错误:
<Jun 21, 2016 4:40:25 AM EDT> <Error> <Deployer> <BEA-149205> <Failed to initialize the application "cvSybasepool" due to error weblogic.application.ModuleException: weblogic.com
mon.resourcepool.ResourceSystemException: Cannot load driver class com.sybase.jdbc.SybDriver for datasource 'cvSybasepool'.
weblogic.application.ModuleException: weblogic.common.resourcepool.ResourceSystemException: Cannot load driver class com.sybase.jdbc.SybDriver for datasource 'cvSybasepool'.
at weblogic.jdbc.module.JDBCModule.prepare(JDBCModule.java:350)
at weblogic.application.internal.flow.ModuleListenerInvoker.prepare(ModuleListenerInvoker.java:100)
at weblogic.application.internal.flow.ModuleStateDriver$1.next(ModuleStateDriver.java:175)
at weblogic.application.internal.flow.ModuleStateDriver$1.next(ModuleStateDriver.java:170)
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:42)
Truncated. see log file for complete stacktrace
Caused By: weblogic.common.resourcepool.ResourceSystemException: Cannot load driver class com.sybase.jdbc.SybDriver for …Run Code Online (Sandbox Code Playgroud) 下面是我的代码(客户端),通过JQUERY Ajax调用以JSON格式发送表单数据
$(document).ready(function(){
var contextroot = "/services/"
$("#customerForm").submit(function(e){
e.preventDefault();
var form = $(this);
var action = form.attr("action");
var data = form.serializeArray();
$.ajax({
url: contextroot+action,
dataType: 'json',
type: 'POST',
contentType: 'application/json',
data: JSON.stringify(data),
success: function(data){
console.log("DATA POSTED SUCCESSFULLY"+data);
},
error: function( jqXhr, textStatus, errorThrown ){
console.log( errorThrown );
}
});
});
});
Run Code Online (Sandbox Code Playgroud)
下面是接受JSON数据的SPRING控制器(服务)
@RequestMapping(value="/customer/create", method = RequestMethod.POST)
public CustomerDTO create(@RequestBody CustomerDTO customerDTO) {
return customerService.create(customerDTO);
}
Run Code Online (Sandbox Code Playgroud)
在提交表单时,我收到以下错误
HTTP400:BAD REQUEST - 由于语法无效,服务器无法处理请求.
我想这个错误是因为表单数据被序列化为JSON对象的数组,而不仅仅是请求体中的JSON对象,如下所示
[{ "Name": "名字", "值": "约翰"},{ "名": "姓氏", "值": "米勒"},{ …
我需要在 JBOSS EAP 7.0 服务器中创建一个 oracle 数据源
我使用以下命令从 JBOSS 管理 CLI(命令行界面)部署了ojdbc6.jar
deploy <PATH_TO_ORACLE_DRIVER_JAR>
Run Code Online (Sandbox Code Playgroud)
部署驱动程序后,我可以看到服务器日志如下
01:25:53,338 INFO [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-1) WFLYJCA0018: Started Driver service with driver-name = ojdbc6.jar
01:25:53,747 INFO [org.jboss.as.server] (management-handler-thread - 6) WFLYSRV0010: Deployed "ojdbc6.jar" (runtime-name : "ojdbc6.jar")
Run Code Online (Sandbox Code Playgroud)
但是当我尝试从 Jboss 管理控制台创建 oracle 数据源(oracle.jdbc.driver.OracleDriver 作为驱动程序类)时,出现以下错误
01:31:35,084 ERROR [org.jboss.as.controller.management-operation] (ServerService Thread Pool -- 66) WFLYCTL0013: Operation ("add") failed - address: ([
("subsystem" => "datasources"),
("data-source" => "OracleDS")
]) - failure description: {"WFLYCTL0180: Services with missing/unavailable dependencies" => [ …Run Code Online (Sandbox Code Playgroud) 我开发了一个多租户spring boot应用程序,其中数据源通过存储在application.properties中的数据库凭证进行初始化,如下所示:
application.properties
spring.multitenancy.datasource1.url=jdbc:mysql://localhost:3306/db1
spring.multitenancy.datasource1.username=root
spring.multitenancy.datasource1.password=****
spring.multitenancy.datasource1.driver-class-name=com.mysql.jdbc.Driver
spring.jpa.hibernate.ddl-auto=update
spring.multitenancy.datasource2.url=jdbc:mysql://localhost:3306/db2
spring.multitenancy.datasource2.username=root
spring.multitenancy.datasource2.password=****
spring.multitenancy.datasource2.driver-class-name=com.mysql.jdbc.Driver
spring.jpa.hibernate.ddl-auto=update
spring.multitenancy.datasource3.url=jdbc:mysql://localhost:3306/db3
spring.multitenancy.datasource3.username=root
spring.multitenancy.datasource3.password=****
spring.multitenancy.datasource3.driver-class-name=com.mysql.jdbc.Driver
spring.jpa.hibernate.ddl-auto=update
Run Code Online (Sandbox Code Playgroud)
DataSourceConfig.java
@Configuration
public class DataSourceConfig {
@Autowired
private MultitenancyProperties multitenancyProperties;
@Bean(name = { "dataSource", "dataSource1" })
@ConfigurationProperties(prefix = "spring.multitenancy.datasource1")
public DataSource dataSource1() {
DataSourceBuilder factory = DataSourceBuilder
.create(this.multitenancyProperties.getDatasource1().getClassLoader())
.driverClassName(this.multitenancyProperties.getDatasource1().getDriverClassName())
.username(this.multitenancyProperties.getDatasource1().getUsername())
.password(this.multitenancyProperties.getDatasource1().getPassword())
.url(this.multitenancyProperties.getDatasource1().getUrl());
return factory.build();
}
@Bean(name = "dataSource2")
@ConfigurationProperties(prefix = "spring.multitenancy.datasource2")
public DataSource dataSource2() {
DataSourceBuilder factory = DataSourceBuilder
.create(this.multitenancyProperties.getDatasource2().getClassLoader())
.driverClassName(this.multitenancyProperties.getDatasource2().getDriverClassName())
.username(this.multitenancyProperties.getDatasource2().getUsername())
.password(this.multitenancyProperties.getDatasource2().getPassword())
.url(this.multitenancyProperties.getDatasource2().getUrl());
return factory.build();
}
@Bean(name = "dataSource3")
@ConfigurationProperties(prefix = …Run Code Online (Sandbox Code Playgroud) 我正在使用 Jsch(Jcraft) 库与 SSH 服务器建立 SSH 连接,如下所示:
JSch jsch = new JSch();
String user = "****";
String host = "****";
int port = 22;
String privateKey = "***.ppk";//Path to private key(The file is in .ppk format)
try
{
jsch.addIdentity(privateKey);
Session session = jsch.getSession(user, host, port);
java.util.Properties config = new java.util.Properties();
config.put("StrictHostKeyChecking", "no");
session.setConfig(config);
session.connect();
ChannelSftp sftpChannel = (ChannelSftp) session.openChannel("sftp");
sftpChannel.connect();
/*file transfer code*/
sftpChannel.disconnect();
session.disconnect();
}
catch (Exception e)
{
e.printStackTrace();
}
Run Code Online (Sandbox Code Playgroud)
由于“StrictHostKeyChecking”被禁用,SSH 连接已成功建立。如果启用它,我会收到以下错误:
com.jcraft.jsch.JSchException: UnknownHostKey: ******. RSA key f …Run Code Online (Sandbox Code Playgroud) pom.xml
<properties>
<java.version>1.8</java.version>
<spring-cloud.version>Hoxton.SR1</spring-cloud.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-eureka-server</artifactId>
</dependency>
</dependencies>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>${spring-cloud.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
Run Code Online (Sandbox Code Playgroud)
主要应用类
@SpringBootApplication
@EnableEurekaServer
public class DiscoveryServerApplication {
public static void main(String[] args) {
SpringApplication.run(DiscoveryServerApplication.class, args);
}
}
Run Code Online (Sandbox Code Playgroud)
应用程序属性
server.port=8761
eureka.client.register-with-eureka=false
eureka.client.fetch-registry=false
Run Code Online (Sandbox Code Playgroud)
尤里卡客户端设置
pom.xml
<properties>
<java.version>1.8</java.version>
<spring-cloud.version>Hoxton.SR1</spring-cloud.version>
</properties>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.2.3.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-netflix-eureka-client</artifactId>
</dependency>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>${spring-cloud.version}</version> …Run Code Online (Sandbox Code Playgroud) java ×4
spring-boot ×3
jboss ×2
jboss7.x ×2
jquery ×2
spring ×2
datatables ×1
ear ×1
eclipse ×1
electron ×1
form-submit ×1
gwt ×1
hibernate ×1
html5 ×1
javascript ×1
jdbc ×1
jsch ×1
json ×1
multi-tenant ×1
node.js ×1
npm ×1
rpc ×1
spring-cloud ×1
spring-mvc ×1
ssh ×1
ssh-keys ×1
war ×1
weblogic ×1
weblogic12c ×1