java.io.IOException: code-source:/C:/my/ws31/NewOC4J/ora92/j2ee/home/applications/SeniorApps/ejbSenior.jar has no "!<pat h>" suffix so does not name a path within the code-source.

Hibernate JIRA | Jifeng Liu | 1 decade ago
  1. 0

    In Oracle OC4J server, I created an EJB jar file, ejbSenior.jar, and put persistence.xml in its /META-INF folder. After deploying this EJB jar, I called javax.persistence.Persistence.createEntityManagerFactory("hibernate"). I got the following debug information and exception stack trace: 14:36:23 DEBUG Ejb3Configuration - Archive to be processed by hibernate Entity Manager implementation found 14:36:23 DEBUG JarVisitor - Searching mapped entities in jar/par: code-source:/C:/my/ws31/NewOC4J/ora92/j2ee/home/applic ations/SeniorApps/ejbSenior.jar 14:36:23 DEBUG Ejb3Configuration - Persistence unit name: hibernate 14:36:23 DEBUG Ejb3Configuration - emname:hibernate metadata: hibernate 14:36:23 WARN InputStreamZippedJarVisitor - Unable to find file (ignored): code-source:/C:/my/ws31/NewOC4J/ora92/j2ee/h ome/applications/SeniorApps/ejbSenior.jar java.io.IOException: code-source:/C:/my/ws31/NewOC4J/ora92/j2ee/home/applications/SeniorApps/ejbSenior.jar has no "!<pat h>" suffix so does not name a path within the code-source. at oracle.classloader.SharedCodeSourceSet.getResourceStream(SharedCodeSourceSet.java:482) at oracle.classloader.SharedCodeSourceURL$Connection.getInputStream(SharedCodeSourceURL.java:93) at java.net.URL.openStream(URL.java:1007) at org.hibernate.ejb.packaging.InputStreamZippedJarVisitor.doProcessElements(InputStreamZippedJarVisitor.java:33) at org.hibernate.ejb.packaging.JarVisitor.getMatchingEntries(JarVisitor.java:208) at org.hibernate.ejb.Ejb3Configuration.addMetadataFromVisitor(Ejb3Configuration.java:201) at org.hibernate.ejb.Ejb3Configuration.createEntityManagerFactory(Ejb3Configuration.java:183) at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:114) at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:37) at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:27) at com.senior.dal.shared.util.HbSessionFactory.getEntityManagerFactory(HbSessionFactory.java:40) After debugging it, I found Oracle OC4J's class loader creates a special URL with protocol 'code-source'. You can use this URL to get any resource inside EJB jar file. But you can't use it to read the EJB jar file itself. I wrote a small patch to fix it by changing the URL to an URL pointing to a file: In org.hibernate.ejb.packaging.JarVisitor java file, I add new code between "patch begins" and "patch ends" comment: public static final URL getJarURLFromURLEntry(URL url, String entry) throws IllegalArgumentException { URL jarUrl; String file = url.getFile(); if ( ! entry.startsWith( "/" ) ) entry = "/" + entry; file = file.substring( 0, file.length() - entry.length() ); if ( file.endsWith( "!" ) ) file = file.substring( 0, file.length() - 1 ); try { if ( "jar".equals( url.getProtocol() ) ) { jarUrl = new URL( file ); } // patch starts else if ("code-source".equals( url.getProtocol() ) ) { jarUrl = new File(file).toURL(); } // patch ends else { jarUrl = new URL( url.getProtocol(), url.getHost(), url.getPort(), file ); } } catch (MalformedURLException e) { throw new IllegalArgumentException( "Unable to determine JAR Url from " + url + ". Cause: " + e.getMessage() ); } return jarUrl; }

    Hibernate JIRA | 1 decade ago | Jifeng Liu
    java.io.IOException: code-source:/C:/my/ws31/NewOC4J/ora92/j2ee/home/applications/SeniorApps/ejbSenior.jar has no "!<pat h>" suffix so does not name a path within the code-source.
  2. 0

    In Oracle OC4J server, I created an EJB jar file, ejbSenior.jar, and put persistence.xml in its /META-INF folder. After deploying this EJB jar, I called javax.persistence.Persistence.createEntityManagerFactory("hibernate"). I got the following debug information and exception stack trace: 14:36:23 DEBUG Ejb3Configuration - Archive to be processed by hibernate Entity Manager implementation found 14:36:23 DEBUG JarVisitor - Searching mapped entities in jar/par: code-source:/C:/my/ws31/NewOC4J/ora92/j2ee/home/applic ations/SeniorApps/ejbSenior.jar 14:36:23 DEBUG Ejb3Configuration - Persistence unit name: hibernate 14:36:23 DEBUG Ejb3Configuration - emname:hibernate metadata: hibernate 14:36:23 WARN InputStreamZippedJarVisitor - Unable to find file (ignored): code-source:/C:/my/ws31/NewOC4J/ora92/j2ee/h ome/applications/SeniorApps/ejbSenior.jar java.io.IOException: code-source:/C:/my/ws31/NewOC4J/ora92/j2ee/home/applications/SeniorApps/ejbSenior.jar has no "!<pat h>" suffix so does not name a path within the code-source. at oracle.classloader.SharedCodeSourceSet.getResourceStream(SharedCodeSourceSet.java:482) at oracle.classloader.SharedCodeSourceURL$Connection.getInputStream(SharedCodeSourceURL.java:93) at java.net.URL.openStream(URL.java:1007) at org.hibernate.ejb.packaging.InputStreamZippedJarVisitor.doProcessElements(InputStreamZippedJarVisitor.java:33) at org.hibernate.ejb.packaging.JarVisitor.getMatchingEntries(JarVisitor.java:208) at org.hibernate.ejb.Ejb3Configuration.addMetadataFromVisitor(Ejb3Configuration.java:201) at org.hibernate.ejb.Ejb3Configuration.createEntityManagerFactory(Ejb3Configuration.java:183) at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:114) at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:37) at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:27) at com.senior.dal.shared.util.HbSessionFactory.getEntityManagerFactory(HbSessionFactory.java:40) After debugging it, I found Oracle OC4J's class loader creates a special URL with protocol 'code-source'. You can use this URL to get any resource inside EJB jar file. But you can't use it to read the EJB jar file itself. I wrote a small patch to fix it by changing the URL to an URL pointing to a file: In org.hibernate.ejb.packaging.JarVisitor java file, I add new code between "patch begins" and "patch ends" comment: public static final URL getJarURLFromURLEntry(URL url, String entry) throws IllegalArgumentException { URL jarUrl; String file = url.getFile(); if ( ! entry.startsWith( "/" ) ) entry = "/" + entry; file = file.substring( 0, file.length() - entry.length() ); if ( file.endsWith( "!" ) ) file = file.substring( 0, file.length() - 1 ); try { if ( "jar".equals( url.getProtocol() ) ) { jarUrl = new URL( file ); } // patch starts else if ("code-source".equals( url.getProtocol() ) ) { jarUrl = new File(file).toURL(); } // patch ends else { jarUrl = new URL( url.getProtocol(), url.getHost(), url.getPort(), file ); } } catch (MalformedURLException e) { throw new IllegalArgumentException( "Unable to determine JAR Url from " + url + ". Cause: " + e.getMessage() ); } return jarUrl; }

    Hibernate JIRA | 1 decade ago | Jifeng Liu
    java.io.IOException: code-source:/C:/my/ws31/NewOC4J/ora92/j2ee/home/applications/SeniorApps/ejbSenior.jar has no "!<pat h>" suffix so does not name a path within the code-source.
  3. 0

    JSF and Facelets on OC4J 10.1.2 / 10.1.3_dp4

    Oracle Community | 1 decade ago | 460910
    java.io.IOException: code-source:/D:/dev/Server/oc4j_10.1.3_dp4/j2ee/home/applications/JSF/JSF63622/WEB-INF/lib/xhtml-lat1.ent has no "!<path>" suffix so does not name a path within the code-source.
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Hi, The artifactory plugin causes a build failure while performing a release with the Maven Release plugin. At the end of the build Artifactory tries to upload the old snapshot instead of deploying the new one. The issue has already been reported here [#HAP-93] and fixed for version 1.3.5, it seems to be a regression. Artifactory used to detect the release build and skip the uploading phase. However, the release versions are correctly uploaded to Artifactory during the maven-deploy phase. Here is the stack trace : {noformat} mojoSucceeded org.apache.maven.plugins:maven-release-plugin:2.3.2(default-cli) projectSucceeded ****:0.1.3-SNAPSHOT [INFO] Artifactory Build Info Recorder: Deploying artifacts to http://****/libs-release-local [INFO] Deploying artifact: http://****/libs-snapshot-local/****/****-0.1.3-SNAPSHOT.pom mavenExecutionResult exceptions not empty message : Internal error: java.lang.RuntimeException: Error occurred while publishing artifact to Artifactory: ****\pom.xml. Skipping deployment of remaining artifacts (if any) and build info. cause : Error occurred while publishing artifact to Artifactory: ****\pom.xml. Skipping deployment of remaining artifacts (if any) and build info. Stack trace : org.apache.maven.InternalErrorException: Internal error: java.lang.RuntimeException: Error occurred while publishing artifact to Artifactory: ****\pom.xml. Skipping deployment of remaining artifacts (if any) and build info. at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:168) at org.jvnet.hudson.maven3.launcher.Maven3Launcher.main(Maven3Launcher.java:79) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.codehaus.plexus.classworlds.launcher.Launcher.launchStandard(Launcher.java:329) at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:239) at org.jvnet.hudson.maven3.agent.Maven3Main.launch(Maven3Main.java:158) at hudson.maven.Maven3Builder.call(Maven3Builder.java:98) at hudson.maven.Maven3Builder.call(Maven3Builder.java:64) at hudson.remoting.UserRequest.perform(UserRequest.java:118) at hudson.remoting.UserRequest.perform(UserRequest.java:48) at hudson.remoting.Request$2.run(Request.java:326) at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) at java.util.concurrent.FutureTask.run(FutureTask.java:138) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:662) Caused by: java.lang.RuntimeException: Error occurred while publishing artifact to Artifactory: ****\pom.xml. Skipping deployment of remaining artifacts (if any) and build info. at org.jfrog.build.extractor.maven.BuildDeploymentHelper.deployArtifacts(BuildDeploymentHelper.java:135) at org.jfrog.build.extractor.maven.BuildDeploymentHelper.deploy(BuildDeploymentHelper.java:78) at org.jfrog.build.extractor.maven.BuildInfoRecorder.sessionEnded(BuildInfoRecorder.java:130) at org.apache.maven.lifecycle.internal.DefaultExecutionEventCatapult.fire(DefaultExecutionEventCatapult.java:64) at org.apache.maven.lifecycle.internal.DefaultExecutionEventCatapult.fire(DefaultExecutionEventCatapult.java:42) at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:170) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156) ... 19 more Caused by: java.io.IOException: Failed to deploy file: HTTP response code: 409. HTTP response message: The target deployment path '****-0.1.3-20130123.161654-2.pom' does not match the POM's expected path prefix '****/0.1.4-SNAPSHOT'. Please verify your POM content for correctness and make sure the source path is a valid Maven repository root path. at org.jfrog.build.client.ArtifactoryBuildInfoClient.throwHttpIOException(ArtifactoryBuildInfoClient.java:642) at org.jfrog.build.client.ArtifactoryBuildInfoClient.uploadFile(ArtifactoryBuildInfoClient.java:517) at org.jfrog.build.client.ArtifactoryBuildInfoClient.deployArtifact(ArtifactoryBuildInfoClient.java:292) at org.jfrog.build.extractor.maven.BuildDeploymentHelper.deployArtifacts(BuildDeploymentHelper.java:133) ... 26 more channel stopped Finished: FAILURE {noformat}

    JFrog JIRA | 4 years ago | Oph??lie Salm
    org.apache.maven.InternalErrorException: Internal error: java.lang.RuntimeException: Error occurred while publishing artifact to Artifactory: ****\pom.xml. Skipping deployment of remaining artifacts (if any) and build info.
  6. 0

    Currently running into an issue with how the artifactory plugin is working when performing a release in Hudson using the maven release plugin (http://wiki.hudson-ci.org/display/HUDSON/M2+Release+Plugin). The problem occurs at the end of the release when it is trying to publish the new snapshot to artifactory. For some reason the artifactory plugin things it is working with the old snapshot version and won't let the artifact be put into artifactory. Here is the relevant log entry on hudson. {code} Deploying artifacts to http://artifactory-repo:8081 Deploying artifacts of module: groupid:artifactid Deploying artifact: http://artifactory-repo:8081/local-snapshots/groupid/artifactid/0.0.7-SNAPSHOT/artifactid-0.0.7-SNAPSHOT.pom ERROR: Failed to deploy file: HTTP response code: 404. HTTP response message: The target deployment path 'groupid/artifactid/0.0.7-SNAPSHOT/artifactid-0.0.7-SNAPSHOT.pom' does not match the POM's expected path prefix 'groupid/artifactid/0.0.8-SNAPSHOT'. Please verify your POM content for correctness and make sure the source path is a valid Maven 2 repository root path. java.io.IOException: Failed to deploy file: HTTP response code: 404. HTTP response message: The target deployment path 'groupid/artifactid/0.0.7-SNAPSHOT/artifactid-0.0.7-SNAPSHOT.pom' does not match the POM's expected path prefix 'groupid/artifactid/0.0.8-SNAPSHOT'. Please verify your POM content for correctness and make sure the source path is a valid Maven 2 repository root path. at org.jfrog.build.client.ArtifactoryBuildInfoClient.throwHttpIOException(ArtifactoryBuildInfoClient.java:441) at org.jfrog.build.client.ArtifactoryBuildInfoClient.uploadFile(ArtifactoryBuildInfoClient.java:374) at org.jfrog.build.client.ArtifactoryBuildInfoClient.deployArtifact(ArtifactoryBuildInfoClient.java:275) at org.jfrog.hudson.maven2.ArtifactsDeployer.deployArtifact(ArtifactsDeployer.java:125) at org.jfrog.hudson.maven2.ArtifactsDeployer.deploy(ArtifactsDeployer.java:89) at org.jfrog.hudson.ArtifactoryRedeployPublisher.perform(ArtifactoryRedeployPublisher.java:177) at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:19) at hudson.model.AbstractBuild$AbstractRunner.perform(AbstractBuild.java:601) at hudson.model.AbstractBuild$AbstractRunner.performAllBuildSteps(AbstractBuild.java:580) at hudson.maven.MavenModuleSetBuild$RunnerImpl.post2(MavenModuleSetBuild.java:595) at hudson.model.AbstractBuild$AbstractRunner.post(AbstractBuild.java:528) at hudson.model.Run.run(Run.java:1303) at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:293) at hudson.model.ResourceController.execute(ResourceController.java:88) at hudson.model.Executor.run(Executor.java:137) Skipping sonar analysis due to bad build status FAILURE Finished: FAILURE {code} artifactory-repo, groupid, and artifactid are replacements for non-public domain information.

    JFrog JIRA | 6 years ago | Shawn Clark
    java.io.IOException: Failed to deploy file: HTTP response code: 404. HTTP response message: The target deployment path 'groupid/artifactid/0.0.7-SNAPSHOT/artifactid-0.0.7-SNAPSHOT.pom' does not match the POM's expected path prefix 'groupid/artifactid/0.0.8-SNAPSHOT'. Please verify your POM content for correctness and make sure the source path is a valid Maven 2 repository root path.

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.io.IOException

      code-source:/C:/my/ws31/NewOC4J/ora92/j2ee/home/applications/SeniorApps/ejbSenior.jar has no "!<pat h>" suffix so does not name a path within the code-source.

      at oracle.classloader.SharedCodeSourceSet.getResourceStream()
    2. oracle.classloader
      SharedCodeSourceURL$Connection.getInputStream
      1. oracle.classloader.SharedCodeSourceSet.getResourceStream(SharedCodeSourceSet.java:482)
      2. oracle.classloader.SharedCodeSourceURL$Connection.getInputStream(SharedCodeSourceURL.java:93)
      2 frames
    3. Java RT
      URL.openStream
      1. java.net.URL.openStream(URL.java:1007)
      1 frame
    4. Hibernate EJB
      HibernatePersistence.createEntityManagerFactory
      1. org.hibernate.ejb.packaging.InputStreamZippedJarVisitor.doProcessElements(InputStreamZippedJarVisitor.java:33)
      2. org.hibernate.ejb.packaging.JarVisitor.getMatchingEntries(JarVisitor.java:208)
      3. org.hibernate.ejb.Ejb3Configuration.addMetadataFromVisitor(Ejb3Configuration.java:201)
      4. org.hibernate.ejb.Ejb3Configuration.createEntityManagerFactory(Ejb3Configuration.java:183)
      5. org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:114)
      5 frames
    5. JavaEE 7
      Persistence.createEntityManagerFactory
      1. javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:37)
      2. javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:27)
      2 frames
    6. com.senior.dal
      HbSessionFactory.getEntityManagerFactory
      1. com.senior.dal.shared.util.HbSessionFactory.getEntityManagerFactory(HbSessionFactory.java:40)
      1 frame