m0smith / malabar-mode

EMCS JVM Integration for Java and other JVM based languages
GNU General Public License v2.0
330 stars 52 forks source link

semantic-ia-complete-symbol fails with (wrong-type-argument stringp nil) #145

Open m0smith opened 9 years ago

m0smith commented 9 years ago
Debugger entered--Lisp error: (wrong-type-argument stringp nil)
  file-name-nondirectory(nil)
  file-name-extension(nil)
  ede-jvm-base-project([object ede-malabar-maven2-project "Malabar Maven" nil "Malabar maven dir" "1.0" "c:/Users/lpmsmith/workspace/mh-crypto/" (256 3 . 50500) "c:/Users/lpmsmith/workspace/mh-crypto/pom.xml" nil nil ([object ede-jvm-base-target "ede-jvm-base-target" nil "crypto" "c:/Users/lpmsmith/workspace/mh-crypto/src/main/java/org/ihc/mh/crypto/" nil nil #0] [object malabar-jvm-target "install" nil "install" "c:/Users/lpmsmith/workspace/mh-crypto/pom.xml" nil nil #0] [object malabar-jvm-target "package clean test" nil "package clean test" "c:/Users/lpmsmith/workspace/mh-crypto/pom.xml" nil nil #0]) [object ede-locate-base "Loc" "c:/Users/lpmsmith/workspace/mh-crypto/" "org/apache/commons/codec/binary/Hex.java" nil #s(hash-table size 65 test equal rehash-size 1.5 rehash-threshold 0.8 data ("java/io/IOException.java" nomatch "java/io/InputStream.java" nomatch "java/io/UnsupportedEncodingException.java" nomatch "java/security/InvalidKeyException.java" nomatch "java/security/NoSuchAlgorithmException.java" nomatch "java/security/spec/AlgorithmParameterSpec.java" nomatch "java/security/spec/InvalidKeySpecException.java" nomatch "java/security/spec/KeySpec.java" nomatch "java/util/Properties.java" nomatch "javax/crypto/Cipher.java" nomatch "javax/crypto/IllegalBlockSizeException.java" nomatch "javax/crypto/NoSuchPaddingException.java" nomatch "javax/crypto/SecretKey.java" nomatch "javax/crypto/SecretKeyFactory.java" nomatch "javax/crypto/spec/DESedeKeySpec.java" nomatch "javax/crypto/spec/PBEKeySpec.java" nomatch "javax/crypto/spec/PBEParameterSpec.java" nomatch "org/apache/commons/codec/DecoderException.java" nomatch "org/apache/commons/codec/binary/Base64.java" nomatch "org/apache/commons/codec/binary/Hex.java" nomatch ...))] unbound "" "" "" "" "" "" ("debug" "release") "debug" nil ("c:\\Users\\lpmsmith\\workspace\\mh-crypto\\src\\test\\resources" "c:\\Users\\lpmsmith\\workspace\\mh-crypto\\src\\main\\resources" "c:\\Users\\lpmsmith\\workspace\\mh-crypto\\src\\test\\java" "c:\\Users\\lpmsmith\\workspace\\mh-crypto\\src\\main\\java" "c:\\Users\\lpmsmith\\workspace\\mh-crypto\\target\\test-classes" "c:\\Users\\lpmsmith\\workspace\\mh-crypto\\target\\classes" "c:\\Users\\lpmsmith\\workspace\\mh-crypto\\target\\classes" "c:\\Users\\lpmsmith\\.m2\\repository\\junit\\junit\\4.11\\junit-4.11.jar" "c:\\Users\\lpmsmith\\.m2\\repository\\org\\hamcrest\\hamcrest-core\\1.3\\hamcrest-core-1.3.jar" "c:\\Users\\lpmsmith\\.m2\\repository\\commons-codec\\commons-codec\\1.4\\commons-codec-1.4.jar" "c:\\Users\\lpmsmith\\.m2\\repository\\org\\springframework\\spring-beans\\3.0.5.RELEASE\\spring-beans-3.0.5.RELEASE.jar" "c:\\Users\\lpmsmith\\.m2\\repository\\org\\springframework\\spring-core\\3.0.5.RELEASE\\spring-core-3.0.5.RELEASE.jar" "c:\\Users\\lpmsmith\\.m2\\repository\\org\\springframework\\spring-asm\\3.0.5.RELEASE\\spring-asm-3.0.5.RELEASE.jar" "c:\\Users\\lpmsmith\\.m2\\repository\\commons-logging\\commons-logging\\1.1.1\\commons-logging-1.1.1.jar") 0 "install" nil nil ";; EDE Maven2 project wrapper" nil] #<buffer *javap output*>)
  apply(ede-jvm-base-project ([object ede-malabar-maven2-project "Malabar Maven" nil "Malabar maven dir" "1.0" "c:/Users/lpmsmith/workspace/mh-crypto/" (256 3 . 50500) "c:/Users/lpmsmith/workspace/mh-crypto/pom.xml" nil nil ([object ede-jvm-base-target "ede-jvm-base-target" nil "crypto" "c:/Users/lpmsmith/workspace/mh-crypto/src/main/java/org/ihc/mh/crypto/" nil nil #1] [object malabar-jvm-target "install" nil "install" "c:/Users/lpmsmith/workspace/mh-crypto/pom.xml" nil nil #1] [object malabar-jvm-target "package clean test" nil "package clean test" "c:/Users/lpmsmith/workspace/mh-crypto/pom.xml" nil nil #1]) [object ede-locate-base "Loc" "c:/Users/lpmsmith/workspace/mh-crypto/" "org/apache/commons/codec/binary/Hex.java" nil #s(hash-table size 65 test equal rehash-size 1.5 rehash-threshold 0.8 data ("java/io/IOException.java" nomatch "java/io/InputStream.java" nomatch "java/io/UnsupportedEncodingException.java" nomatch "java/security/InvalidKeyException.java" nomatch "java/security/NoSuchAlgorithmException.java" nomatch "java/security/spec/AlgorithmParameterSpec.java" nomatch "java/security/spec/InvalidKeySpecException.java" nomatch "java/security/spec/KeySpec.java" nomatch "java/util/Properties.java" nomatch "javax/crypto/Cipher.java" nomatch "javax/crypto/IllegalBlockSizeException.java" nomatch "javax/crypto/NoSuchPaddingException.java" nomatch "javax/crypto/SecretKey.java" nomatch "javax/crypto/SecretKeyFactory.java" nomatch "javax/crypto/spec/DESedeKeySpec.java" nomatch "javax/crypto/spec/PBEKeySpec.java" nomatch "javax/crypto/spec/PBEParameterSpec.java" nomatch "org/apache/commons/codec/DecoderException.java" nomatch "org/apache/commons/codec/binary/Base64.java" nomatch "org/apache/commons/codec/binary/Hex.java" nomatch ...))] unbound "" "" "" "" "" "" ("debug" "release") "debug" nil ("c:\\Users\\lpmsmith\\workspace\\mh-crypto\\src\\test\\resources" "c:\\Users\\lpmsmith\\workspace\\mh-crypto\\src\\main\\resources" "c:\\Users\\lpmsmith\\workspace\\mh-crypto\\src\\test\\java" "c:\\Users\\lpmsmith\\workspace\\mh-crypto\\src\\main\\java" "c:\\Users\\lpmsmith\\workspace\\mh-crypto\\target\\test-classes" "c:\\Users\\lpmsmith\\workspace\\mh-crypto\\target\\classes" "c:\\Users\\lpmsmith\\workspace\\mh-crypto\\target\\classes" "c:\\Users\\lpmsmith\\.m2\\repository\\junit\\junit\\4.11\\junit-4.11.jar" "c:\\Users\\lpmsmith\\.m2\\repository\\org\\hamcrest\\hamcrest-core\\1.3\\hamcrest-core-1.3.jar" "c:\\Users\\lpmsmith\\.m2\\repository\\commons-codec\\commons-codec\\1.4\\commons-codec-1.4.jar" "c:\\Users\\lpmsmith\\.m2\\repository\\org\\springframework\\spring-beans\\3.0.5.RELEASE\\spring-beans-3.0.5.RELEASE.jar" "c:\\Users\\lpmsmith\\.m2\\repository\\org\\springframework\\spring-core\\3.0.5.RELEASE\\spring-core-3.0.5.RELEASE.jar" "c:\\Users\\lpmsmith\\.m2\\repository\\org\\springframework\\spring-asm\\3.0.5.RELEASE\\spring-asm-3.0.5.RELEASE.jar" "c:\\Users\\lpmsmith\\.m2\\repository\\commons-logging\\commons-logging\\1.1.1\\commons-logging-1.1.1.jar") 0 "install" nil nil ";; EDE Maven2 project wrapper" nil] #<buffer *javap output*>))
  eieio-generic-call-primary-only(ede-find-target ([object ede-malabar-maven2-project "Malabar Maven" nil "Malabar maven dir" "1.0" "c:/Users/lpmsmith/workspace/mh-crypto/" (256 3 . 50500) "c:/Users/lpmsmith/workspace/mh-crypto/pom.xml" nil nil ([object ede-jvm-base-target "ede-jvm-base-target" nil "crypto" "c:/Users/lpmsmith/workspace/mh-crypto/src/main/java/org/ihc/mh/crypto/" nil nil #1] [object malabar-jvm-target "install" nil "install" "c:/Users/lpmsmith/workspace/mh-crypto/pom.xml" nil nil #1] [object malabar-jvm-target "package clean test" nil "package clean test" "c:/Users/lpmsmith/workspace/mh-crypto/pom.xml" nil nil #1]) [object ede-locate-base "Loc" "c:/Users/lpmsmith/workspace/mh-crypto/" "org/apache/commons/codec/binary/Hex.java" nil #s(hash-table size 65 test equal rehash-size 1.5 rehash-threshold 0.8 data ("java/io/IOException.java" nomatch "java/io/InputStream.java" nomatch "java/io/UnsupportedEncodingException.java" nomatch "java/security/InvalidKeyException.java" nomatch "java/security/NoSuchAlgorithmException.java" nomatch "java/security/spec/AlgorithmParameterSpec.java" nomatch "java/security/spec/InvalidKeySpecException.java" nomatch "java/security/spec/KeySpec.java" nomatch "java/util/Properties.java" nomatch "javax/crypto/Cipher.java" nomatch "javax/crypto/IllegalBlockSizeException.java" nomatch "javax/crypto/NoSuchPaddingException.java" nomatch "javax/crypto/SecretKey.java" nomatch "javax/crypto/SecretKeyFactory.java" nomatch "javax/crypto/spec/DESedeKeySpec.java" nomatch "javax/crypto/spec/PBEKeySpec.java" nomatch "javax/crypto/spec/PBEParameterSpec.java" nomatch "org/apache/commons/codec/DecoderException.java" nomatch "org/apache/commons/codec/binary/Base64.java" nomatch "org/apache/commons/codec/binary/Hex.java" nomatch ...))] unbound "" "" "" "" "" "" ("debug" "release") "debug" nil ("c:\\Users\\lpmsmith\\workspace\\mh-crypto\\src\\test\\resources" "c:\\Users\\lpmsmith\\workspace\\mh-crypto\\src\\main\\resources" "c:\\Users\\lpmsmith\\workspace\\mh-crypto\\src\\test\\java" "c:\\Users\\lpmsmith\\workspace\\mh-crypto\\src\\main\\java" "c:\\Users\\lpmsmith\\workspace\\mh-crypto\\target\\test-classes" "c:\\Users\\lpmsmith\\workspace\\mh-crypto\\target\\classes" "c:\\Users\\lpmsmith\\workspace\\mh-crypto\\target\\classes" "c:\\Users\\lpmsmith\\.m2\\repository\\junit\\junit\\4.11\\junit-4.11.jar" "c:\\Users\\lpmsmith\\.m2\\repository\\org\\hamcrest\\hamcrest-core\\1.3\\hamcrest-core-1.3.jar" "c:\\Users\\lpmsmith\\.m2\\repository\\commons-codec\\commons-codec\\1.4\\commons-codec-1.4.jar" "c:\\Users\\lpmsmith\\.m2\\repository\\org\\springframework\\spring-beans\\3.0.5.RELEASE\\spring-beans-3.0.5.RELEASE.jar" "c:\\Users\\lpmsmith\\.m2\\repository\\org\\springframework\\spring-core\\3.0.5.RELEASE\\spring-core-3.0.5.RELEASE.jar" "c:\\Users\\lpmsmith\\.m2\\repository\\org\\springframework\\spring-asm\\3.0.5.RELEASE\\spring-asm-3.0.5.RELEASE.jar" "c:\\Users\\lpmsmith\\.m2\\repository\\commons-logging\\commons-logging\\1.1.1\\commons-logging-1.1.1.jar") 0 "install" nil nil ";; EDE Maven2 project wrapper" nil] #<buffer *javap output*>))
  ede-find-target([object ede-malabar-maven2-project "Malabar Maven" nil "Malabar maven dir" "1.0" "c:/Users/lpmsmith/workspace/mh-crypto/" (256 3 . 50500) "c:/Users/lpmsmith/workspace/mh-crypto/pom.xml" nil nil ([object ede-jvm-base-target "ede-jvm-base-target" nil "crypto" "c:/Users/lpmsmith/workspace/mh-crypto/src/main/java/org/ihc/mh/crypto/" nil nil #0] [object malabar-jvm-target "install" nil "install" "c:/Users/lpmsmith/workspace/mh-crypto/pom.xml" nil nil #0] [object malabar-jvm-target "package clean test" nil "package clean test" "c:/Users/lpmsmith/workspace/mh-crypto/pom.xml" nil nil #0]) [object ede-locate-base "Loc" "c:/Users/lpmsmith/workspace/mh-crypto/" "org/apache/commons/codec/binary/Hex.java" nil #s(hash-table size 65 test equal rehash-size 1.5 rehash-threshold 0.8 data ("java/io/IOException.java" nomatch "java/io/InputStream.java" nomatch "java/io/UnsupportedEncodingException.java" nomatch "java/security/InvalidKeyException.java" nomatch "java/security/NoSuchAlgorithmException.java" nomatch "java/security/spec/AlgorithmParameterSpec.java" nomatch "java/security/spec/InvalidKeySpecException.java" nomatch "java/security/spec/KeySpec.java" nomatch "java/util/Properties.java" nomatch "javax/crypto/Cipher.java" nomatch "javax/crypto/IllegalBlockSizeException.java" nomatch "javax/crypto/NoSuchPaddingException.java" nomatch "javax/crypto/SecretKey.java" nomatch "javax/crypto/SecretKeyFactory.java" nomatch "javax/crypto/spec/DESedeKeySpec.java" nomatch "javax/crypto/spec/PBEKeySpec.java" nomatch "javax/crypto/spec/PBEParameterSpec.java" nomatch "org/apache/commons/codec/DecoderException.java" nomatch "org/apache/commons/codec/binary/Base64.java" nomatch "org/apache/commons/codec/binary/Hex.java" nomatch ...))] unbound "" "" "" "" "" "" ("debug" "release") "debug" nil ("c:\\Users\\lpmsmith\\workspace\\mh-crypto\\src\\test\\resources" "c:\\Users\\lpmsmith\\workspace\\mh-crypto\\src\\main\\resources" "c:\\Users\\lpmsmith\\workspace\\mh-crypto\\src\\test\\java" "c:\\Users\\lpmsmith\\workspace\\mh-crypto\\src\\main\\java" "c:\\Users\\lpmsmith\\workspace\\mh-crypto\\target\\test-classes" "c:\\Users\\lpmsmith\\workspace\\mh-crypto\\target\\classes" "c:\\Users\\lpmsmith\\workspace\\mh-crypto\\target\\classes" "c:\\Users\\lpmsmith\\.m2\\repository\\junit\\junit\\4.11\\junit-4.11.jar" "c:\\Users\\lpmsmith\\.m2\\repository\\org\\hamcrest\\hamcrest-core\\1.3\\hamcrest-core-1.3.jar" "c:\\Users\\lpmsmith\\.m2\\repository\\commons-codec\\commons-codec\\1.4\\commons-codec-1.4.jar" "c:\\Users\\lpmsmith\\.m2\\repository\\org\\springframework\\spring-beans\\3.0.5.RELEASE\\spring-beans-3.0.5.RELEASE.jar" "c:\\Users\\lpmsmith\\.m2\\repository\\org\\springframework\\spring-core\\3.0.5.RELEASE\\spring-core-3.0.5.RELEASE.jar" "c:\\Users\\lpmsmith\\.m2\\repository\\org\\springframework\\spring-asm\\3.0.5.RELEASE\\spring-asm-3.0.5.RELEASE.jar" "c:\\Users\\lpmsmith\\.m2\\repository\\commons-logging\\commons-logging\\1.1.1\\commons-logging-1.1.1.jar") 0 "install" nil nil ";; EDE Maven2 project wrapper" nil] #<buffer *javap output*>)
  ede-buffer-object(#<buffer *javap output*> ede-object-project)
  ede-initialize-state-current-buffer()
  ede-minor-mode()
  malabar-mode-body()
  malabar-java-mode()
  run-hooks(change-major-mode-after-body-hook prog-mode-hook c-mode-common-hook java-mode-hook java-mode-hook)
  apply(run-hooks (change-major-mode-after-body-hook prog-mode-hook c-mode-common-hook java-mode-hook java-mode-hook))
  run-mode-hooks(java-mode-hook)
  java-mode()
  semanticdb-javap-extract-tag-table("c:/Program Files/Java/jdk1.7.0_45/jre/lib/rt.jar" "java/io/IOException.class")
mrhota commented 9 years ago

I'm seeing this, too, but I'm not sure semantic-ia-complete-symbol is causing it. Malabar never seems to start. (I don't know how to get an emacs debug trace like yours)

I ran C-u M-x run-groovy, then opened a Java file. I get no syntax coloring and the message from the title.

EDIT: Trying to open a Java file results in this message in Messages:

file-name-nondirectory: Wrong type argument: stringp, nil
runebr commented 9 years ago

I also have this. Seems to be caused by javap output buffer which has no file. I worked around it by wrapping the body of malabar-mode-body in when:

(defun malabar-mode-body ()
  (when (buffer-file-name (current-buffer))
  ...
m0smith commented 9 years ago

Thanks. I will get that looked at. I am in the middle of a large refactor to support gradle as well as maven so things are a bit broken but I will get this in as soon as I can. Do a pull request and I will get it added.