在我的spring项目的自定义AuthenticationProvider中,我正在尝试读取已登录用户的权限列表,但我遇到以下错误:
org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: com.horariolivre.entity.Usuario.autorizacoes, could not initialize proxy - no Session
at org.hibernate.collection.internal.AbstractPersistentCollection.throwLazyInitializationException(AbstractPersistentCollection.java:566)
at org.hibernate.collection.internal.AbstractPersistentCollection.withTemporarySessionIfNeeded(AbstractPersistentCollection.java:186)
at org.hibernate.collection.internal.AbstractPersistentCollection.initialize(AbstractPersistentCollection.java:545)
at org.hibernate.collection.internal.AbstractPersistentCollection.read(AbstractPersistentCollection.java:124)
at org.hibernate.collection.internal.PersistentBag.iterator(PersistentBag.java:266)
at com.horariolivre.security.CustomAuthenticationProvider.authenticate(CustomAuthenticationProvider.java:45)
at org.springframework.security.authentication.ProviderManager.authenticate(ProviderManager.java:156)
at org.springframework.security.authentication.ProviderManager.authenticate(ProviderManager.java:177)
at org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter.attemptAuthentication(UsernamePasswordAuthenticationFilter.java:94)
at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:211)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:110)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.header.HeaderWriterFilter.doFilterInternal(HeaderWriterFilter.java:57)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:87)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:50)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:192)
at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:160)
at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:343)
at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:260)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171) …Run Code Online (Sandbox Code Playgroud) 我在VirtualBox VM上运行我的Symfony应用程序.PHP正在使用XDebug运行,并且已正确配置.我知道这一点,因为其他人已设法使其与同一个VM的快照一起工作.
当我尝试在VS Code XDebug中配置时,我使用以下内容 launch.json
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Listen for XDebug",
"type": "php",
"request": "launch",
"port": 9000
},
{
"name": "Launch currently open script",
"type": "php",
"request": "launch",
"program": "${file}",
"cwd": "${fileDirname}",
"port": 9000
}
]
}
Run Code Online (Sandbox Code Playgroud)
但是当我点击"开始调试:侦听XDebug"时,我收到以下错误:
错误:听EADDRINUSE ::: 9000
我试图杀死正在使用该端口的进程......令我惊讶的是,这是我尝试连接的虚拟机.
我在这个配置中错过了什么?
我真的不知道该怎么做.
我需要更改此highcharts图表的背景颜色:
但我似乎无法这样做 - 似乎没有任何明确的地方可以设置背景颜色?
我试着在本节中写出许多不同的值:
chart: {
polar: true,
type: 'line'
},
Run Code Online (Sandbox Code Playgroud)
但它没有做任何事情(它偶尔打破了这个剧本).
我是否需要在包含的.js文件中的某处更改它?或者可以从这个加载的脚本的级别完成?
JS真的很混乱.谁能帮我?
procedure CaseListMyShares(search: String);
Run Code Online (Sandbox Code Playgroud)
我有这样的程序.这是内容:
procedure TFormMain.CaseListMyShares(search: String);
var
i: Integer;
begin
myShares := obAkasShareApiAdapter.UserShares('1', search, '', '');
MySharesGrid.RowCount:= Length(myShares) +1;
MySharesGrid.AddCheckBoxColumn(0, false);
MySharesGrid.AutoFitColumns;
for i := 0 to Length(myShares) -1 do
begin
MySharesGrid.Cells[1, i+1]:= myShares[i].patientCase;
MySharesGrid.Cells[2, i+1]:= myShares[i].sharedUser;
MySharesGrid.Cells[3, i+1]:= myShares[i].creationDate;
MySharesGrid.Cells[4, i+1]:= statusText[StrToInt(myShares[i].situation) -1];
MySharesGrid.Cells[5, i+1]:= '';
MySharesGrid.Cells[6, i+1]:= '';
end;
end;
Run Code Online (Sandbox Code Playgroud)
我想以两种方式调用这个函数,它没有任何参数和参数.我找到了overload关键字的程序,但我不想写两次相同的功能.
如果我称这个程序为CaseListMyShares('');,那就有效.
但我可以在delphi中执行此操作吗?
procedure TFormMain.CaseListMyShares(search = '': String);
Run Code Online (Sandbox Code Playgroud)
并致电:
CaseListMyShares();
Run Code Online (Sandbox Code Playgroud) 当我优化我的2个单个查询以在不到0.02秒内运行然后UNION它们时,生成的查询需要超过1秒才能运行.此外,UNION ALL比UNION DISTINCT需要更长的时间.我认为允许重复会使查询运行得更快,而不是更慢.我真的最好分开运行2个查询吗?我更愿意使用UNION.
对于主要的浏览器实现,您可以在XMLHttpRequest的send方法中使用的字符串数据的长度是否有文档记录?
当数据超过3k时,我遇到了一个JavaScript XMLHttpRequest Post在FireFox 3中失败的问题.我假设Post的行为与传统的Form Post相同.
W3C文档提到send方法的数据参数是DOMString,但我不确定主要的浏览器是如何实现的.
这是我的JavaScript的简化版本,如果bigText超过3k就失败了,否则它可以工作......
var xhReq = createXMLHttpRequest();
function createXMLHttpRequest() {
try { return new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) {}
try { return new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) {}
try { return new XMLHttpRequest(); } catch(e) {}
alert("XMLHttpRequest not supported");
return null;
}
function mySubmit(id, bigText) {
var url = "SubmitPost.cfm";
var params = "id=" + id + "&bigtext=" + encodeURI(bigText);
xhReq.open("POST", url, true);
//Send the header information along with the request
xhReq.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
xhReq.setRequestHeader("Content-length", params.length); …Run Code Online (Sandbox Code Playgroud) 我有应用程序在Redis中存储和读取日期,当Redis关闭时.Redis启动后jedis连接没有重新创建?
是否有一种方法可以在Jedis中创建连接重试
提前致谢
我尝试了一些不同的方法,比如print(boolean isLeapYear)和其他一些方法,但我无法弄清楚如何使它工作.它总是说我有一个缺少的类(布尔是原始的,它需要一个吗?)无论如何,如果isLeapYear if-else语句是错误的,我不担心那些..我只需要弄清楚如何打印超出布尔值; 任何帮助/点在正确的方向非常感谢=]
import java.util.Scanner;
public class booleanfun {
boolean isLeapYear;
public static void main(String[] args)
{
System.out.println("Enter a year to determine if it is a leap year or not: ");
Scanner kboard = new Scanner(System.in);
int year = kboard.nextInt();
}
public boolean isLeapYear(int year)
{
if (year % 4 != 0)
isLeapYear = false;
else if ((year % 4 == 0) && (year % 100 == 0))
isLeapYear = false;
else if ((year % 4 == 0) && …Run Code Online (Sandbox Code Playgroud) 我将更新npm最新版本但是它显示此错误消息,帮我解决这个问题谢谢..
G:> npm i -g npm ERR!代码ENOLOCAL npm ERR!无法从""安装,因为它不包含package.json文件.
错误的ERR!可以在以下位置找到此运行的完整日志:npm ERR!
C:\ Users\hemanth\AppData\Roaming \npm-cache_logs\2018-01-08T03_34_2 9_774Z-debug.log
G:>
我在尝试使用 Expo CLI 更改 Expo 项目的应用程序图标时遇到问题。尽管我做出了努力,图标仍然没有改变。我已经在 Expo Go 中的 iOS 和 Android 上对此进行了测试,并且确保我使用的图像尺寸为 1024x1024。我什至尝试清除缓存,但图标顽固地保持不变。
有趣的是,当我将应用程序构建为 APK/AAB 并安装它时,我仍然看到默认图标,而不是我指定的自定义图标。我已经三次检查了自定义图标图像的路径,它看起来是正确的。但是,应用程序继续显示默认图标。这是我的 app.json 的屏幕截图
感谢您的时间和帮助!
java ×3
javascript ×2
ajax ×1
angular ×1
boolean ×1
css ×1
delphi ×1
hibernate ×1
highcharts ×1
jedis ×1
jquery ×1
json ×1
mysql ×1
npm ×1
php ×1
printing ×1
react-native ×1
spring ×1
spring-mvc ×1
union ×1
virtualbox ×1
windows ×1
xdebug ×1