on 2018 Nov 06 4:26 PM
Unfortunately there is another nice little bug in 1808.2 backoffice: when opening the Inventory adapt stock popover the icons OK and X icons are not shown and a IOException is thown in com.hybris.cockpitng.core.persistence.packaging.impl.WidgetJarResourceReader.
The reason is that the ZipInputStream is closed when the underlying JarFile is closed ...
Request clarification before answering.
This little aspect fixes this:
/**
* Fixes a {@link java.io.IOException} when loading resources from jar files.
*/
@Aspect
public class BackofficeJarResourceClosedFixAspect
{
private static final Logger LOG = Logger.getLogger(BackofficeJarResourceClosedFixAspect.class);
@Around("execution(* com.hybris.cockpitng.core.persistence.packaging.impl..*(..)) && args(java.util.jar.JarFile, String)")
public Object method(ProceedingJoinPoint pjp) throws Throwable
{
if (LOG.isDebugEnabled())
{
LOG.debug("Wrapping JAR resource input stream so that is not being closed when the underlying JarFile is closed.");
}
// copy stream so that it will not be closed when the underlying jar file is closed
final InputStream bufferedStream = IOUtils.toBufferedInputStream((InputStream) pjp.proceed());
return bufferedStream;
}
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
,
I don't get the details, but if you are sure that there is a problem, please report it via SAP CS support, so that it may be taken care for others.
Cheers, Jacek
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.