diff --git a/protostuff-parser/src/main/java/com/dyuproject/protostuff/parser/Proto.java b/protostuff-parser/src/main/java/com/dyuproject/protostuff/parser/Proto.java
index <HASH>..<HASH> 100644
--- a/protostuff-parser/src/main/java/com/dyuproject/protostuff/parser/Proto.java
+++ b/protostuff-parser/src/main/java/com/dyuproject/protostuff/parser/Proto.java
@@ -89,6 +89,11 @@ public class Proto extends AnnotationContainer
         return file;

     }

     

+    public String getSourcePath()

+    {

+        return file == null ? String.valueOf(url) : file.toString();

+    }

+    

     public Mutable<String> getMutablePackageName()

     {

         return packageName;

@@ -239,7 +244,7 @@ public class Proto extends AnnotationContainer
     void postParse()

     {

         if(packageName == null)

-            throw new IllegalStateException("proto package not defined in " + file);

+            throw new IllegalStateException("proto package not defined in " + getSourcePath());

         

         String javaPkg = extraOptions.get("java_package");

         String javaPackageName = javaPkg==null || javaPkg.length()==0 ?
include file in error message when proto package is not defined.

git-svn-id: <URL>