⚲
Project
Profile
Help
Tour this page
Frequent Planio Questions
Learning Resources
Sign in
Register
Switch Planio account
Open in Planio App
Share current page
Search
:
Projects
All Projects
Help
Tour this page
Frequent Planio Questions
Learning Resources
Sign in
Register
Switch Planio account
Open in Planio App
Share current page
Saxon
Overview
Roadmap
Issues
Calendar
Blog
Documents
Forums
Files
Repository
Download (1.39 KB)
Bug #2327
ยป InstantiationProblem.java
Reproduction of issue -
Gunther Rademacher
, 2015-03-12 16:56
import
net.sf.saxon.Configuration
;
import
com.saxonica.config.EnterpriseConfiguration
;
public
class
InstantiationProblem
{
public
static
void
main
(
String
[]
args
)
throws
Exception
{
Thread
enterpriseConfigurationUser
=
new
Thread
()
{
public
void
run
()
{
// the following would be a workaround:
//
// try {
// Class.forName("net.sf.saxon.Configuration");
// }
// catch (Exception e) {
// throw new RuntimeException(e);
// }
new
EnterpriseConfiguration
();
// <-- originally in ConfigurationFactory.getConfiguration()
}
};
Thread
transformerUser
=
new
Thread
()
{
public
void
run
()
{
new
Configuration
();
// <-- originally via TransformerFactory.newInstance()
}
};
enterpriseConfigurationUser
.
start
();
transformerUser
.
start
();
for
(
int
i
=
2
;
;
i
+=
2
)
{
Thread
.
sleep
(
2000
);
if
(!
(
enterpriseConfigurationUser
.
isAlive
()
&&
transformerUser
.
isAlive
()))
break
;
System
.
out
.
println
(
"both threads alive after "
+
i
+
" sec"
);
if
(
i
>=
10
)
{
for
(
Thread
t
:
new
Thread
[]{
enterpriseConfigurationUser
,
transformerUser
})
{
System
.
out
.
println
(
"stack trace:"
);
for
(
StackTraceElement
s
:
t
.
getStackTrace
())
System
.
out
.
println
(
" "
+
s
);
}
System
.
exit
(
1
);
}
}
transformerUser
.
join
();
enterpriseConfigurationUser
.
join
();
System
.
out
.
println
(
"done"
);
}
}
(1-1/1)
Loading...